Geant4  10.02.p03
G4Event Class Reference

#include <G4Event.hh>

Collaboration diagram for G4Event:

Public Member Functions

 G4Event ()
 
 G4Event (G4int evID)
 
 ~G4Event ()
 
void * operator new (size_t)
 
void operator delete (void *anEvent)
 
G4int operator== (const G4Event &right) const
 
G4int operator!= (const G4Event &right) const
 
void Print () const
 
void Draw () const
 
void SetEventID (G4int i)
 
void SetHCofThisEvent (G4HCofThisEvent *value)
 
void SetDCofThisEvent (G4DCofThisEvent *value)
 
void SetTrajectoryContainer (G4TrajectoryContainer *value)
 
void SetEventAborted ()
 
void SetRandomNumberStatus (G4String &st)
 
void SetRandomNumberStatusForProcessing (G4String &st)
 
void KeepTheEvent (G4bool vl=true)
 
G4bool ToBeKept () const
 
void KeepForPostProcessing () const
 
void PostProcessingFinished () const
 
G4int GetNumberOfGrips () const
 
G4int GetEventID () const
 
void AddPrimaryVertex (G4PrimaryVertex *aPrimaryVertex)
 
G4int GetNumberOfPrimaryVertex () const
 
G4PrimaryVertex * GetPrimaryVertex (G4int i=0) const
 
G4HCofThisEvent * GetHCofThisEvent () const
 
G4DCofThisEvent * GetDCofThisEvent () const
 
G4TrajectoryContainer * GetTrajectoryContainer () const
 
G4bool IsAborted () const
 
void SetUserInformation (G4VUserEventInformation *anInfo)
 
G4VUserEventInformation * GetUserInformation () const
 
const G4String & GetRandomNumberStatus () const
 
const G4String & GetRandomNumberStatusForProcessing () const
 

Private Member Functions

 G4Event (const G4Event &)
 
G4Event & operator= (const G4Event &)
 

Private Attributes

G4int eventID
 
G4PrimaryVertex * thePrimaryVertex
 
G4int numberOfPrimaryVertex
 
G4HCofThisEvent * HC
 
G4DCofThisEvent * DC
 
G4TrajectoryContainer * trajectoryContainer
 
G4bool eventAborted
 
G4VUserEventInformation * userInfo
 
G4String * randomNumberStatus
 
G4bool validRandomNumberStatus
 
G4String * randomNumberStatusForProcessing
 
G4bool validRandomNumberStatusForProcessing
 
G4bool keepTheEvent
 
G4int grips
 

Detailed Description

Definition at line 52 of file G4Event.hh.

Constructor & Destructor Documentation

◆ G4Event() [1/3]

G4Event::G4Event ( )

Definition at line 42 of file G4Event.cc.

43 :eventID(0),
45  HC(nullptr),DC(nullptr),trajectoryContainer(nullptr),
46  eventAborted(false),userInfo(nullptr),
49  keepTheEvent(false),grips(0)
50 {
51 }
G4int grips
Definition: G4Event.hh:112
G4bool validRandomNumberStatusForProcessing
Definition: G4Event.hh:108
G4bool keepTheEvent
Definition: G4Event.hh:111
G4bool eventAborted
Definition: G4Event.hh:97
G4String * randomNumberStatus
Definition: G4Event.hh:103
G4int numberOfPrimaryVertex
Definition: G4Event.hh:84
G4VUserEventInformation * userInfo
Definition: G4Event.hh:100
G4PrimaryVertex * thePrimaryVertex
Definition: G4Event.hh:83
G4DCofThisEvent * DC
Definition: G4Event.hh:90
G4String * randomNumberStatusForProcessing
Definition: G4Event.hh:107
G4int eventID
Definition: G4Event.hh:80
G4bool validRandomNumberStatus
Definition: G4Event.hh:104
G4HCofThisEvent * HC
Definition: G4Event.hh:87
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:93

◆ G4Event() [2/3]

