Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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
 
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(0),numberOfPrimaryVertex(0),
45  HC(0),DC(0),trajectoryContainer(0),eventAborted(false),userInfo(0),
46  randomNumberStatus(0),validRandomNumberStatus(false),
47  randomNumberStatusForProcessing(0),validRandomNumberStatusForProcessing(false),
48  keepTheEvent(false)
49 {
50 }
G4Event::G4Event ( G4int  evID)

Definition at line 52 of file G4Event.cc.

53 :eventID(evID),
54  thePrimaryVertex(0),numberOfPrimaryVertex(0),
55  HC(0),DC(0),trajectoryContainer(0),eventAborted(false),userInfo(0),
56  randomNumberStatus(0),validRandomNumberStatus(false),
57  randomNumberStatusForProcessing(0),validRandomNumberStatusForProcessing(false),
58  keepTheEvent(false)
59 {
60 }
G4Event::~G4Event ( )

Definition at line 62 of file G4Event.cc.

References G4TrajectoryContainer::clearAndDestroy().

63 {
64  if(thePrimaryVertex) delete thePrimaryVertex;
65  if(HC) delete HC;
66  if(DC) delete DC;
67  if(trajectoryContainer)
68  {
69  trajectoryContainer->clearAndDestroy();
70  delete trajectoryContainer;
71  }
72  if(userInfo) delete userInfo;
73  if(validRandomNumberStatus) delete randomNumberStatus;
74  if(validRandomNumberStatusForProcessing) delete randomNumberStatusForProcessing;
75 }

Member Function Documentation

void G4Event::AddPrimaryVertex ( G4PrimaryVertex aPrimaryVertex)
inline

Definition at line 143 of file G4Event.hh.

References G4PrimaryVertex::SetNext().

Referenced by export_G4Event(), G4RTPrimaryGeneratorAction::GeneratePrimaries(), G4BlinePrimaryGeneratorAction::GeneratePrimaries(), G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), DMXParticleSource::GeneratePrimaryVertex(), G4ParticleGun::GeneratePrimaryVertex(), G4HEPEvtInterface::GeneratePrimaryVertex(), G4SingleParticleSource::GeneratePrimaryVertex(), and G4RayShooter::Shoot().

144  {
145  if( thePrimaryVertex == 0 )
146  { thePrimaryVertex = aPrimaryVertex; }
147  else
148  { thePrimaryVertex->SetNext( aPrimaryVertex ); }
149  numberOfPrimaryVertex++;
150  }
void SetNext(G4PrimaryVertex *nv)
void G4Event::Draw ( ) const

Definition at line 92 of file G4Event.cc.

References G4VDigiCollection::DrawAllDigi(), G4VHitsCollection::DrawAllHits(), G4TrajectoryContainer::entries(), G4DCofThisEvent::GetCapacity(), G4HCofThisEvent::GetCapacity(), G4VVisManager::GetConcreteInstance(), G4DCofThisEvent::GetDC(), and G4HCofThisEvent::GetHC().

Referenced by export_G4Event().

93 {
95  if(!pVVisManager) return;
96 
97  if(trajectoryContainer)
98  {
99  G4int n_traj = trajectoryContainer->entries();
100  for(G4int i=0;i<n_traj;i++)
101  { (*trajectoryContainer)[i]->DrawTrajectory(); }
102  }
103 
104  if(HC)
105  {
106  G4int n_HC = HC->GetCapacity();
107  for(G4int j=0;j<n_HC;j++)
108  {
109  G4VHitsCollection * VHC = HC->GetHC(j);
110  if(VHC) VHC->DrawAllHits();
111  }
112  }
113 
114  if(DC)
115  {
116  G4int n_DC = DC->GetCapacity();
117  for(G4int j=0;j<n_DC;j++)
118  {
119  G4VDigiCollection * VDC = DC->GetDC(j);
120  if(VDC) VDC->DrawAllDigi();
121  }
122  }
123 }
static G4VVisManager * GetConcreteInstance()
G4VDigiCollection * GetDC(G4int i) const
virtual void DrawAllHits()
int G4int
Definition: G4Types.hh:78
G4int GetCapacity() const
virtual void DrawAllDigi()
G4DCofThisEvent* G4Event::GetDCofThisEvent ( ) const
inline

Definition at line 176 of file G4Event.hh.

Referenced by G4DigiManager::GetDigiCollection(), G4DigiManager::SetDigiCollection(), and G4PersistencyManager::Store().

177  { return DC; }
G4int G4Event::GetEventID ( ) const
inline

