Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VScoreNtupleWriter Class Referenceabstract

#include <G4VScoreNtupleWriter.hh>

+ Inheritance diagram for G4VScoreNtupleWriter:

Public Member Functions

virtual ~G4VScoreNtupleWriter ()
 
virtual G4bool Book (G4HCofThisEvent *hce)=0
 
virtual void OpenFile ()=0
 
virtual void Fill (G4HCofThisEvent *hce, G4int eventNumber)=0
 
virtual void Write ()=0
 

Static Public Member Functions

static G4VScoreNtupleWriterInstance ()
 

Protected Member Functions

 G4VScoreNtupleWriter ()
 
virtual G4VScoreNtupleWriterCreateInstance () const =0
 

Static Protected Attributes

static G4VScoreNtupleWriterfgMasterInstance = 0
 
static G4ThreadLocal G4VScoreNtupleWriterfgInstance = 0
 

Detailed Description

Definition at line 42 of file G4VScoreNtupleWriter.hh.

Constructor & Destructor Documentation

◆ ~G4VScoreNtupleWriter()

G4VScoreNtupleWriter::~G4VScoreNtupleWriter ( )
virtual

Definition at line 86 of file G4VScoreNtupleWriter.cc.

87{
88 fgInstance = 0;
89}
static G4ThreadLocal G4VScoreNtupleWriter * fgInstance

◆ G4VScoreNtupleWriter()

G4VScoreNtupleWriter::G4VScoreNtupleWriter ( )
protected

Definition at line 59 of file G4VScoreNtupleWriter.cc.

60{
62
63 if ( isMaster && fgMasterInstance ) {
64 G4ExceptionDescription description;
65 description
66 << " "
67 << "G4VScoreNtupleWriter on master already exists."
68 << "Cannot create another instance.";
69 G4Exception("G4VScoreNtupleWriter::G4VScoreNtupleWriter()",
70 "Analysis_F001", FatalException, description);
71 }
72 if ( fgInstance ) {
73 G4ExceptionDescription description;
74 description
75 << " "
76 << "G4VScoreNtupleWriter on worker already exists."
77 << "Cannot create another instance.";
78 G4Exception("G4VScoreNtupleWriter::G4VScoreNtupleWriter()",
79 "Analysis_F001", FatalException, description);
80 }
81 if ( isMaster ) fgMasterInstance = this;
82 fgInstance = this;
83}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
bool G4bool
Definition: G4Types.hh:86
static G4VScoreNtupleWriter * fgMasterInstance
G4bool IsWorkerThread()
Definition: G4Threading.cc:123

Member Function Documentation

◆ Book()

◆ CreateInstance()

virtual G4VScoreNtupleWriter * G4VScoreNtupleWriter::CreateInstance ( ) const
protectedpure virtual

Implemented in G4TScoreNtupleWriter< T >.

Referenced by Instance().

◆ Fill()

virtual void G4VScoreNtupleWriter::Fill ( G4HCofThisEvent hce,
G4int  eventNumber 
)
pure virtual

◆ Instance()

G4VScoreNtupleWriter * G4VScoreNtupleWriter::Instance ( )
static

Definition at line 37 of file G4VScoreNtupleWriter.cc.

38{
39// This function invokes creating the objects on workes,
40// The master instance should be created by the user
41// via the concrete class constructor
42
44
45 if ( ( ! isMaster ) && ( ! fgInstance ) ) {
46 if ( fgMasterInstance ) {
48 }
49 }
50
51 return fgInstance;
52}
virtual G4VScoreNtupleWriter * CreateInstance() const =0

Referenced by G4RunManager::RunInitialization(), G4WorkerRunManager::RunInitialization(), G4WorkerTaskRunManager::RunInitialization(), G4RunManager::RunTermination(), and G4RunManager::UpdateScoring().

◆ OpenFile()

virtual void G4VScoreNtupleWriter::OpenFile ( )
pure virtual

◆ Write()

virtual void G4VScoreNtupleWriter::Write ( )
pure virtual

Member Data Documentation

◆ fgInstance

G4ThreadLocal G4VScoreNtupleWriter * G4VScoreNtupleWriter::fgInstance = 0
staticprotected

Definition at line 62 of file G4VScoreNtupleWriter.hh.

Referenced by G4VScoreNtupleWriter(), Instance(), and ~G4VScoreNtupleWriter().

◆ fgMasterInstance

G4VScoreNtupleWriter * G4VScoreNtupleWriter::fgMasterInstance = 0
staticprotected

Definition at line 61 of file G4VScoreNtupleWriter.hh.

Referenced by G4VScoreNtupleWriter(), and Instance().


The documentation for this class was generated from the following files: