Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Event Class Reference

#include <G4Event.hh>

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
 
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 51 of file G4Event.hh.

Constructor & Destructor Documentation

◆ G4Event() [1/2]

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{;}

◆ G4Event() [2/2]

G4Event::G4Event ( G4int  evID)

Definition at line 51 of file G4Event.cc.

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

◆ ~G4Event()

G4Event::~G4Event ( )

Definition at line 60 of file G4Event.cc.

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

Member Function Documentation

◆ AddPrimaryVertex()

void G4Event::AddPrimaryVertex ( G4PrimaryVertex aPrimaryVertex)
inline

Definition at line 142 of file G4Event.hh.

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

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

◆ Draw()

void G4Event::Draw ( ) const

Definition at line 90 of file G4Event.cc.

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

◆ GetDCofThisEvent()

G4DCofThisEvent * G4Event::GetDCofThisEvent ( ) const
inline

Definition at line 175 of file G4Event.hh.

176 { return DC; }

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

◆ GetEventID()

G4int G4Event::GetEventID ( ) const
inline

◆ GetHCofThisEvent()

G4HCofThisEvent * G4Event::GetHCofThisEvent ( ) const
inline

Definition at line 173 of file G4Event.hh.

174 { return HC; }

Referenced by G4DigiManager::GetHitsCollection(), G4PersistencyManager::Store(), and G4RunManager::UpdateScoring().

◆ GetNumberOfPrimaryVertex()

G4int G4Event::GetNumberOfPrimaryVertex ( ) const
inline

Definition at line 152 of file G4Event.hh.

153 { return numberOfPrimaryVertex; }

◆ GetPrimaryVertex()

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

Definition at line 155 of file G4Event.hh.

156 {
157 if( i == 0 )
158 { return thePrimaryVertex; }
159 else if( i > 0 && i < numberOfPrimaryVertex )
160 {
161 G4PrimaryVertex* primaryVertex = thePrimaryVertex;
162 for( G4int j=0; j<i; j++ )
163 {
164 if( primaryVertex == 0 ) return 0;
165 primaryVertex = primaryVertex->GetNext();
166 }
167 return primaryVertex;
168 }
169 else
170 { return 0; }
171 }
G4PrimaryVertex * GetNext() const

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), and G4PrimaryTransformer::GimmePrimaries().

◆ GetRandomNumberStatus()

const G4String & G4Event::GetRandomNumberStatus ( ) const
inline

Definition at line 189 of file G4Event.hh.

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

◆ GetRandomNumberStatusForProcessing()

const G4String & G4Event::GetRandomNumberStatusForProcessing ( ) const
inline

Definition at line 197 of file G4Event.hh.

198 {
199 if(!validRandomNumberStatusForProcessing)
200 { G4Exception(
201 "G4Event::GetRandomNumberStatusForProcessing","Event0702",
203 "Random number status is not available for this event."); }
204 return *randomNumberStatusForProcessing;
205 }

◆ GetTrajectoryContainer()

G4TrajectoryContainer * G4Event::GetTrajectoryContainer ( ) const
inline

Definition at line 177 of file G4Event.hh.

178 { return trajectoryContainer; }

Referenced by G4TheRayTracer::GenerateColour().

◆ GetUserInformation()

G4VUserEventInformation * G4Event::GetUserInformation ( ) const
inline

Definition at line 187 of file G4Event.hh.

187{ return userInfo; }

Referenced by G4EventManager::GetUserInformation().

◆ IsAborted()

G4bool G4Event::IsAborted ( ) const
inline

Definition at line 183 of file G4Event.hh.

183{ return eventAborted; }

◆ KeepTheEvent()

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

Definition at line 133 of file G4Event.hh.

134 { keepTheEvent = vl; }

Referenced by G4EventManager::KeepTheCurrentEvent().

◆ operator delete()

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

Definition at line 221 of file G4Event.hh.

222{
223 anEventAllocator.FreeSingle((G4Event*)anEvent);
224}
G4DLLIMPORT G4Allocator< G4Event > anEventAllocator
Definition: G4Event.cc:40

◆ operator new()

void * G4Event::operator new ( size_t  )
inline

Definition at line 214 of file G4Event.hh.

215{
216 void* anEvent;
217 anEvent = (void*)anEventAllocator.MallocSingle();
218 return anEvent;
219}

◆ operator!=()

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

Definition at line 80 of file G4Event.cc.

81{
82 return ( eventID != right.eventID );
83}

◆ operator==()

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

Definition at line 75 of file G4Event.cc.

76{
77 return ( eventID == right.eventID );
78}

◆ Print()

void G4Event::Print ( ) const

Definition at line 85 of file G4Event.cc.

86{
87 G4cout << "G4Event " << eventID << G4endl;
88}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

◆ SetDCofThisEvent()

void G4Event::SetDCofThisEvent ( G4DCofThisEvent value)
inline

Definition at line 117 of file G4Event.hh.

118 { DC = value; }

Referenced by G4DigiManager::SetDigiCollection().

◆ SetEventAborted()

void G4Event::SetEventAborted ( )
inline

Definition at line 121 of file G4Event.hh.

122 { eventAborted = true; }

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

◆ SetEventID()

void G4Event::SetEventID ( G4int  i)
inline

Definition at line 113 of file G4Event.hh.

114 { eventID = i; }

◆ SetHCofThisEvent()

void G4Event::SetHCofThisEvent ( G4HCofThisEvent value)
inline

Definition at line 115 of file G4Event.hh.

116 { HC = value; }

◆ SetRandomNumberStatus()

void G4Event::SetRandomNumberStatus ( G4String st)
inline

Definition at line 123 of file G4Event.hh.

124 {
125 randomNumberStatus = new G4String(st);
126 validRandomNumberStatus = true;
127 }

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

◆ SetRandomNumberStatusForProcessing()

void G4Event::SetRandomNumberStatusForProcessing ( G4String st)
inline

Definition at line 128 of file G4Event.hh.

129 {
130 randomNumberStatusForProcessing = new G4String(st);
131 validRandomNumberStatusForProcessing = true;
132 }

◆ SetTrajectoryContainer()

void G4Event::SetTrajectoryContainer ( G4TrajectoryContainer value)
inline

Definition at line 119 of file G4Event.hh.

120 { trajectoryContainer = value; }

◆ SetUserInformation()

void G4Event::SetUserInformation ( G4VUserEventInformation anInfo)
inline

Definition at line 186 of file G4Event.hh.

186{ userInfo = anInfo; }

Referenced by G4EventManager::SetUserInformation().

◆ ToBeKept()

G4bool G4Event::ToBeKept ( ) const
inline

Definition at line 135 of file G4Event.hh.

136 { return keepTheEvent; }

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


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