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

#include <G4Event.hh>

Public Types

using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Event >
 

Public Member Functions

 G4Event ()
 
 G4Event (G4int evID)
 
 ~G4Event ()
 
 G4Event (const G4Event &)=delete
 
G4Eventoperator= (const G4Event &)=delete
 
void * operator new (std::size_t)
 
void operator delete (void *anEvent)
 
G4bool operator== (const G4Event &right) const
 
G4bool 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 54 of file G4Event.hh.

Member Typedef Documentation

◆ ProfilerConfig

Constructor & Destructor Documentation

◆ G4Event() [1/3]

G4Event::G4Event ( )

Definition at line 43 of file G4Event.cc.

44{
45}

◆ G4Event() [2/3]

G4Event::G4Event ( G4int  evID)

Definition at line 47 of file G4Event.cc.

48 : eventID(evID)
49{
50}

◆ ~G4Event()

G4Event::~G4Event ( )

Definition at line 52 of file G4Event.cc.

53{
54 G4PrimaryVertex* nextVertex = thePrimaryVertex;
55 while(nextVertex != nullptr)
56 {
57 G4PrimaryVertex* thisVertex = nextVertex;
58 nextVertex = thisVertex->GetNext();
59 thisVertex->ClearNext();
60 delete thisVertex;
61 }
62 thePrimaryVertex = nullptr;
63 delete HC;
64 delete DC;
65 if(trajectoryContainer != nullptr)
66 {
67 trajectoryContainer->clearAndDestroy();
68 delete trajectoryContainer;
69 }
70 delete userInfo;
71 delete randomNumberStatus;
72 delete randomNumberStatusForProcessing;
73}
G4PrimaryVertex * GetNext() const

◆ G4Event() [3/3]

G4Event::G4Event ( const G4Event )
delete

Member Function Documentation

◆ AddPrimaryVertex()

void G4Event::AddPrimaryVertex ( G4PrimaryVertex aPrimaryVertex)
inline

Definition at line 121 of file G4Event.hh.

122 {
123 // This method sets a new primary vertex. This method must be invoked
124 // exclusively by G4VPrimaryGenerator concrete class.
125
126 if( thePrimaryVertex == nullptr )
127 { thePrimaryVertex = aPrimaryVertex; }
128 else
129 { thePrimaryVertex->SetNext( aPrimaryVertex ); }
130 ++numberOfPrimaryVertex;
131 }
void SetNext(G4PrimaryVertex *nv)

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), G4RTPrimaryGeneratorAction::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 == nullptr) 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 != nullptr)
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 != nullptr) VHC->DrawAllHits();
109 }
110 }
111
112 if(DC != nullptr)
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:85
G4VDigiCollection * GetDC(G4int i) const
size_t GetCapacity() const
G4VHitsCollection * GetHC(G4int i)
std::size_t entries() const
virtual void DrawAllDigi()
virtual void DrawAllHits()
static G4VVisManager * GetConcreteInstance()

◆ GetDCofThisEvent()

G4DCofThisEvent * G4Event::GetDCofThisEvent ( ) const
inline

Definition at line 158 of file G4Event.hh.

159 { return DC; }

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

◆ GetEventID()

◆ GetHCofThisEvent()

G4HCofThisEvent * G4Event::GetHCofThisEvent ( ) const
inline

Definition at line 156 of file G4Event.hh.

157 { return HC; }

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

◆ GetNumberOfGrips()

G4int G4Event::GetNumberOfGrips ( ) const
inline

Definition at line 115 of file G4Event.hh.

116 { return grips; }

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

◆ GetNumberOfPrimaryVertex()

G4int G4Event::GetNumberOfPrimaryVertex ( ) const
inline

Definition at line 133 of file G4Event.hh.

134 { return numberOfPrimaryVertex; }

◆ GetPrimaryVertex()

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

Definition at line 137 of file G4Event.hh.

138 {
139 if( i == 0 )
140 { return thePrimaryVertex; }
141 else if( i > 0 && i < numberOfPrimaryVertex )
142 {
143 G4PrimaryVertex* primaryVertex = thePrimaryVertex;
144 for( G4int j=0; j<i; ++j )
145 {
146 if( !primaryVertex ) return nullptr;
147 primaryVertex = primaryVertex->GetNext();
148 }
149 return primaryVertex;
150 }
151 else
152 { return nullptr; }
153 }

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

◆ GetRandomNumberStatus()

const G4String & G4Event::GetRandomNumberStatus ( ) const
inline

Definition at line 177 of file G4Event.hh.

178 {
179 if(!validRandomNumberStatus)
180 { G4Exception(
181 "G4Event::GetRandomNumberStatus","Event0701",JustWarning,
182 "Random number status is not available for this event."); }
183 return *randomNumberStatus;
184 }
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35

