Files
geant4/source/event/include/G4EventManager.hh
T
2016-06-09 10:15:15 +02:00

155 lines
5.4 KiB
C++

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4EventManager.hh,v 1.9 2001/07/19 00:14:15 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
#ifndef G4EventManager_h
#define G4EventManager_h 1
#include "evmandefs.hh"
#include "G4StackManager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4PrimaryTransformer.hh"
class G4Event;
class G4UserEventAction;
class G4UserStackingAction;
class G4UserTrackingAction;
class G4UserSteppingAction;
class G4EvManMessenger;
#include "G4TrackingManager.hh"
#include "G4Track.hh"
#include "G4VTrajectory.hh"
#include "G4TrackStatus.hh"
class G4SDManager;
#include "globals.hh"
// class description:
//
// G4EventManager controls an event. This class must be a singleton
// and should be constructed by G4RunManager.
//
class G4EventManager
{
public: // with description
static G4EventManager* GetEventManager();
// This method returns the singleton pointer of G4EventManager.
private:
static G4EventManager* fpEventManager;
public:
G4EventManager();
~G4EventManager();
private:
G4EventManager(const G4EventManager &right);
G4EventManager& operator=(const G4EventManager& right);
public: // with description
void ProcessOneEvent(G4Event* anEvent);
// This method it the main entry to this class for simulating an event.
// This method must be exclusively invoked by G4RunManager.
private:
void StackTracks(G4TrackVector *trackVector, G4bool IDhasAlreadySet=false);
G4Event* currentEvent;
G4StackManager *trackContainer;
G4TrackingManager *trackManager;
G4TrajectoryContainer *trajectoryContainer;
G4int trackIDCounter;
G4int verboseLevel;
G4SDManager* sdManager;
G4PrimaryTransformer* transformer;
G4bool tracking;
G4EvManMessenger* theMessenger;
G4UserEventAction* userEventAction;
G4UserStackingAction* userStackingAction;
G4UserTrackingAction* userTrackingAction;
G4UserSteppingAction* userSteppingAction;
public: // with description
inline const G4Event* GetConstCurrentEvent()
{ return currentEvent; }
inline G4Event* GetNonconstCurrentEvent()
{ return currentEvent; }
// These methods returns the pointers of const G4Event*
// and G4Event*, respectively. Null will be returned when
// an event is not processing.
public: // with description
inline void AbortCurrentEvent()
{
trackContainer->clear();
if(tracking) trackManager->EventAborted();
}
// This method aborts the processing of the current event. All stacked
// tracks are deleted. The contents of G4Event object is not completed,
// but trajectories, hits, and/or digits which are created before the
// moment of abortion can be used.
public: // with description
void SetUserAction(G4UserEventAction* userAction);
void SetUserAction(G4UserStackingAction* userAction);
void SetUserAction(G4UserTrackingAction* userAction);
void SetUserAction(G4UserSteppingAction* userAction);
inline G4UserEventAction* GetUserEventAction()
{ return userEventAction; }
inline G4UserStackingAction* GetUserStackingAction()
{ return userStackingAction; }
inline G4UserTrackingAction* GetUserTrackingAction()
{ return userTrackingAction; }
inline G4UserSteppingAction* GetUserSteppingAction()
{ return userSteppingAction; }
// Set and get methods for user action classes. User action classes
// which should belong to the other managers will be sent to the
// corresponding managers.
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
{ trackContainer->SetNumberOfAdditionalWaitingStacks(iAdd); }
public: // with description
inline G4int GetVerboseLevel()
{ return verboseLevel; }
inline void SetVerboseLevel( G4int value )
{
verboseLevel = value;
trackContainer->SetVerboseLevel( value );
transformer->SetVerboseLevel( value );
}
// Set and get method of the verbose level
};
#endif