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 (  ) 

Definition at line 49 of file G4EventManager.cc.

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

00050 :currentEvent(0),trajectoryContainer(0),
00051  verboseLevel(0),tracking(false),abortRequested(false),
00052  storetRandomNumberStatusToG4Event(false)
00053 {
00054  if(fpEventManager)
00055  {
00056   G4Exception("G4EventManager::G4EventManager","Event0001",FatalException,
00057   "G4EventManager::G4EventManager() has already been made.");
00058  }
00059  else
00060  {
00061   trackManager = new G4TrackingManager;
00062   transformer = new G4PrimaryTransformer;
00063   trackContainer = new G4StackManager;
00064   theMessenger = new G4EvManMessenger(this);
00065   sdManager = G4SDManager::GetSDMpointerIfExist();
00066   fpEventManager = this;
00067   userEventAction = 0;
00068   userStackingAction = 0;
00069   userTrackingAction = 0;
00070   userSteppingAction = 0;
00071  }
00072 }

G4EventManager::~G4EventManager (  ) 

Definition at line 79 of file G4EventManager.cc.

00080 {
00081    delete trackContainer;
00082    delete transformer;
00083    delete trackManager;
00084    delete theMessenger;
00085    if(userEventAction) delete userEventAction;
00086    fpEventManager = 0;
00087 }


Member Function Documentation

void G4EventManager::AbortCurrentEvent (  ) 

Definition at line 389 of file G4EventManager.cc.

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

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

00390 {
00391   abortRequested = true;
00392   trackContainer->clear();
00393   if(tracking) trackManager->EventAborted();
00394 }

const G4Event* G4EventManager::GetConstCurrentEvent (  )  [inline]

Definition at line 122 of file G4EventManager.hh.

00123       { return currentEvent; }

G4EventManager * G4EventManager::GetEventManager (  )  [static]

Definition at line 46 of file G4EventManager.cc.

Referenced by G4StackChecker::ClassifyNewTrack(), G4ErrorPropagator::G4ErrorPropagator(), G4MaterialScanner::G4MaterialScanner(), G4TheRayTracer::G4TheRayTracer(), G4ErrorPropagator::InvokePostUserTrackingAction(), G4ErrorPropagator::InvokePreUserTrackingAction(), G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel(), G4ErrorRunManagerHelper::SetUserAction(), and G4ErrorPropagatorManager::SetUserAction().

00047 { return fpEventManager; }

G4Event* G4EventManager::GetNonconstCurrentEvent (  )  [inline]

Definition at line 124 of file G4EventManager.hh.

00125       { return currentEvent; }

G4PrimaryTransformer* G4EventManager::GetPrimaryTransformer (  )  const [inline]

Definition at line 181 of file G4EventManager.hh.

Referenced by G4RunManagerKernel::GetPrimaryTransformer().

00182       { return transformer; }

G4StackManager* G4EventManager::GetStackManager (  )  const [inline]

Definition at line 159 of file G4EventManager.hh.

Referenced by G4RunManagerKernel::GetStackManager().

00160       { return trackContainer; }

G4TrackingManager* G4EventManager::GetTrackingManager (  )  const [inline]

Definition at line 161 of file G4EventManager.hh.

Referenced by G4ErrorPropagator::G4ErrorPropagator(), G4RunManagerKernel::GetTrackingManager(), and G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel().

00162       { return trackManager; }

G4UserEventAction* G4EventManager::GetUserEventAction (  )  [inline]

Definition at line 142 of file G4EventManager.hh.

Referenced by G4TheRayTracer::StoreUserActions().

00143       { return userEventAction; }

G4VUserEventInformation * G4EventManager::GetUserInformation (  ) 

Definition at line 376 of file G4EventManager.cc.

References G4State_EventProc, G4StateManager::GetCurrentState(), and G4StateManager::GetStateManager().

00377 { 
00378   G4StateManager* stateManager = G4StateManager::GetStateManager();
00379   G4ApplicationState currentState = stateManager->GetCurrentState();
00380   if(currentState!=G4State_EventProc || currentEvent==0)
00381   { return 0; }
00382   
00383   return currentEvent->GetUserInformation();
00384 }

G4UserStackingAction* G4EventManager::GetUserStackingAction (  )  [inline]

Definition at line 144 of file G4EventManager.hh.

Referenced by G4TheRayTracer::StoreUserActions().

00145       { return userStackingAction; }

G4UserSteppingAction* G4EventManager::GetUserSteppingAction (  )  [inline]

Definition at line 148 of file G4EventManager.hh.

Referenced by G4TheRayTracer::StoreUserActions().

00149       { return userSteppingAction; }

G4UserTrackingAction* G4EventManager::GetUserTrackingAction (  )  [inline]

Definition at line 146 of file G4EventManager.hh.

Referenced by G4ErrorPropagator::InvokePostUserTrackingAction(), G4ErrorPropagator::InvokePreUserTrackingAction(), and G4TheRayTracer::StoreUserActions().

