Geant4 11.3.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 = nullptr
 
static G4ThreadLocal G4VScoreNtupleWriterfgInstance = nullptr
 

Detailed Description

Definition at line 43 of file G4VScoreNtupleWriter.hh.

Constructor & Destructor Documentation

◆ ~G4VScoreNtupleWriter()

G4VScoreNtupleWriter::~G4VScoreNtupleWriter ( )
virtual

Definition at line 86 of file G4VScoreNtupleWriter.cc.

86{ fgInstance = nullptr; }
static G4ThreadLocal G4VScoreNtupleWriter * fgInstance

◆ G4VScoreNtupleWriter()

G4VScoreNtupleWriter::G4VScoreNtupleWriter ( )
protected

Definition at line 58 of file G4VScoreNtupleWriter.cc.

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

Referenced by G4TScoreNtupleWriter< T >::CreateInstance(), CreateInstance(), and Instance().

Member Function Documentation

◆ Book()

◆ CreateInstance()

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

Implemented in G4TScoreNtupleWriter< T >.

◆ Fill()

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

◆ Instance()

G4VScoreNtupleWriter * G4VScoreNtupleWriter::Instance ( )
static

Definition at line 38 of file G4VScoreNtupleWriter.cc.

39{
40 // This function invokes creating the objects on workes,
41 // The master instance should be created by the user
42 // via the concrete class constructor
43
45
46 if((!isMaster) && (fgInstance == nullptr))
47 {
48 if(fgMasterInstance != nullptr)
49 {
50 fgInstance = fgMasterInstance->CreateInstance();
51 }
52 }
53
54 return fgInstance;
55}

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

◆ OpenFile()

◆ Write()

virtual void G4VScoreNtupleWriter::Write ( )
pure virtual

Member Data Documentation

◆ fgInstance

G4ThreadLocal G4VScoreNtupleWriter * G4VScoreNtupleWriter::fgInstance = nullptr
staticprotected

Definition at line 65 of file G4VScoreNtupleWriter.hh.

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

◆ fgMasterInstance

G4VScoreNtupleWriter * G4VScoreNtupleWriter::fgMasterInstance = nullptr
staticprotected

Definition at line 64 of file G4VScoreNtupleWriter.hh.

Referenced by G4VScoreNtupleWriter(), and Instance().


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