Definition at line 140 of file G4Event.hh.

Referenced by ExGflashEventAction::BeginOfEventAction(), eRositaEventAction::BeginOfEventAction(), ElectronEventAction::BeginOfEventAction(), exGPSEventAction::BeginOfEventAction(), F04EventAction::BeginOfEventAction(), HadrontherapyEventAction::BeginOfEventAction(), FCALTBEventAction::BeginOfEventAction(), WLSEventAction::BeginOfEventAction(), F01EventAction::BeginOfEventAction(), F02EventAction::BeginOfEventAction(), F03EventAction::BeginOfEventAction(), EventAction::BeginOfEventAction(), PurgMagEventAction::BeginOfEventAction(), Em10EventAction::BeginOfEventAction(), IORTEventAction::BeginOfEventAction(), DicomEventAction::BeginOfEventAction(), GammaRayTelEventAction::BeginOfEventAction(), RMC01EventAction::BeginOfEventAction(), DMXEventAction::BeginOfEventAction(), UltraEventAction::BeginOfEventAction(), RMC01AdjointEventAction::BeginOfEventAction(), XrayFluoEventAction::BeginOfEventAction(), RMC01AnalysisManager::EndOfEvent(), ExN04EventAction::EndOfEventAction(), RE05EventAction::EndOfEventAction(), B5EventAction::EndOfEventAction(), RE01EventAction::EndOfEventAction(), F04EventAction::EndOfEventAction(), ExN02EventAction::EndOfEventAction(), ExP01EventAction::EndOfEventAction(), WLSEventAction::EndOfEventAction(), F03EventAction::EndOfEventAction(), F01EventAction::EndOfEventAction(), F02EventAction::EndOfEventAction(), RE04EventAction::EndOfEventAction(), Em10EventAction::EndOfEventAction(), RE02EventAction::EndOfEventAction(), GammaRayTelEventAction::EndOfEventAction(), export_G4Event(), G4Pevent::G4Pevent(), G4WorkerRunManager::GenerateEvent(), G4RunManager::GenerateEvent(), G4RTPrimaryGeneratorAction::GeneratePrimaries(), FCALPrimaryGeneratorAction::GeneratePrimaries(), G04PrimaryGeneratorAction::GeneratePrimaries(), G01PrimaryGeneratorAction::GeneratePrimaries(), UltraPrimaryGeneratorAction::GeneratePrimaries(), XrayFluoPrimaryGeneratorAction::GeneratePrimaries(), G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), F04EventAction::GetEventNo(), WLSEventAction::GetEventNo(), Em10EventAction::GetEventno(), G4WorkerRunManager::ProcessOneEvent(), G4RTRun::RecordEvent(), G4PersistencyManager::Retrieve(), G4RunManager::rndmSaveThisEvent(), CCalEndOfEventAction::StartOfEventAction(), G4PersistencyManager::Store(), and EventAction::WritePixels().

141  { return eventID; }
G4HCofThisEvent* G4Event::GetHCofThisEvent ( ) const
inline
G4int G4Event::GetNumberOfPrimaryVertex ( ) const
inline

Definition at line 153 of file G4Event.hh.

Referenced by RE01EventAction::EndOfEventAction(), exGPSEventAction::EndOfEventAction(), and export_G4Event().

154  { return numberOfPrimaryVertex; }
G4PrimaryVertex* G4Event::GetPrimaryVertex ( G4int  i = 0) const
inline

Definition at line 156 of file G4Event.hh.

References G4PrimaryVertex::GetNext().

Referenced by ExGflashEventAction::EndOfEventAction(), RE01EventAction::EndOfEventAction(), exGPSEventAction::EndOfEventAction(), export_G4Event(), G4BlinePrimaryGeneratorAction::GeneratePrimaries(), G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), and G4PrimaryTransformer::GimmePrimaries().

157  {
158  if( i == 0 )
159  { return thePrimaryVertex; }
160  else if( i > 0 && i < numberOfPrimaryVertex )
161  {
162  G4PrimaryVertex* primaryVertex = thePrimaryVertex;
163  for( G4int j=0; j<i; j++ )
164  {
165  if( primaryVertex == 0 ) return 0;
166  primaryVertex = primaryVertex->GetNext();
167  }
168  return primaryVertex;
169  }
170  else
171  { return 0; }
172  }
int G4int
Definition: G4Types.hh:78
G4PrimaryVertex * GetNext() const
const G4String& G4Event::GetRandomNumberStatus ( ) const
inline

Definition at line 190 of file G4Event.hh.