00147       { return userTrackingAction; }

G4int G4EventManager::GetVerboseLevel (  )  [inline]

Definition at line 165 of file G4EventManager.hh.

Referenced by G4EvManMessenger::GetCurrentValue().

00166       { return verboseLevel; }

void G4EventManager::KeepTheCurrentEvent (  ) 

Definition at line 386 of file G4EventManager.cc.

Referenced by G4EvManMessenger::SetNewValue().

00387 { if(currentEvent) currentEvent->KeepTheEvent(); }

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

Definition at line 339 of file G4EventManager.cc.

References G4Event::SetRandomNumberStatus().

00340 {
00341   static G4String randStat;
00342   trackIDCounter = 0;
00343   G4bool tempEvent = false;
00344   if(!anEvent)
00345   {
00346     anEvent = new G4Event();
00347     tempEvent = true;
00348   }
00349   if(storetRandomNumberStatusToG4Event==1 || storetRandomNumberStatusToG4Event==3)
00350   {
00351     std::ostringstream oss;
00352     CLHEP::HepRandom::saveFullState(oss);
00353     anEvent->SetRandomNumberStatus(randStat=oss.str());
00354   }
00355   StackTracks(trackVector,false);
00356   DoProcessing(anEvent);
00357   if(tempEvent)
00358   { delete anEvent; }
00359 }

void G4EventManager::ProcessOneEvent ( G4Event anEvent  ) 

Definition at line 333 of file G4EventManager.cc.

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

00334 {
00335   trackIDCounter = 0;
00336   DoProcessing(anEvent);
00337 }

void G4EventManager::SetNumberOfAdditionalWaitingStacks ( G4int  iAdd  )  [inline]

Definition at line 153 of file G4EventManager.hh.

References G4StackManager::SetNumberOfAdditionalWaitingStacks().

Referenced by G4RunManager::SetNumberOfAdditionalWaitingStacks().

00154       { trackContainer->SetNumberOfAdditionalWaitingStacks(iAdd); }

void G4EventManager::SetPrimaryTransformer ( G4PrimaryTransformer tf  )  [inline]

Definition at line 183 of file G4EventManager.hh.

Referenced by G4RunManagerKernel::SetPrimaryTransformer().

00184       { transformer = tf; }

void G4EventManager::SetUserAction ( G4UserSteppingAction userAction  ) 

Definition at line 327 of file G4EventManager.cc.

References G4TrackingManager::SetUserAction().

00328 {
00329   userSteppingAction = userAction;
00330   trackManager->SetUserAction(userAction);
00331 }

void G4EventManager::SetUserAction ( G4UserTrackingAction userAction  ) 

Definition at line 321 of file G4EventManager.cc.

References G4TrackingManager::SetUserAction().

00322 {
00323   userTrackingAction = userAction;
00324   trackManager->SetUserAction(userAction);
00325 }

void G4EventManager::SetUserAction ( G4UserStackingAction userAction  ) 

Definition at line 315 of file G4EventManager.cc.

References G4StackManager::SetUserStackingAction().

00316 {
00317   userStackingAction = userAction;
00318   trackContainer->SetUserStackingAction(userAction);
00319 }

void G4EventManager::SetUserAction ( G4UserEventAction userAction  ) 

Definition at line 309 of file G4EventManager.cc.

References G4UserEventAction::SetEventManager().

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

00310 {
00311   userEventAction = userAction;
00312   if(userEventAction) userEventAction->SetEventManager(this);
00313 }

void G4EventManager::SetUserInformation ( G4VUserEventInformation anInfo  ) 

Definition at line 361 of file G4EventManager.cc.

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

00362 { 
00363   G4StateManager* stateManager = G4StateManager::GetStateManager();
00364   G4ApplicationState currentState = stateManager->GetCurrentState();
00365   if(currentState!=G4State_EventProc || currentEvent==0)
00366   {
00367     G4Exception("G4EventManager::SetUserInformation",
00368                 "Event0003", JustWarning,
00369                 "G4VUserEventInformation cannot be set because of ansense of G4Event.");
00370     return;
00371   }
00372   
00373   currentEvent->SetUserInformation(anInfo);
00374 }

void G4EventManager::SetVerboseLevel ( G4int  value  )  [inline]

Definition at line 167 of file G4EventManager.hh.

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

Referenced by G4EvManMessenger::SetNewValue().

00168       {
00169         verboseLevel = value;
00170         trackContainer->SetVerboseLevel( value );
00171         transformer->SetVerboseLevel( value );
00172       }

void G4EventManager::StoreRandomNumberStatusToG4Event ( G4int  vl  )  [inline]

Definition at line 185 of file G4EventManager.hh.

Referenced by G4RunManager::StoreRandomNumberStatusToG4Event().

00186       { storetRandomNumberStatusToG4Event = vl; }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:56 2013 for Geant4 by  doxygen 1.4.7