Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Event Class Reference

#include <G4Event.hh>

Public Member Functions

 G4Event ()
 
 G4Event (G4int evID)
 
 ~G4Event ()
 
voidoperator 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
 
G4PrimaryVertexGetPrimaryVertex (G4int i=0) const
 
G4HCofThisEventGetHCofThisEvent () const
 
G4DCofThisEventGetDCofThisEvent () const
 
G4TrajectoryContainerGetTrajectoryContainer () const
 
G4bool IsAborted () const
 
void SetUserInformation (G4VUserEventInformation *anInfo)
 
G4VUserEventInformationGetUserInformation () const
 
const G4StringGetRandomNumberStatus () const
 
const G4StringGetRandomNumberStatusForProcessing () const
 

Detailed Description

Definition at line 52 of file G4Event.hh.

Constructor & Destructor Documentation

G4Event::G4Event ( )

Definition at line 42 of file G4Event.cc.

43 :eventID(0),
44  thePrimaryVertex(nullptr),numberOfPrimaryVertex(0),
45  HC(nullptr),DC(nullptr),trajectoryContainer(nullptr),
46  eventAborted(false),userInfo(nullptr),
47  randomNumberStatus(nullptr),validRandomNumberStatus(false),
48  randomNumberStatusForProcessing(nullptr),validRandomNumberStatusForProcessing(false),
49  keepTheEvent(false),grips(0)
50 {
51 }
G4Event::G4Event ( G4int  evID)

Definition at line 53 of file G4Event.cc.

54 :eventID(evID),
55  thePrimaryVertex(nullptr),numberOfPrimaryVertex(0),
56  HC(nullptr),DC(nullptr),trajectoryContainer(nullptr),
57  eventAborted(false),userInfo(nullptr),
58  randomNumberStatus(nullptr),validRandomNumberStatus(false),
59  randomNumberStatusForProcessing(nullptr),validRandomNumberStatusForProcessing(false),
60  keepTheEvent(false),grips(0)
61 {
62 }
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;
77  if(trajectoryContainer)
78  {
79  trajectoryContainer->clearAndDestroy();
80  delete trajectoryContainer;
81  }
82  delete userInfo;
83  delete randomNumberStatus;
84  delete randomNumberStatusForProcessing;
85 }
G4PrimaryVertex * GetNext() const

Here is the call graph for this function:

Member Function Documentation

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 ); }
160  numberOfPrimaryVertex++;
161  }
void SetNext(G4PrimaryVertex *nv)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4Event::Draw ( ) const

Definition at line 102 of file G4Event.cc.

103 {
105  if(!pVVisManager) return;
106 
107  if(trajectoryContainer)
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 }
G4VHitsCollection * GetHC(G4int i)
static G4VVisManager * GetConcreteInstance()
G4VDigiCollection * GetDC(G4int i) const
virtual void DrawAllHits()
int G4int
Definition: G4Types.hh:78
G4int GetCapacity() const
virtual void DrawAllDigi()

Here is the call graph for this function:

Here is the caller graph for this function:

G4DCofThisEvent* G4Event::GetDCofThisEvent ( ) const
inline

Definition at line 187 of file G4Event.hh.

188  { return DC; }

Here is the caller graph for this function:

G4int G4Event::GetEventID ( ) const
inline

Definition at line 151 of file G4Event.hh.

152  { return eventID; }
G4HCofThisEvent* G4Event::GetHCofThisEvent ( ) const
inline

Definition at line 185 of file G4Event.hh.

186  { return HC; }

Here is the caller graph for this function:

G4int G4Event::GetNumberOfGrips ( ) const
inline

Definition at line 147 of file G4Event.hh.

148  { return grips; }

Here is the caller graph for this function:

G4int G4Event::GetNumberOfPrimaryVertex ( ) const
inline

Definition at line 164 of file G4Event.hh.

165  { return numberOfPrimaryVertex; }

Here is the caller graph for this function:

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
G4PrimaryVertex * GetNext() const

