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

#include <G4EventManager.hh>

Public Member Functions

 G4EventManager ()
 
 ~G4EventManager ()
 
void ProcessOneEvent (G4Event *anEvent)
 
void ProcessOneEvent (G4TrackVector *trackVector, G4Event *anEvent=0)
 
const G4EventGetConstCurrentEvent ()
 
G4EventGetNonconstCurrentEvent ()
 
void AbortCurrentEvent ()
 
void SetUserAction (G4UserEventAction *userAction)
 
void SetUserAction (G4UserStackingAction *userAction)
 
void SetUserAction (G4UserTrackingAction *userAction)
 
void SetUserAction (G4UserSteppingAction *userAction)
 
G4UserEventActionGetUserEventAction ()
 
G4UserStackingActionGetUserStackingAction ()
 
G4UserTrackingActionGetUserTrackingAction ()
 
G4UserSteppingActionGetUserSteppingAction ()
 
void SetNumberOfAdditionalWaitingStacks (G4int iAdd)
 
void KeepTheCurrentEvent ()
 
G4StackManagerGetStackManager () const
 
G4TrackingManagerGetTrackingManager () const
 
G4int GetVerboseLevel ()
 
void SetVerboseLevel (G4int value)
 
void SetUserInformation (G4VUserEventInformation *anInfo)
 
G4VUserEventInformationGetUserInformation ()
 
G4PrimaryTransformerGetPrimaryTransformer () const
 
void SetPrimaryTransformer (G4PrimaryTransformer *tf)
 
void StoreRandomNumberStatusToG4Event (G4int vl)
 

Static Public Member Functions

static G4EventManagerGetEventManager ()
 

Detailed Description

Definition at line 59 of file G4EventManager.hh.

Constructor & Destructor Documentation

◆ G4EventManager()

G4EventManager::G4EventManager ( )

Definition at line 49 of file G4EventManager.cc.

50:currentEvent(0),trajectoryContainer(0),
51 verboseLevel(0),tracking(false),abortRequested(false),
52 storetRandomNumberStatusToG4Event(false)
53{
54 if(fpEventManager)
55 {
56 G4Exception("G4EventManager::G4EventManager","Event0001",FatalException,
57 "G4EventManager::G4EventManager() has already been made.");
58 }
59 else
60 {
61 trackManager = new G4TrackingManager;
62 transformer = new G4PrimaryTransformer;
63 trackContainer = new G4StackManager;
64 theMessenger = new G4EvManMessenger(this);
66 fpEventManager = this;
67 userEventAction = 0;
68 userStackingAction = 0;
69 userTrackingAction = 0;
70 userSteppingAction = 0;
71 }
72}
@ FatalException
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4EventManager()

G4EventManager::~G4EventManager ( )

Definition at line 79 of file G4EventManager.cc.

80{
81 delete trackContainer;
82 delete transformer;
83 delete trackManager;
84 delete theMessenger;
85 if(userEventAction) delete userEventAction;
86 fpEventManager = 0;
87}

Member Function Documentation

◆ AbortCurrentEvent()

void G4EventManager::AbortCurrentEvent ( )

Definition at line 389 of file G4EventManager.cc.

390{
391 abortRequested = true;
392 trackContainer->clear();
393 if(tracking) trackManager->EventAborted();
394}

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

◆ GetConstCurrentEvent()

const G4Event * G4EventManager::GetConstCurrentEvent ( )
inline

Definition at line 122 of file G4EventManager.hh.

123 { return currentEvent; }

◆ GetEventManager()

◆ GetNonconstCurrentEvent()

G4Event * G4EventManager::GetNonconstCurrentEvent ( )
inline

Definition at line 124 of file G4EventManager.hh.

125 { return currentEvent; }

◆ GetPrimaryTransformer()

G4PrimaryTransformer * G4EventManager::GetPrimaryTransformer ( ) const
inline

Definition at line 181 of file G4EventManager.hh.