G4Event::G4Event ( G4int  evID)

Definition at line 53 of file G4Event.cc.

54 :eventID(evID),
56  HC(nullptr),DC(nullptr),trajectoryContainer(nullptr),
57  eventAborted(false),userInfo(nullptr),
60  keepTheEvent(false),grips(0)
61 {
62 }
G4int grips
Definition: G4Event.hh:112
G4bool validRandomNumberStatusForProcessing
Definition: G4Event.hh:108
G4bool keepTheEvent
Definition: G4Event.hh:111
G4bool eventAborted
Definition: G4Event.hh:97
G4String * randomNumberStatus
Definition: G4Event.hh:103
G4int numberOfPrimaryVertex
Definition: G4Event.hh:84
G4VUserEventInformation * userInfo
Definition: G4Event.hh:100
G4PrimaryVertex * thePrimaryVertex
Definition: G4Event.hh:83
G4DCofThisEvent * DC
Definition: G4Event.hh:90
G4String * randomNumberStatusForProcessing
Definition: G4Event.hh:107
G4int eventID
Definition: G4Event.hh:80
G4bool validRandomNumberStatus
Definition: G4Event.hh:104
G4HCofThisEvent * HC
Definition: G4Event.hh:87
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:93

◆ ~G4Event()

G4Event::~G4Event ( )

Definition at line 64 of file G4Event.cc.

65 {
66  G4PrimaryVertex* nextVertex = thePrimaryVertex;
67  while(nextVertex)
68  {
69  G4PrimaryVertex* thisVertex = nextVertex;
70  nextVertex = thisVertex->GetNext();
71  thisVertex->ClearNext();
72  delete thisVertex;
73  }
74  thePrimaryVertex = nullptr;
75  delete HC;
76  delete DC;
78  {
80  delete trajectoryContainer;
81  }
82  delete userInfo;
83  delete randomNumberStatus;
85 }
G4String * randomNumberStatus
Definition: G4Event.hh:103
G4VUserEventInformation * userInfo
Definition: G4Event.hh:100
G4PrimaryVertex * thePrimaryVertex
Definition: G4Event.hh:83
G4DCofThisEvent * DC
Definition: G4Event.hh:90
G4String * randomNumberStatusForProcessing
Definition: G4Event.hh:107
G4PrimaryVertex * GetNext() const
G4HCofThisEvent * HC
Definition: G4Event.hh:87
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:93
Here is the call graph for this function:

◆ G4Event() [3/3]

G4Event::G4Event ( const G4Event &  )
inlineprivate

Definition at line 75 of file G4Event.hh.

75 {;}

Member Function Documentation

◆ AddPrimaryVertex()

void G4Event::AddPrimaryVertex ( G4PrimaryVertex *  aPrimaryVertex)
inline

Definition at line 154 of file G4Event.hh.

155  {
156  if( thePrimaryVertex == nullptr )
157  { thePrimaryVertex = aPrimaryVertex; }
158  else
159  { thePrimaryVertex->SetNext( aPrimaryVertex ); }
161  }
G4int numberOfPrimaryVertex
Definition: G4Event.hh:84
G4PrimaryVertex * thePrimaryVertex
Definition: G4Event.hh:83
void SetNext(G4PrimaryVertex *nv)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Draw()

void G4Event::Draw ( ) const

Definition at line 102 of file G4Event.cc.

