Geant4-11
Public Types | Public Member Functions | Private Attributes
G4Event Class Reference

#include <G4Event.hh>

Public Types

using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Event >
 

Public Member Functions

void AddPrimaryVertex (G4PrimaryVertex *aPrimaryVertex)
 
void Draw () const
 
 G4Event ()
 
 G4Event (const G4Event &)=delete
 
 G4Event (G4int evID)
 
G4DCofThisEventGetDCofThisEvent () const
 
G4int GetEventID () const
 
G4HCofThisEventGetHCofThisEvent () const
 
G4int GetNumberOfGrips () const
 
G4int GetNumberOfPrimaryVertex () const
 
G4PrimaryVertexGetPrimaryVertex (G4int i=0) const
 
const G4StringGetRandomNumberStatus () const
 
const G4StringGetRandomNumberStatusForProcessing () const
 
G4TrajectoryContainerGetTrajectoryContainer () const
 
G4VUserEventInformationGetUserInformation () const
 
G4bool IsAborted () const
 
void KeepForPostProcessing () const
 
void KeepTheEvent (G4bool vl=true)
 
void operator delete (void *anEvent)
 
void * operator new (std::size_t)
 
G4bool operator!= (const G4Event &right) const
 
G4Eventoperator= (const G4Event &)=delete
 
G4bool operator== (const G4Event &right) const
 
void PostProcessingFinished () const
 
void Print () const
 
void SetDCofThisEvent (G4DCofThisEvent *value)
 
void SetEventAborted ()
 
void SetEventID (G4int i)
 
void SetHCofThisEvent (G4HCofThisEvent *value)
 
void SetRandomNumberStatus (G4String &st)
 
void SetRandomNumberStatusForProcessing (G4String &st)
 
void SetTrajectoryContainer (G4TrajectoryContainer *value)
 
void SetUserInformation (G4VUserEventInformation *anInfo)
 
G4bool ToBeKept () const
 
 ~G4Event ()
 

Private Attributes

G4DCofThisEventDC = nullptr
 
G4bool eventAborted = false
 
G4int eventID = 0
 
G4int grips = 0
 
G4HCofThisEventHC = nullptr
 
G4bool keepTheEvent = false
 
G4int numberOfPrimaryVertex = 0
 
G4StringrandomNumberStatus = nullptr
 
G4StringrandomNumberStatusForProcessing = nullptr
 
G4PrimaryVertexthePrimaryVertex = nullptr
 
G4TrajectoryContainertrajectoryContainer = nullptr
 
G4VUserEventInformationuserInfo = nullptr
 
G4bool validRandomNumberStatus = false
 
G4bool validRandomNumberStatusForProcessing = false
 

Detailed Description

Definition at line 54 of file G4Event.hh.

Member Typedef Documentation

◆ ProfilerConfig

Definition at line 57 of file G4Event.hh.

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}
G4int eventID
Definition: G4Event.hh:198

◆ ~G4Event()

G4Event::~G4Event ( )

Definition at line 52 of file G4Event.cc.

53{
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 {
69 }
70 delete userInfo;
71 delete randomNumberStatus;
73}
G4VUserEventInformation * userInfo
Definition: G4Event.hh:218
G4HCofThisEvent * HC
Definition: G4Event.hh:205
G4TrajectoryContainer * trajectoryContainer
Definition: G4Event.hh:211
G4String * randomNumberStatusForProcessing
Definition: G4Event.hh:225
G4DCofThisEvent * DC
Definition: G4Event.hh:208
G4String * randomNumberStatus
Definition: G4Event.hh:221
G4PrimaryVertex * thePrimaryVertex
Definition: G4Event.hh:201
G4PrimaryVertex * GetNext() const

References G4TrajectoryContainer::clearAndDestroy(), G4PrimaryVertex::ClearNext(), DC, G4PrimaryVertex::GetNext(), HC, randomNumberStatus, randomNumberStatusForProcessing, thePrimaryVertex, trajectoryContainer, and userInfo.

◆ 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 ); }
131 }
G4int numberOfPrimaryVertex
Definition: G4Event.hh:202
void SetNext(G4PrimaryVertex *nv)