Here is the call graph for this function:

Here is the caller graph for this function:

const G4String& G4Event::GetRandomNumberStatus ( ) const
inline

Definition at line 201 of file G4Event.hh.

202  {
203  if(!validRandomNumberStatus)
204  { G4Exception(
205  "G4Event::GetRandomNumberStatus","Event0701",JustWarning,
206  "Random number status is not available for this event."); }
207  return *randomNumberStatus;
208  }
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:

const G4String& G4Event::GetRandomNumberStatusForProcessing ( ) const
inline

Definition at line 209 of file G4Event.hh.

210  {
211  if(!validRandomNumberStatusForProcessing)
212  { G4Exception(
213  "G4Event::GetRandomNumberStatusForProcessing","Event0702",
214  JustWarning,
215  "Random number status is not available for this event."); }
216  return *randomNumberStatusForProcessing;
217  }
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:

G4TrajectoryContainer* G4Event::GetTrajectoryContainer ( ) const
inline

Definition at line 189 of file G4Event.hh.

190  { return trajectoryContainer; }

Here is the caller graph for this function:

G4VUserEventInformation* G4Event::GetUserInformation ( ) const
inline

Definition at line 199 of file G4Event.hh.

199 { return userInfo; }

Here is the caller graph for this function:

G4bool G4Event::IsAborted ( ) const
inline

Definition at line 195 of file G4Event.hh.

195 { return eventAborted; }

Here is the caller graph for this function:

void G4Event::KeepForPostProcessing ( ) const
inline

Definition at line 139 of file G4Event.hh.

140  { grips++; }
void G4Event::KeepTheEvent ( G4bool  vl = true)
inline

Definition at line 135 of file G4Event.hh.

136  { keepTheEvent = vl; }

Here is the caller graph for this function:

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
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
G4int G4Event::operator!= ( const G4Event right) const

Definition at line 92 of file G4Event.cc.

93 {
94  return ( eventID != right.eventID );
95 }
G4int G4Event::operator== ( const G4Event right) const

Definition at line 87 of file G4Event.cc.

88 {
89  return ( eventID == right.eventID );
90 }
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  }
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:

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
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4Event::SetDCofThisEvent ( G4DCofThisEvent value)
inline

Definition at line 119 of file G4Event.hh.

120  { DC = value; }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Event::SetEventAborted ( )
inline

Definition at line 123 of file G4Event.hh.

124  { eventAborted = true; }

Here is the caller graph for this function:

void G4Event::SetEventID ( G4int  i)
inline

Definition at line 115 of file G4Event.hh.

116  { eventID = i; }

Here is the caller graph for this function:

void G4Event::SetHCofThisEvent ( G4HCofThisEvent value)
inline

Definition at line 117 of file G4Event.hh.

118  { HC = value; }
const XML_Char int const XML_Char * value
Definition: expat.h:331
void G4Event::SetRandomNumberStatus ( G4String st)
inline

Definition at line 125 of file G4Event.hh.

126  {
127  randomNumberStatus = new G4String(st);
128  validRandomNumberStatus = true;
129  }

Here is the caller graph for this function:

void G4Event::SetRandomNumberStatusForProcessing ( G4String st)
inline

Definition at line 130 of file G4Event.hh.

131  {
132  randomNumberStatusForProcessing = new G4String(st);
133  validRandomNumberStatusForProcessing = true;
134  }
void G4Event::SetTrajectoryContainer ( G4TrajectoryContainer value)
inline

Definition at line 121 of file G4Event.hh.

122  { trajectoryContainer = value; }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Event::SetUserInformation ( G4VUserEventInformation anInfo)
inline

Definition at line 198 of file G4Event.hh.

198 { userInfo = anInfo; }

Here is the caller graph for this function:

G4bool G4Event::ToBeKept ( ) const
inline

Definition at line 137 of file G4Event.hh.

138  { return keepTheEvent; }

Here is the caller graph for this function:


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