103 {
105  if(!pVVisManager) return;
106 
108  {
109  G4int n_traj = trajectoryContainer->entries();
110  for(G4int i=0;i<n_traj;i++)
111  { (*trajectoryContainer)[i]->DrawTrajectory(); }
112  }
113 
114  if(HC)
115  {
116  G4int n_HC = HC->GetCapacity();
117  for(G4int j=0;j<n_HC;j++)
118  {
119  G4VHitsCollection * VHC = HC->GetHC(j);
120  if(VHC) VHC->DrawAllHits();
121  }
122  }
123 
124  if(DC)
125  {
126  G4int n_DC = DC->GetCapacity();
127  for(G4int j=0;j<n_DC;j++)
128  {
129  G4VDigiCollection * VDC = DC->GetDC(j);
130  if(VDC) VDC->DrawAllDigi();
131  }
132  }
133 }
G4VDigiCollection * GetDC(G4int i) const
static G4VVisManager * GetConcreteInstance()
virtual void DrawAllHits()
int G4int
Definition: G4Types.hh:78
G4int GetCapacity() const
G4DCofThisEvent * DC
Definition: G4Event.hh:90
virtual void DrawAllDigi()
G4HCofThisEvent * HC
Definition: G4Event.hh:87
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:93
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDCofThisEvent()

G4DCofThisEvent* G4Event::GetDCofThisEvent ( ) const
inline

Definition at line 187 of file G4Event.hh.

188  { return DC; }
G4DCofThisEvent * DC
Definition: G4Event.hh:90
Here is the caller graph for this function:

◆ GetEventID()

G4int G4Event::GetEventID ( ) const
inline

Definition at line 151 of file G4Event.hh.

152  { return eventID; }
G4int eventID
Definition: G4Event.hh:80

◆ GetHCofThisEvent()

G4HCofThisEvent* G4Event::GetHCofThisEvent ( ) const
inline

Definition at line 185 of file G4Event.hh.

186  { return HC; }
G4HCofThisEvent * HC
Definition: G4Event.hh:87
Here is the caller graph for this function:

◆ GetNumberOfGrips()

G4int G4Event::GetNumberOfGrips ( ) const
inline

Definition at line 147 of file G4Event.hh.

148  { return grips; }
G4int grips
Definition: G4Event.hh:112
Here is the caller graph for this function:

◆ GetNumberOfPrimaryVertex()

G4int G4Event::GetNumberOfPrimaryVertex ( ) const
inline

Definition at line 164 of file G4Event.hh.

165  { return numberOfPrimaryVertex; }
G4int numberOfPrimaryVertex
Definition: G4Event.hh:84
Here is the caller graph for this function:

◆ GetPrimaryVertex()

G4PrimaryVertex* G4Event::GetPrimaryVertex ( G4int  i = 0) const
inline

Definition at line 167 of file G4Event.hh.

168  {
169  if( i == 0 )
170  { return thePrimaryVertex; }
171  else if( i > 0 && i < numberOfPrimaryVertex )
172  {
173  G4PrimaryVertex* primaryVertex = thePrimaryVertex;
174  for( G4int j=0; j<i; j++ )
175  {
176  if( !primaryVertex ) return nullptr;
177  primaryVertex = primaryVertex->GetNext();
178  }
179  return primaryVertex;
180  }
181  else
182  { return nullptr; }
183  }
int G4int
Definition: G4Types.hh:78
G4int numberOfPrimaryVertex
Definition: G4Event.hh:84
G4PrimaryVertex * thePrimaryVertex
Definition: G4Event.hh:83
G4PrimaryVertex * GetNext() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRandomNumberStatus()

const G4String& G4Event::GetRandomNumberStatus ( ) const
inline

Definition at line 201 of file G4Event.hh.

202  {
204  { G4Exception(
205  "G4Event::GetRandomNumberStatus","Event0701",JustWarning,
206  "Random number status is not available for this event."); }
207  return *randomNumberStatus;
208  }
G4String * randomNumberStatus
Definition: G4Event.hh:103
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4bool validRandomNumberStatus
Definition: G4Event.hh:104
Here is the call graph for this function:

◆ GetRandomNumberStatusForProcessing()

const G4String& G4Event::GetRandomNumberStatusForProcessing ( ) const
inline

Definition at line 209 of file G4Event.hh.

210  {
212  { G4Exception(
213  "G4Event::GetRandomNumberStatusForProcessing","Event0702",
214  JustWarning,
215  "Random number status is not available for this event."); }
217  }
G4bool validRandomNumberStatusForProcessing
Definition: G4Event.hh:108
G4String * randomNumberStatusForProcessing
Definition: G4Event.hh:107
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:

◆ GetTrajectoryContainer()

G4TrajectoryContainer* G4Event::GetTrajectoryContainer ( ) const
inline

Definition at line 189 of file G4Event.hh.

190  { return trajectoryContainer; }
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:93
Here is the caller graph for this function:

◆ GetUserInformation()

G4VUserEventInformation* G4Event::GetUserInformation ( ) const
inline

Definition at line 199 of file G4Event.hh.

199 { return userInfo; }
G4VUserEventInformation * userInfo
Definition: G4Event.hh:100
Here is the caller graph for this function:

◆ IsAborted()

G4bool G4Event::IsAborted ( ) const
inline

Definition at line 195 of file G4Event.hh.

195 { return eventAborted; }
G4bool eventAborted
Definition: G4Event.hh:97
Here is the caller graph for this function:

◆ KeepForPostProcessing()

void G4Event::KeepForPostProcessing ( ) const
inline

Definition at line 139 of file G4Event.hh.

140  { grips++; }
G4int grips
Definition: G4Event.hh:112
Here is the caller graph for this function:

◆ KeepTheEvent()

void G4Event::KeepTheEvent ( G4bool  vl = true)
inline

Definition at line 135 of file G4Event.hh.

136  { keepTheEvent = vl; }
G4bool keepTheEvent
Definition: G4Event.hh:111
Here is the caller graph for this function:

◆ operator delete()

void G4Event::operator delete ( void *  anEvent)
inline

Definition at line 228 of file G4Event.hh.

229 {
230  anEventAllocator->FreeSingle((G4Event*)anEvent);
231 }
G4EVENT_DLL G4ThreadLocal G4Allocator< G4Event > * anEventAllocator
Definition: G4Event.cc:40

◆ operator new()

void * G4Event::operator new ( size_t  )
inline

Definition at line 222 of file G4Event.hh.

223 {
225  return (void*)anEventAllocator->MallocSingle();
226 }
G4EVENT_DLL G4ThreadLocal G4Allocator< G4Event > * anEventAllocator
Definition: G4Event.cc:40

◆ operator!=()

G4int G4Event::operator!= ( const G4Event &  right) const

Definition at line 92 of file G4Event.cc.

93 {
94  return ( eventID != right.eventID );
95 }
G4int eventID
Definition: G4Event.hh:80

◆ operator=()

G4Event& G4Event::operator= ( const G4Event &  )
inlineprivate

Definition at line 76 of file G4Event.hh.

76 { return *this; }

◆ operator==()

G4int G4Event::operator== ( const G4Event &  right) const

Definition at line 87 of file G4Event.cc.

88 {
89  return ( eventID == right.eventID );
90 }
G4int eventID
Definition: G4Event.hh:80

◆ PostProcessingFinished()

void G4Event::PostProcessingFinished ( ) const
inline

Definition at line 141 of file G4Event.hh.

142  { grips--;
143  if(grips<0)
144  { G4Exception("G4Event::Release()","EVENT91001",FatalException,
145  "Number of grips becames negative. This cannot be correct."); }
146  }
G4int grips
Definition: G4Event.hh:112
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:

◆ Print()

void G4Event::Print ( void  ) const

Definition at line 97 of file G4Event.cc.

98 {
99  G4cout << "G4Event " << eventID << G4endl;
100 }
G4GLOB_DLL std::ostream G4cout
G4int eventID
Definition: G4Event.hh:80
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ SetDCofThisEvent()

void G4Event::SetDCofThisEvent ( G4DCofThisEvent *  value)
inline

Definition at line 119 of file G4Event.hh.

120  { DC = value; }
G4DCofThisEvent * DC
Definition: G4Event.hh:90
Here is the caller graph for this function:

◆ SetEventAborted()

void G4Event::SetEventAborted ( )
inline

Definition at line 123 of file G4Event.hh.