References numberOfPrimaryVertex, G4PrimaryVertex::SetNext(), and thePrimaryVertex.

Referenced by export_G4Event(), 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
96 {
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()

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

Referenced by export_G4Event().

◆ GetDCofThisEvent()

G4DCofThisEvent * G4Event::GetDCofThisEvent ( ) const
inline

Definition at line 158 of file G4Event.hh.

159 { return DC; }

References DC.

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

◆ GetEventID()

G4int G4Event::GetEventID ( ) const
inline

◆ GetHCofThisEvent()

G4HCofThisEvent * G4Event::GetHCofThisEvent ( ) const
inline

◆ GetNumberOfGrips()

G4int G4Event::GetNumberOfGrips ( ) const
inline

Definition at line 115 of file G4Event.hh.

116 { return grips; }
G4int grips
Definition: G4Event.hh:230

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

References numberOfPrimaryVertex.

Referenced by G4EventManager::DoProcessing(), and export_G4Event().

◆ 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 }

References G4PrimaryVertex::GetNext(), numberOfPrimaryVertex, and thePrimaryVertex.

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

◆ GetRandomNumberStatus()

const G4String & G4Event::GetRandomNumberStatus ( ) const
inline

Definition at line 177 of file G4Event.hh.

178 {
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
G4bool validRandomNumberStatus
Definition: G4Event.hh:222

References G4Exception(), JustWarning, randomNumberStatus, and validRandomNumberStatus.

◆ GetRandomNumberStatusForProcessing()

const G4String & G4Event::GetRandomNumberStatusForProcessing ( ) const
inline

Definition at line 185 of file G4Event.hh.

186 {
188 { G4Exception(
189 "G4Event::GetRandomNumberStatusForProcessing","Event0702",
191 "Random number status is not available for this event."); }
193 }
G4bool validRandomNumberStatusForProcessing
Definition: G4Event.hh:226

References G4Exception(), JustWarning, randomNumberStatusForProcessing, and validRandomNumberStatusForProcessing.

◆ GetTrajectoryContainer()

G4TrajectoryContainer * G4Event::GetTrajectoryContainer ( ) const
inline

Definition at line 160 of file G4Event.hh.

161 { return trajectoryContainer; }

References trajectoryContainer.

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

◆ GetUserInformation()

G4VUserEventInformation * G4Event::GetUserInformation ( ) const
inline

Definition at line 173 of file G4Event.hh.

174 { return userInfo; }

References userInfo.

Referenced by export_G4Event(), and G4EventManager::GetUserInformation().

◆ IsAborted()

G4bool G4Event::IsAborted ( ) const
inline

Definition at line 167 of file G4Event.hh.

167{ return eventAborted; }
G4bool eventAborted
Definition: G4Event.hh:215

References eventAborted.

Referenced by export_G4Event().

◆ KeepForPostProcessing()

void G4Event::KeepForPostProcessing ( ) const
inline

Definition at line 104 of file G4Event.hh.

105 { ++grips; }

References grips.

Referenced by G4VisManager::EndOfEvent().

◆ KeepTheEvent()

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

Definition at line 100 of file G4Event.hh.

101 { keepTheEvent = vl; }
G4bool keepTheEvent
Definition: G4Event.hh:229

References keepTheEvent.

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

References anEventAllocator().

◆ 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}

References anEventAllocator().

◆ operator!=()

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

Definition at line 80 of file G4Event.cc.

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

References eventID.

◆ 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}

References eventID.

◆ 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

References FatalException, G4Exception(), and grips.

◆ 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

References eventID, G4cout, and G4endl.

Referenced by export_G4Event().

◆ SetDCofThisEvent()

void G4Event::SetDCofThisEvent ( G4DCofThisEvent value)
inline

Definition at line 84 of file G4Event.hh.

85 { DC = value; }

References DC.

Referenced by G4DigiManager::SetDigiCollection().

◆ SetEventAborted()

void G4Event::SetEventAborted ( )
inline

Definition at line 88 of file G4Event.hh.

89 { eventAborted = true; }

References eventAborted.

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

◆ SetEventID()

void G4Event::SetEventID ( G4int  i)
inline