◆ GetRandomNumberStatusForProcessing()

const G4String & G4Event::GetRandomNumberStatusForProcessing ( ) const
inline

Definition at line 185 of file G4Event.hh.

186 {
187 if(!validRandomNumberStatusForProcessing)
188 { G4Exception(
189 "G4Event::GetRandomNumberStatusForProcessing","Event0702",
191 "Random number status is not available for this event."); }
192 return *randomNumberStatusForProcessing;
193 }

◆ GetTrajectoryContainer()

G4TrajectoryContainer * G4Event::GetTrajectoryContainer ( ) const
inline

Definition at line 160 of file G4Event.hh.

161 { return trajectoryContainer; }

Referenced by G4TheRayTracer::GenerateColour(), and G4RTRun::RecordEvent().

◆ GetUserInformation()

G4VUserEventInformation * G4Event::GetUserInformation ( ) const
inline

Definition at line 173 of file G4Event.hh.

174 { return userInfo; }

Referenced by G4EventManager::GetUserInformation().

◆ IsAborted()

G4bool G4Event::IsAborted ( ) const
inline

Definition at line 167 of file G4Event.hh.

167{ return eventAborted; }

◆ KeepForPostProcessing()

void G4Event::KeepForPostProcessing ( ) const
inline

Definition at line 104 of file G4Event.hh.

105 { ++grips; }

◆ KeepTheEvent()

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

Definition at line 100 of file G4Event.hh.

101 { keepTheEvent = vl; }

Referenced by G4EventManager::KeepTheCurrentEvent().

◆ operator delete()

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

Definition at line 241 of file G4Event.hh.

242{
243 anEventAllocator()->FreeSingle((G4Event*)anEvent);
244}
G4EVENT_DLL G4Allocator< G4Event > *& anEventAllocator()
Definition: G4Event.cc:37

◆ operator new()

void * G4Event::operator new ( std::size_t  )
inline

Definition at line 235 of file G4Event.hh.

236{
238 return (void*)anEventAllocator()->MallocSingle();
239}

◆ operator!=()

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

Definition at line 80 of file G4Event.cc.

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

◆ operator=()

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

◆ operator==()

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

Definition at line 75 of file G4Event.cc.

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

◆ PostProcessingFinished()

void G4Event::PostProcessingFinished ( ) const
inline

Definition at line 106 of file G4Event.hh.

107 {
108 --grips;
109 if (grips<0)
110 {
111 G4Exception("G4Event::Release()", "EVENT91001", FatalException,
112 "Number of grips is negative. This cannot be correct.");
113 }
114 }
@ FatalException

◆ 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:57
G4GLOB_DLL std::ostream G4cout

◆ SetDCofThisEvent()

void G4Event::SetDCofThisEvent ( G4DCofThisEvent value)
inline

Definition at line 84 of file G4Event.hh.

85 { DC = value; }

Referenced by G4DigiManager::SetDigiCollection().

◆ SetEventAborted()

void G4Event::SetEventAborted ( )
inline

Definition at line 88 of file G4Event.hh.

89 { eventAborted = true; }

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

◆ SetEventID()

◆ SetHCofThisEvent()

void G4Event::SetHCofThisEvent ( G4HCofThisEvent value)
inline

Definition at line 82 of file G4Event.hh.

83 { HC = value; }

◆ SetRandomNumberStatus()

void G4Event::SetRandomNumberStatus ( G4String st)
inline

Definition at line 90 of file G4Event.hh.

91 {
92 randomNumberStatus = new G4String(st);
93 validRandomNumberStatus = true;
94 }

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

◆ SetRandomNumberStatusForProcessing()

void G4Event::SetRandomNumberStatusForProcessing ( G4String st)
inline

Definition at line 95 of file G4Event.hh.

96 {
97 randomNumberStatusForProcessing = new G4String(st);
98 validRandomNumberStatusForProcessing = true;
99 }

◆ SetTrajectoryContainer()

void G4Event::SetTrajectoryContainer ( G4TrajectoryContainer value)
inline

Definition at line 86 of file G4Event.hh.

87 { trajectoryContainer = value; }

◆ SetUserInformation()

void G4Event::SetUserInformation ( G4VUserEventInformation anInfo)
inline

Definition at line 171 of file G4Event.hh.

172 { userInfo = anInfo; }

Referenced by G4EventManager::SetUserInformation().

◆ ToBeKept()

G4bool G4Event::ToBeKept ( ) const
inline

Definition at line 102 of file G4Event.hh.

103 { return keepTheEvent; }

Referenced by G4RunManager::CleanUpPreviousEvents(), G4RunManager::CleanUpUnnecessaryEvents(), and G4RunManager::StackPreviousEvent().


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