182 { return transformer; }

Referenced by G4RunManagerKernel::GetPrimaryTransformer().

◆ GetStackManager()

G4StackManager * G4EventManager::GetStackManager ( ) const
inline

Definition at line 159 of file G4EventManager.hh.

160 { return trackContainer; }

Referenced by G4RunManagerKernel::GetStackManager().

◆ GetTrackingManager()

G4TrackingManager * G4EventManager::GetTrackingManager ( ) const
inline

◆ GetUserEventAction()

G4UserEventAction * G4EventManager::GetUserEventAction ( )
inline

Definition at line 142 of file G4EventManager.hh.

143 { return userEventAction; }

Referenced by G4TheRayTracer::StoreUserActions().

◆ GetUserInformation()

G4VUserEventInformation * G4EventManager::GetUserInformation ( )

Definition at line 376 of file G4EventManager.cc.

377{
379 G4ApplicationState currentState = stateManager->GetCurrentState();
380 if(currentState!=G4State_EventProc || currentEvent==0)
381 { return 0; }
382
383 return currentEvent->GetUserInformation();
384}
G4ApplicationState
@ G4State_EventProc
G4VUserEventInformation * GetUserInformation() const
Definition: G4Event.hh:187
G4ApplicationState GetCurrentState() const
static G4StateManager * GetStateManager()

◆ GetUserStackingAction()

G4UserStackingAction * G4EventManager::GetUserStackingAction ( )
inline

Definition at line 144 of file G4EventManager.hh.

145 { return userStackingAction; }

Referenced by G4TheRayTracer::StoreUserActions().

◆ GetUserSteppingAction()

G4UserSteppingAction * G4EventManager::GetUserSteppingAction ( )
inline

Definition at line 148 of file G4EventManager.hh.

149 { return userSteppingAction; }

Referenced by G4TheRayTracer::StoreUserActions().

◆ GetUserTrackingAction()

G4UserTrackingAction * G4EventManager::GetUserTrackingAction ( )
inline

◆ GetVerboseLevel()

G4int G4EventManager::GetVerboseLevel ( )
inline

Definition at line 165 of file G4EventManager.hh.

166 { return verboseLevel; }

Referenced by G4EvManMessenger::GetCurrentValue().

◆ KeepTheCurrentEvent()

void G4EventManager::KeepTheCurrentEvent ( )

Definition at line 386 of file G4EventManager.cc.

387{ if(currentEvent) currentEvent->KeepTheEvent(); }
void KeepTheEvent(G4bool vl=true)
Definition: G4Event.hh:133

Referenced by G4EvManMessenger::SetNewValue().

◆ ProcessOneEvent() [1/2]

void G4EventManager::ProcessOneEvent ( G4Event anEvent)

Definition at line 333 of file G4EventManager.cc.

334{
335 trackIDCounter = 0;
336 DoProcessing(anEvent);
337}

Referenced by G4TheRayTracer::CreateBitMap(), and G4RunManager::ProcessOneEvent().

◆ ProcessOneEvent() [2/2]

void G4EventManager::ProcessOneEvent ( G4TrackVector trackVector,
G4Event anEvent = 0 
)

Definition at line 339 of file G4EventManager.cc.

340{
341 static G4String randStat;
342 trackIDCounter = 0;
343 G4bool tempEvent = false;
344 if(!anEvent)
345 {
346 anEvent = new G4Event();
347 tempEvent = true;
348 }
349 if(storetRandomNumberStatusToG4Event==1 || storetRandomNumberStatusToG4Event==3)
350 {
351 std::ostringstream oss;
353 anEvent->SetRandomNumberStatus(randStat=oss.str());
354 }
355 StackTracks(trackVector,false);
356 DoProcessing(anEvent);
357 if(tempEvent)
358 { delete anEvent; }
359}
bool G4bool
Definition: G4Types.hh:67
static std::ostream & saveFullState(std::ostream &os)
Definition: Random.cc:185
void SetRandomNumberStatus(G4String &st)
Definition: G4Event.hh:123

◆ SetNumberOfAdditionalWaitingStacks()

void G4EventManager::SetNumberOfAdditionalWaitingStacks ( G4int  iAdd)
inline

Definition at line 153 of file G4EventManager.hh.

154 { trackContainer->SetNumberOfAdditionalWaitingStacks(iAdd); }
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)

Referenced by G4RunManager::SetNumberOfAdditionalWaitingStacks().

◆ SetPrimaryTransformer()

void G4EventManager::SetPrimaryTransformer ( G4PrimaryTransformer tf)
inline

Definition at line 183 of file G4EventManager.hh.

184 { transformer = tf; }

Referenced by G4RunManagerKernel::SetPrimaryTransformer().

◆ SetUserAction() [1/4]

void G4EventManager::SetUserAction ( G4UserEventAction userAction)

Definition at line 309 of file G4EventManager.cc.

310{
311 userEventAction = userAction;
312 if(userEventAction) userEventAction->SetEventManager(this);
313}
void SetEventManager(G4EventManager *value)

Referenced by G4TheRayTracer::RestoreUserActions(), G4RunManager::SetUserAction(), G4ErrorPropagatorManager::SetUserAction(), G4ErrorRunManagerHelper::SetUserAction(), and G4TheRayTracer::StoreUserActions().

◆ SetUserAction() [2/4]

void G4EventManager::SetUserAction ( G4UserStackingAction userAction)

Definition at line 315 of file G4EventManager.cc.

316{
317 userStackingAction = userAction;
318 trackContainer->SetUserStackingAction(userAction);
319}
void SetUserStackingAction(G4UserStackingAction *value)

◆ SetUserAction() [3/4]

void G4EventManager::SetUserAction ( G4UserSteppingAction userAction)

Definition at line 327 of file G4EventManager.cc.

328{
329 userSteppingAction = userAction;
330 trackManager->SetUserAction(userAction);
331}
void SetUserAction(G4UserTrackingAction *apAction)

◆ SetUserAction() [4/4]

void G4EventManager::SetUserAction ( G4UserTrackingAction userAction)

Definition at line 321 of file G4EventManager.cc.

322{
323 userTrackingAction = userAction;
324 trackManager->SetUserAction(userAction);
325}

◆ SetUserInformation()

void G4EventManager::SetUserInformation ( G4VUserEventInformation anInfo)

Definition at line 361 of file G4EventManager.cc.

362{
364 G4ApplicationState currentState = stateManager->GetCurrentState();
365 if(currentState!=G4State_EventProc || currentEvent==0)
366 {
367 G4Exception("G4EventManager::SetUserInformation",
368 "Event0003", JustWarning,
369 "G4VUserEventInformation cannot be set because of ansense of G4Event.");
370 return;
371 }
372
373 currentEvent->SetUserInformation(anInfo);
374}
@ JustWarning
void SetUserInformation(G4VUserEventInformation *anInfo)
Definition: G4Event.hh:186

◆ SetVerboseLevel()

void G4EventManager::SetVerboseLevel ( G4int  value)
inline

Definition at line 167 of file G4EventManager.hh.

168 {
169 verboseLevel = value;
170 trackContainer->SetVerboseLevel( value );
171 transformer->SetVerboseLevel( value );
172 }
void SetVerboseLevel(G4int vl)
void SetVerboseLevel(G4int const value)

Referenced by G4EvManMessenger::SetNewValue().

◆ StoreRandomNumberStatusToG4Event()

void G4EventManager::StoreRandomNumberStatusToG4Event ( G4int  vl)
inline

Definition at line 185 of file G4EventManager.hh.

186 { storetRandomNumberStatusToG4Event = vl; }

Referenced by G4RunManager::StoreRandomNumberStatusToG4Event().


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