◆ SetHCofThisEvent()

void G4Event::SetHCofThisEvent ( G4HCofThisEvent value)
inline

Definition at line 82 of file G4Event.hh.

83 { HC = value; }

References HC.

Referenced by G4EventManager::DoProcessing().

◆ SetRandomNumberStatus()

void G4Event::SetRandomNumberStatus ( G4String st)
inline

◆ SetRandomNumberStatusForProcessing()

void G4Event::SetRandomNumberStatusForProcessing ( G4String st)
inline

◆ SetTrajectoryContainer()

void G4Event::SetTrajectoryContainer ( G4TrajectoryContainer value)
inline

Definition at line 86 of file G4Event.hh.

87 { trajectoryContainer = value; }

References trajectoryContainer.

Referenced by G4EventManager::DoProcessing().

◆ SetUserInformation()

void G4Event::SetUserInformation ( G4VUserEventInformation anInfo)
inline

Definition at line 171 of file G4Event.hh.

172 { userInfo = anInfo; }

References userInfo.

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

◆ ToBeKept()

G4bool G4Event::ToBeKept ( ) const
inline

Field Documentation

◆ DC

G4DCofThisEvent* G4Event::DC = nullptr
private

Definition at line 208 of file G4Event.hh.

Referenced by Draw(), GetDCofThisEvent(), SetDCofThisEvent(), and ~G4Event().

◆ eventAborted

G4bool G4Event::eventAborted = false
private

Definition at line 215 of file G4Event.hh.

Referenced by IsAborted(), and SetEventAborted().

◆ eventID

G4int G4Event::eventID = 0
private

Definition at line 198 of file G4Event.hh.

Referenced by GetEventID(), operator!=(), operator==(), Print(), and SetEventID().

◆ grips

G4int G4Event::grips = 0
mutableprivate

Definition at line 230 of file G4Event.hh.

Referenced by GetNumberOfGrips(), KeepForPostProcessing(), and PostProcessingFinished().

◆ HC

G4HCofThisEvent* G4Event::HC = nullptr
private

Definition at line 205 of file G4Event.hh.

Referenced by Draw(), GetHCofThisEvent(), SetHCofThisEvent(), and ~G4Event().

◆ keepTheEvent

G4bool G4Event::keepTheEvent = false
private

Definition at line 229 of file G4Event.hh.

Referenced by KeepTheEvent(), and ToBeKept().

◆ numberOfPrimaryVertex

G4int G4Event::numberOfPrimaryVertex = 0
private

Definition at line 202 of file G4Event.hh.

Referenced by AddPrimaryVertex(), GetNumberOfPrimaryVertex(), and GetPrimaryVertex().

◆ randomNumberStatus

G4String* G4Event::randomNumberStatus = nullptr
private

Definition at line 221 of file G4Event.hh.

Referenced by GetRandomNumberStatus(), SetRandomNumberStatus(), and ~G4Event().

◆ randomNumberStatusForProcessing

G4String* G4Event::randomNumberStatusForProcessing = nullptr
private

◆ thePrimaryVertex

G4PrimaryVertex* G4Event::thePrimaryVertex = nullptr
private

Definition at line 201 of file G4Event.hh.

Referenced by AddPrimaryVertex(), GetPrimaryVertex(), and ~G4Event().

◆ trajectoryContainer

G4TrajectoryContainer* G4Event::trajectoryContainer = nullptr
private

Definition at line 211 of file G4Event.hh.

Referenced by Draw(), GetTrajectoryContainer(), SetTrajectoryContainer(), and ~G4Event().

◆ userInfo

G4VUserEventInformation* G4Event::userInfo = nullptr
private

Definition at line 218 of file G4Event.hh.

Referenced by GetUserInformation(), SetUserInformation(), and ~G4Event().

◆ validRandomNumberStatus

G4bool G4Event::validRandomNumberStatus = false
private

Definition at line 222 of file G4Event.hh.

Referenced by GetRandomNumberStatus(), and SetRandomNumberStatus().

◆ validRandomNumberStatusForProcessing

G4bool G4Event::validRandomNumberStatusForProcessing = false
private

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