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

#include <G4EventManager.hh>

Public Types

using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Event >
 

Public Member Functions

 G4EventManager ()
 
 ~G4EventManager ()
 
 G4EventManager (const G4EventManager &right)=delete
 
G4EventManageroperator= (const G4EventManager &right)=delete
 
void ProcessOneEvent (G4Event *anEvent)
 
void ProcessOneEvent (G4TrackVector *trackVector, G4Event *anEvent=nullptr)
 
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 56 of file G4EventManager.hh.

Member Typedef Documentation

◆ ProfilerConfig

Constructor & Destructor Documentation

◆ G4EventManager() [1/2]

G4EventManager::G4EventManager ( )

Definition at line 53 of file G4EventManager.cc.

54{
55 if(fpEventManager != nullptr)
56 {
57 G4Exception("G4EventManager::G4EventManager", "Event0001", FatalException,
58 "G4EventManager::G4EventManager() has already been made.");
59 }
60 else
61 {
62 trackManager = new G4TrackingManager;
63 transformer = new G4PrimaryTransformer;
64 trackContainer = new G4StackManager;
65 theMessenger = new G4EvManMessenger(this);
67 stateManager = G4StateManager::GetStateManager();
68 fpEventManager = this;
69 }
70}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:48
static G4StateManager * GetStateManager()

◆ ~G4EventManager()

G4EventManager::~G4EventManager ( )

Definition at line 72 of file G4EventManager.cc.

73{
74 delete trackContainer;
75 delete transformer;
76 delete trackManager;
77 delete theMessenger;
78 delete userEventAction;
79 fpEventManager = nullptr;
80}

◆ G4EventManager() [2/2]

G4EventManager::G4EventManager ( const G4EventManager right)
delete

Member Function Documentation

◆ AbortCurrentEvent()

void G4EventManager::AbortCurrentEvent ( )

Definition at line 393 of file G4EventManager.cc.

394{
395 abortRequested = true;
396 trackContainer->clear();
397 if(tracking) trackManager->EventAborted();
398}

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

◆ GetConstCurrentEvent()

const G4Event * G4EventManager::GetConstCurrentEvent ( )
inline

Definition at line 91 of file G4EventManager.hh.

92 { return currentEvent; }

Referenced by G4VisManager::Draw().

◆ GetEventManager()

◆ GetNonconstCurrentEvent()

G4Event * G4EventManager::GetNonconstCurrentEvent ( )
inline

Definition at line 93 of file G4EventManager.hh.

94 { return currentEvent; }

◆ GetPrimaryTransformer()

G4PrimaryTransformer * G4EventManager::GetPrimaryTransformer ( ) const
inline

Definition at line 149 of file G4EventManager.hh.

150 { return transformer; }

Referenced by G4RunManagerKernel::GetPrimaryTransformer().

◆ GetStackManager()

G4StackManager * G4EventManager::GetStackManager ( ) const
inline

Definition at line 128 of file G4EventManager.hh.

129 { return trackContainer; }

Referenced by G4RunManagerKernel::GetStackManager().

◆ GetTrackingManager()

G4TrackingManager * G4EventManager::GetTrackingManager ( ) const
inline

◆ GetUserEventAction()

G4UserEventAction * G4EventManager::GetUserEventAction ( )
inline

Definition at line 109 of file G4EventManager.hh.

110 { return userEventAction; }

Referenced by G4TheRayTracer::StoreUserActions().

◆ GetUserInformation()

G4VUserEventInformation * G4EventManager::GetUserInformation ( )

Definition at line 377 of file G4EventManager.cc.

378{
379 G4ApplicationState currentState = stateManager->GetCurrentState();
380 if(currentState != G4State_EventProc || currentEvent == 0)
381 {
382 return nullptr;
383 }
384
385 return currentEvent->GetUserInformation();
386}
G4ApplicationState
@ G4State_EventProc
G4VUserEventInformation * GetUserInformation() const
Definition: G4Event.hh:173
const G4ApplicationState & GetCurrentState() const

◆ GetUserStackingAction()

G4UserStackingAction * G4EventManager::GetUserStackingAction ( )
inline

Definition at line 111 of file G4EventManager.hh.

112 { return userStackingAction; }

Referenced by G4TheRayTracer::StoreUserActions().

◆ GetUserSteppingAction()

G4UserSteppingAction * G4EventManager::GetUserSteppingAction ( )
inline

Definition at line 115 of file G4EventManager.hh.

116 { return userSteppingAction; }

Referenced by G4TheRayTracer::StoreUserActions().

◆ GetUserTrackingAction()

G4UserTrackingAction * G4EventManager::GetUserTrackingAction ( )
inline

◆ GetVerboseLevel()

G4int G4EventManager::GetVerboseLevel ( )
inline

Definition at line 133 of file G4EventManager.hh.

134 { return verboseLevel; }

Referenced by G4EvManMessenger::GetCurrentValue().

◆ KeepTheCurrentEvent()

void G4EventManager::KeepTheCurrentEvent ( )

Definition at line 388 of file G4EventManager.cc.

389{
390 if(currentEvent != nullptr) { currentEvent->KeepTheEvent(); }
391}
void KeepTheEvent(G4bool vl=true)
Definition: G4Event.hh:100

Referenced by G4EvManMessenger::SetNewValue().

◆ operator=()

G4EventManager & G4EventManager::operator= ( const G4EventManager right)
delete

◆ ProcessOneEvent() [1/2]

void G4EventManager::ProcessOneEvent ( G4Event anEvent)

Definition at line 332 of file G4EventManager.cc.

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

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

◆ ProcessOneEvent() [2/2]

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

Definition at line 338 of file G4EventManager.cc.

340{
341 static G4ThreadLocal G4String* randStat = nullptr;
342 if (randStat == nullptr) randStat = new G4String;
343 trackIDCounter = 0;
344 G4bool tempEvent = false;
345 if(anEvent == nullptr)
346 {
347 anEvent = new G4Event();
348 tempEvent = true;
349 }
350 if (storetRandomNumberStatusToG4Event==1
351 || storetRandomNumberStatusToG4Event==3)
352 {
353 std::ostringstream oss;
355 anEvent->SetRandomNumberStatus(*randStat=oss.str());
356 }
357 StackTracks(trackVector,false);
358 DoProcessing(anEvent);
359 if(tempEvent) { delete anEvent; }
360}
bool G4bool
Definition: G4Types.hh:86
static std::ostream & saveFullState(std::ostream &os)
Definition: Random.cc:288
void SetRandomNumberStatus(G4String &st)
Definition: G4Event.hh:90
#define G4ThreadLocal
Definition: tls.hh:77

◆ SetNumberOfAdditionalWaitingStacks()

void G4EventManager::SetNumberOfAdditionalWaitingStacks ( G4int  iAdd)
inline

Definition at line 121 of file G4EventManager.hh.

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

Referenced by G4RunManager::SetNumberOfAdditionalWaitingStacks().

◆ SetPrimaryTransformer()

void G4EventManager::SetPrimaryTransformer ( G4PrimaryTransformer tf)
inline

Definition at line 151 of file G4EventManager.hh.

152 { transformer = tf; }

Referenced by G4RunManagerKernel::SetPrimaryTransformer().

◆ SetUserAction() [1/4]

void G4EventManager::SetUserAction ( G4UserEventAction userAction)

Definition at line 305 of file G4EventManager.cc.

306{
307 userEventAction = userAction;
308 if(userEventAction != nullptr)
309 {
310 userEventAction->SetEventManager(this);
311 }
312}
virtual 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 314 of file G4EventManager.cc.

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

◆ SetUserAction() [3/4]

void G4EventManager::SetUserAction ( G4UserSteppingAction userAction)

Definition at line 326 of file G4EventManager.cc.

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

◆ SetUserAction() [4/4]

void G4EventManager::SetUserAction ( G4UserTrackingAction userAction)

Definition at line 320 of file G4EventManager.cc.

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

◆ SetUserInformation()

void G4EventManager::SetUserInformation ( G4VUserEventInformation anInfo)

Definition at line 362 of file G4EventManager.cc.

363{
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 absence "\
370 "of G4Event.");
371 return;
372 }
373
374 currentEvent->SetUserInformation(anInfo);
375}
@ JustWarning
void SetUserInformation(G4VUserEventInformation *anInfo)
Definition: G4Event.hh:171

◆ SetVerboseLevel()

void G4EventManager::SetVerboseLevel ( G4int  value)
inline

Definition at line 135 of file G4EventManager.hh.

136 {
137 verboseLevel = value;
138 trackContainer->SetVerboseLevel( value );
139 transformer->SetVerboseLevel( value );
140 }
void SetVerboseLevel(G4int vl)
void SetVerboseLevel(G4int const value)

Referenced by G4EvManMessenger::SetNewValue().

◆ StoreRandomNumberStatusToG4Event()

void G4EventManager::StoreRandomNumberStatusToG4Event ( G4int  vl)
inline

Definition at line 153 of file G4EventManager.hh.

154 { storetRandomNumberStatusToG4Event = vl; }

Referenced by G4RunManager::StoreRandomNumberStatusToG4Event().


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