Geant4 11.2.2
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 42 of file G4VScoreNtupleWriter.hh.

Constructor & Destructor Documentation

◆ ~G4VScoreNtupleWriter()

G4VScoreNtupleWriter::~G4VScoreNtupleWriter ( )
virtual

Definition at line 85 of file G4VScoreNtupleWriter.cc.

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

◆ G4VScoreNtupleWriter()

G4VScoreNtupleWriter::G4VScoreNtupleWriter ( )
protected

Definition at line 57 of file G4VScoreNtupleWriter.cc.

58{
60
61 if(isMaster && (fgMasterInstance != nullptr))
62 {
63 G4ExceptionDescription description;
64 description << " "
65 << "G4VScoreNtupleWriter on master already exists."
66 << "Cannot create another instance.";
67 G4Exception("G4VScoreNtupleWriter::G4VScoreNtupleWriter()", "Analysis_F001",
68 FatalException, description);
69 }
70 if(fgInstance != nullptr)
71 {
72 G4ExceptionDescription description;
73 description << " "
74 << "G4VScoreNtupleWriter on worker already exists."
75 << "Cannot create another instance.";
76 G4Exception("G4VScoreNtupleWriter::G4VScoreNtupleWriter()", "Analysis_F001",
77 FatalException, description);
78 }
79 if(isMaster)
80 fgMasterInstance = this;
81 fgInstance = this;
82}
@ 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()

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 == nullptr))
46 {
47 if(fgMasterInstance != nullptr)
48 {
50 }
51 }
52
53 return fgInstance;
54}
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 = nullptr
staticprotected

Definition at line 62 of file G4VScoreNtupleWriter.hh.

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

◆ fgMasterInstance

G4VScoreNtupleWriter * G4VScoreNtupleWriter::fgMasterInstance = nullptr
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: