Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
G4EventManager Class Reference

#include <G4EventManager.hh>

Public Member Functions

 G4EventManager ()
 
 ~G4EventManager ()
 
void ProcessOneEvent (G4Event *anEvent)
 
void ProcessOneEvent (G4TrackVector *trackVector, G4Event *anEvent=0)
 
const G4Event * GetConstCurrentEvent ()
 
G4Event * GetNonconstCurrentEvent ()
 
void AbortCurrentEvent ()
 
void SetUserAction (G4UserEventAction *userAction)
 
void SetUserAction (G4UserStackingAction *userAction)
 
void SetUserAction (G4UserTrackingAction *userAction)
 
void SetUserAction (G4UserSteppingAction *userAction)
 
G4UserEventAction * GetUserEventAction ()
 
G4UserStackingAction * GetUserStackingAction ()
 
G4UserTrackingAction * GetUserTrackingAction ()
 
G4UserSteppingAction * GetUserSteppingAction ()
 
void SetNumberOfAdditionalWaitingStacks (G4int iAdd)
 
void KeepTheCurrentEvent ()
 
G4StackManager * GetStackManager () const
 
G4TrackingManager * GetTrackingManager () const
 
G4int GetVerboseLevel ()
 
void SetVerboseLevel (G4int value)
 
void SetUserInformation (G4VUserEventInformation *anInfo)
 
G4VUserEventInformation * GetUserInformation ()
 
G4PrimaryTransformer * GetPrimaryTransformer () const
 
void SetPrimaryTransformer (G4PrimaryTransformer *tf)
 
void StoreRandomNumberStatusToG4Event (G4int vl)
 

Static Public Member Functions

static G4EventManager * GetEventManager ()
 

Detailed Description

Definition at line 60 of file G4EventManager.hh.

Constructor & Destructor Documentation

G4EventManager::G4EventManager ( )

Definition at line 49 of file G4EventManager.cc.

References FatalException, G4Exception(), G4SDManager::GetSDMpointerIfExist(), and G4StateManager::GetStateManager().

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  stateManager = G4StateManager::GetStateManager();
67  fpEventManager = this;
68  userEventAction = 0;
69  userStackingAction = 0;
70  userTrackingAction = 0;
71  userSteppingAction = 0;
72  }
73 }
static G4StateManager * GetStateManager()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49
G4EventManager::~G4EventManager ( )

Definition at line 80 of file G4EventManager.cc.

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

Member Function Documentation

void G4EventManager::AbortCurrentEvent ( )

Definition at line 388 of file G4EventManager.cc.

References G4StackManager::clear(), and G4TrackingManager::EventAborted().

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

389 {
390  abortRequested = true;
391  trackContainer->clear();
392  if(tracking) trackManager->EventAborted();
393 }
const G4Event* G4EventManager::GetConstCurrentEvent ( )
inline
G4EventManager * G4EventManager::GetEventManager ( )
static
G4Event* G4EventManager::GetNonconstCurrentEvent ( )
inline

Definition at line 127 of file G4EventManager.hh.

Referenced by export_G4EventManager().

128  { return currentEvent; }
G4PrimaryTransformer* G4EventManager::GetPrimaryTransformer ( ) const
inline

Definition at line 184 of file G4EventManager.hh.

Referenced by G4RunManagerKernel::GetPrimaryTransformer().

185  { return transformer; }
G4StackManager* G4EventManager::GetStackManager ( ) const
inline

Definition at line 162 of file G4EventManager.hh.

Referenced by export_G4EventManager(), and G4RunManagerKernel::GetStackManager().

163  { return trackContainer; }
G4TrackingManager* G4EventManager::GetTrackingManager ( ) const
inline
G4UserEventAction* G4EventManager::GetUserEventAction ( )
inline

Definition at line 145 of file G4EventManager.hh.

Referenced by G4TheRayTracer::StoreUserActions().

146  { return userEventAction; }
G4VUserEventInformation * G4EventManager::GetUserInformation ( )

Definition at line 376 of file G4EventManager.cc.

References G4State_EventProc, G4StateManager::GetCurrentState(), and G4Event::GetUserInformation().

Referenced by export_G4EventManager().

377 {
378  G4ApplicationState currentState = stateManager->GetCurrentState();
379  if(currentState!=G4State_EventProc || currentEvent==0)
380  { return 0; }
381 
382  return currentEvent->GetUserInformation();
383 }
G4VUserEventInformation * GetUserInformation() const
Definition: G4Event.hh:188
G4ApplicationState GetCurrentState() const
G4ApplicationState
G4UserStackingAction* G4EventManager::GetUserStackingAction ( )
inline

Definition at line 147 of file G4EventManager.hh.

Referenced by G4TheRayTracer::StoreUserActions().

148  { return userStackingAction; }
G4UserSteppingAction* G4EventManager::GetUserSteppingAction ( )
inline

Definition at line 151 of file G4EventManager.hh.

Referenced by G4TheRayTracer::StoreUserActions().

152  { return userSteppingAction; }
G4UserTrackingAction* G4EventManager::GetUserTrackingAction ( )
inline
G4int G4EventManager::GetVerboseLevel ( )
inline

Definition at line 168 of file G4EventManager.hh.

Referenced by export_G4EventManager(), and G4EvManMessenger::GetCurrentValue().

169  { return verboseLevel; }
void G4EventManager::KeepTheCurrentEvent ( )

Definition at line 385 of file G4EventManager.cc.

References G4Event::KeepTheEvent().

Referenced by G4EvManMessenger::SetNewValue().

386 { if(currentEvent) currentEvent->KeepTheEvent(); }
void KeepTheEvent(G4bool vl=true)
Definition: G4Event.hh:134
void G4EventManager::ProcessOneEvent ( G4Event *  anEvent)

Definition at line 333 of file G4EventManager.cc.

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

334 {
335  trackIDCounter = 0;
336  DoProcessing(anEvent);
337 }
void G4EventManager::ProcessOneEvent ( G4TrackVector *  trackVector,
G4Event *  anEvent = 0 
)

Definition at line 339 of file G4EventManager.cc.

References G4ThreadLocal, CLHEP::HepRandom::saveFullState(), and G4Event::SetRandomNumberStatus().

340 {
341  static G4ThreadLocal G4String *randStat = 0;
342  if (!randStat) randStat = new G4String;
343  trackIDCounter = 0;
344  G4bool tempEvent = false;
345  if(!anEvent)
346  {
347  anEvent = new G4Event();
348  tempEvent = true;
349  }
350  if(storetRandomNumberStatusToG4Event==1 || storetRandomNumberStatusToG4Event==3)
351  {
352  std::ostringstream oss;
354  anEvent->SetRandomNumberStatus(*randStat=oss.str());
355  }
356  StackTracks(trackVector,false);
357  DoProcessing(anEvent);
358  if(tempEvent)
359  { delete anEvent; }
360 }
#define G4ThreadLocal
Definition: tls.hh:52
bool G4bool
Definition: G4Types.hh:79
void SetRandomNumberStatus(G4String &st)
Definition: G4Event.hh:124
static std::ostream & saveFullState(std::ostream &os)
Definition: Random.cc:185
void G4EventManager::SetNumberOfAdditionalWaitingStacks ( G4int  iAdd)
inline
void G4EventManager::SetPrimaryTransformer ( G4PrimaryTransformer *  tf)
inline

Definition at line 186 of file G4EventManager.hh.

Referenced by G4RunManagerKernel::SetPrimaryTransformer().

187  { transformer = tf; }
void G4EventManager::SetUserAction ( G4UserEventAction *  userAction)

Definition at line 309 of file G4EventManager.cc.

References G4UserEventAction::SetEventManager().

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

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

Definition at line 315 of file G4EventManager.cc.

References G4StackManager::SetUserStackingAction().

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

Definition at line 321 of file G4EventManager.cc.

References G4TrackingManager::SetUserAction().

322 {
323  userTrackingAction = userAction;
324  trackManager->SetUserAction(userAction);
325 }
void SetUserAction(G4UserTrackingAction *apAction)
void G4EventManager::SetUserAction ( G4UserSteppingAction *  userAction)

Definition at line 327 of file G4EventManager.cc.

References G4TrackingManager::SetUserAction().

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

Definition at line 362 of file G4EventManager.cc.

References G4Exception(), G4State_EventProc, G4StateManager::GetCurrentState(), JustWarning, and G4Event::SetUserInformation().

Referenced by LXeEventAction::BeginOfEventAction(), and export_G4EventManager().

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 ansense of G4Event.");
370  return;
371  }
372 
373  currentEvent->SetUserInformation(anInfo);
374 }
void SetUserInformation(G4VUserEventInformation *anInfo)
Definition: G4Event.hh:187
G4ApplicationState GetCurrentState() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4ApplicationState
void G4EventManager::SetVerboseLevel ( G4int  value)
inline

Definition at line 170 of file G4EventManager.hh.

References G4PrimaryTransformer::SetVerboseLevel(), and G4StackManager::SetVerboseLevel().

Referenced by export_G4EventManager(), and G4EvManMessenger::SetNewValue().

171  {
172  verboseLevel = value;
173  trackContainer->SetVerboseLevel( value );
174  transformer->SetVerboseLevel( value );
175  }
void SetVerboseLevel(G4int const value)
void SetVerboseLevel(G4int vl)
const XML_Char int const XML_Char * value
void G4EventManager::StoreRandomNumberStatusToG4Event ( G4int  vl)
inline

Definition at line 188 of file G4EventManager.hh.

Referenced by G4RunManager::StoreRandomNumberStatusToG4Event().

189  { storetRandomNumberStatusToG4Event = vl; }

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