124  { eventAborted = true; }
G4bool eventAborted
Definition: G4Event.hh:97
Here is the caller graph for this function:

◆ SetEventID()

void G4Event::SetEventID ( G4int  i)
inline

Definition at line 115 of file G4Event.hh.

116  { eventID = i; }
G4int eventID
Definition: G4Event.hh:80
Here is the caller graph for this function:

◆ SetHCofThisEvent()

void G4Event::SetHCofThisEvent ( G4HCofThisEvent *  value)
inline

Definition at line 117 of file G4Event.hh.

118  { HC = value; }
G4HCofThisEvent * HC
Definition: G4Event.hh:87
Here is the caller graph for this function:

◆ SetRandomNumberStatus()

void G4Event::SetRandomNumberStatus ( G4String &  st)
inline

Definition at line 125 of file G4Event.hh.

126  {
127  randomNumberStatus = new G4String(st);
129  }
G4String * randomNumberStatus
Definition: G4Event.hh:103
G4bool validRandomNumberStatus
Definition: G4Event.hh:104
Here is the caller graph for this function:

◆ SetRandomNumberStatusForProcessing()

void G4Event::SetRandomNumberStatusForProcessing ( G4String &  st)
inline

Definition at line 130 of file G4Event.hh.

Here is the caller graph for this function:

◆ SetTrajectoryContainer()

void G4Event::SetTrajectoryContainer ( G4TrajectoryContainer *  value)
inline

Definition at line 121 of file G4Event.hh.

122  { trajectoryContainer = value; }
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:93
Here is the caller graph for this function:

◆ SetUserInformation()

void G4Event::SetUserInformation ( G4VUserEventInformation *  anInfo)
inline

Definition at line 198 of file G4Event.hh.

198 { userInfo = anInfo; }
G4VUserEventInformation * userInfo
Definition: G4Event.hh:100
Here is the caller graph for this function:

◆ ToBeKept()

G4bool G4Event::ToBeKept ( ) const
inline

Definition at line 137 of file G4Event.hh.

138  { return keepTheEvent; }
G4bool keepTheEvent
Definition: G4Event.hh:111
Here is the caller graph for this function:

Member Data Documentation

◆ DC

G4DCofThisEvent* G4Event::DC
private

Definition at line 90 of file G4Event.hh.

◆ eventAborted

G4bool G4Event::eventAborted
private

Definition at line 97 of file G4Event.hh.

◆ eventID

G4int G4Event::eventID
private

Definition at line 80 of file G4Event.hh.

◆ grips

G4int G4Event::grips
mutableprivate

Definition at line 112 of file G4Event.hh.

◆ HC

G4HCofThisEvent* G4Event::HC
private

Definition at line 87 of file G4Event.hh.

◆ keepTheEvent

G4bool G4Event::keepTheEvent
private

Definition at line 111 of file G4Event.hh.

◆ numberOfPrimaryVertex

G4int G4Event::numberOfPrimaryVertex
private

Definition at line 84 of file G4Event.hh.

◆ randomNumberStatus

G4String* G4Event::randomNumberStatus
private

Definition at line 103 of file G4Event.hh.

◆ randomNumberStatusForProcessing

G4String* G4Event::randomNumberStatusForProcessing
private

Definition at line 107 of file G4Event.hh.

◆ thePrimaryVertex

G4PrimaryVertex* G4Event::thePrimaryVertex
private

Definition at line 83 of file G4Event.hh.

◆ trajectoryContainer

G4TrajectoryContainer* G4Event::trajectoryContainer
private

Definition at line 93 of file G4Event.hh.

◆ userInfo

G4VUserEventInformation* G4Event::userInfo
private

Definition at line 100 of file G4Event.hh.

◆ validRandomNumberStatus

G4bool G4Event::validRandomNumberStatus
private

Definition at line 104 of file G4Event.hh.

◆ validRandomNumberStatusForProcessing

G4bool G4Event::validRandomNumberStatusForProcessing
private

Definition at line 108 of file G4Event.hh.


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