References G4Exception(), and JustWarning.

191  {
192  if(!validRandomNumberStatus)
193  { G4Exception(
194  "G4Event::GetRandomNumberStatus","Event0701",JustWarning,
195  "Random number status is not available for this event."); }
196  return *randomNumberStatus;
197  }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4String& G4Event::GetRandomNumberStatusForProcessing ( ) const
inline

Definition at line 198 of file G4Event.hh.

References G4Exception(), and JustWarning.

199  {
200  if(!validRandomNumberStatusForProcessing)
201  { G4Exception(
202  "G4Event::GetRandomNumberStatusForProcessing","Event0702",
203  JustWarning,
204  "Random number status is not available for this event."); }
205  return *randomNumberStatusForProcessing;
206  }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4TrajectoryContainer* G4Event::GetTrajectoryContainer ( ) const
inline
G4VUserEventInformation* G4Event::GetUserInformation ( ) const
inline
G4bool G4Event::IsAborted ( ) const
inline

Definition at line 184 of file G4Event.hh.

Referenced by export_G4Event().

184 { return eventAborted; }
void G4Event::KeepTheEvent ( G4bool  vl = true)
inline

Definition at line 134 of file G4Event.hh.

Referenced by G4EventManager::KeepTheCurrentEvent().

135  { keepTheEvent = vl; }
void G4Event::operator delete ( void anEvent)
inline

Definition at line 217 of file G4Event.hh.

References anEventAllocator.

218 {
219  anEventAllocator->FreeSingle((G4Event*)anEvent);
220 }
G4EVENT_DLL G4ThreadLocal G4Allocator< G4Event > * anEventAllocator
Definition: G4Event.cc:40
void * G4Event::operator new ( size_t  )
inline

Definition at line 211 of file G4Event.hh.

References anEventAllocator.

212 {
214  return (void*)anEventAllocator->MallocSingle();
215 }
G4EVENT_DLL G4ThreadLocal G4Allocator< G4Event > * anEventAllocator
Definition: G4Event.cc:40
G4int G4Event::operator!= ( const G4Event right) const

Definition at line 82 of file G4Event.cc.

83 {
84  return ( eventID != right.eventID );
85 }
G4int G4Event::operator== ( const G4Event right) const

Definition at line 77 of file G4Event.cc.

78 {
79  return ( eventID == right.eventID );
80 }
void G4Event::Print ( void  ) const

Definition at line 87 of file G4Event.cc.

References G4cout, and G4endl.

Referenced by export_G4Event().

88 {
89  G4cout << "G4Event " << eventID << G4endl;
90 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4Event::SetDCofThisEvent ( G4DCofThisEvent value)
inline

Definition at line 118 of file G4Event.hh.

Referenced by G4DigiManager::SetDigiCollection().

119  { DC = value; }
const XML_Char int const XML_Char * value
void G4Event::SetEventAborted ( )
inline

Definition at line 122 of file G4Event.hh.

Referenced by G4RunManager::AbortEvent(), G4RunManager::AbortRun(), and export_G4Event().

123  { eventAborted = true; }
void G4Event::SetEventID ( G4int  i)
inline
void G4Event::SetHCofThisEvent ( G4HCofThisEvent value)
inline

Definition at line 116 of file G4Event.hh.

117  { HC = value; }
const XML_Char int const XML_Char * value
void G4Event::SetRandomNumberStatus ( G4String st)
inline

Definition at line 124 of file G4Event.hh.

Referenced by G4WorkerRunManager::GenerateEvent(), G4RunManager::GenerateEvent(), and G4EventManager::ProcessOneEvent().

125  {
126  randomNumberStatus = new G4String(st);
127  validRandomNumberStatus = true;
128  }
void G4Event::SetRandomNumberStatusForProcessing ( G4String st)
inline

Definition at line 129 of file G4Event.hh.

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

Definition at line 120 of file G4Event.hh.

121  { trajectoryContainer = value; }
const XML_Char int const XML_Char * value
void G4Event::SetUserInformation ( G4VUserEventInformation anInfo)
inline

Definition at line 187 of file G4Event.hh.

Referenced by CexmcEventAction::EndOfEventAction(), export_G4Event(), and G4EventManager::SetUserInformation().

187 { userInfo = anInfo; }
G4bool G4Event::ToBeKept ( ) const
inline

Definition at line 136 of file G4Event.hh.

Referenced by G4RunManager::RunTermination(), and G4RunManager::StackPreviousEvent().

137  { return keepTheEvent; }

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