Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4EventManager.hh
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4EventManager.hh 94950 2016-01-07 11:53:14Z gcosmo $
28 //
29 //
30 
31 
32 #ifndef G4EventManager_h
33 #define G4EventManager_h 1
34 
35 #include "evmandefs.hh"
36 #include "G4StackManager.hh"
37 #include "G4TrajectoryContainer.hh"
38 #include "G4PrimaryTransformer.hh"
39 class G4Event;
40 class G4UserEventAction;
44 class G4EvManMessenger;
45 #include "G4TrackingManager.hh"
46 #include "G4Track.hh"
47 #include "G4VTrajectory.hh"
48 #include "G4TrackStatus.hh"
49 class G4SDManager;
50 class G4StateManager;
51 #include "globals.hh"
53 
54 // class description:
55 //
56 // G4EventManager controls an event. This class must be a singleton
57 // and should be constructed by G4RunManager.
58 //
59 
61 {
62  public: // with description
64  // This method returns the singleton pointer of G4EventManager.
65 
66  private:
68 
69  public:
72 
73  private:
74  G4EventManager(const G4EventManager &right) = delete;
75  G4EventManager& operator=(const G4EventManager& right) = delete;
76 
77  public: // with description
78  void ProcessOneEvent(G4Event* anEvent);
79  // This method is the main entry to this class for simulating an event.
80 
81  void ProcessOneEvent(G4TrackVector* trackVector,G4Event* anEvent=0);
82  // This is an alternative entry for large HEP experiments which create G4Track
83  // objects by themselves directly without using G4VPrimaryGenerator or user
84  // primary generator action. Dummy G4Event object will be created if "anEvent" is null
85  // for internal use, but this dummy object will be deleted at the end of this
86  // method and will never be available for the use after the processing.
87  // Note that in this case of null G4Event pointer no output of the simulated event
88  // is returned by this method, but the user must implement some mechanism
89  // of storing output by his/herself, e.g. in his/her UserEventAction and/or
90  // sensitive detectors.
91  // If valid G4Event object is given, this object will not be deleted with
92  // this method and output objects such as hits collections and trajectories
93  // will be associated to this event object. If this event object has valid
94  // primary vertices/particles, they will be added to the given trackvector input.
95 
96  private:
97  void DoProcessing(G4Event* anEvent);
98  void StackTracks(G4TrackVector *trackVector, G4bool IDhasAlreadySet=false);
99 
101 
111 
113 
118 
121 
123 
124  public: // with description
126  { return currentEvent; }
128  { return currentEvent; }
129  // These methods returns the pointers of const G4Event*
130  // and G4Event*, respectively. Null will be returned when
131  // an event is not processing.
132 
133  public: // with description
134  void AbortCurrentEvent();
135  // This method aborts the processing of the current event. All stacked
136  // tracks are deleted. The contents of G4Event object is not completed,
137  // but trajectories, hits, and/or digits which are created before the
138  // moment of abortion can be used.
139 
140  public: // with description
141  void SetUserAction(G4UserEventAction* userAction);
142  void SetUserAction(G4UserStackingAction* userAction);
143  void SetUserAction(G4UserTrackingAction* userAction);
144  void SetUserAction(G4UserSteppingAction* userAction);
146  { return userEventAction; }
148  { return userStackingAction; }
150  { return userTrackingAction; }
152  { return userSteppingAction; }
153  // Set and get methods for user action classes. User action classes
154  // which should belong to the other managers will be sent to the
155  // corresponding managers.
158 
159  void KeepTheCurrentEvent();
160  // If the current event exists, it is kept undeleted until the end of the current run
161 
163  { return trackContainer; }
165  { return trackManager; }
166 
167  public: // with description
169  { return verboseLevel; }
170  inline void SetVerboseLevel( G4int value )
171  {
174  transformer->SetVerboseLevel( value );
175  }
176  // Set and get method of the verbose level
177 
180  // Set and get method of G4VUserEventInformation object associating with
181  // the current event. Both methods are valid only for G4State_EventProc
182  // application state.
183 
185  { return transformer; }
187  { transformer = tf; }
190 };
191 
192 
193 
194 #endif
195 
void SetVerboseLevel(G4int vl)
G4TrajectoryContainer * trajectoryContainer
G4Event * GetNonconstCurrentEvent()
G4PrimaryTransformer * transformer
G4EventManager & operator=(const G4EventManager &right)=delete
void StackTracks(G4TrackVector *trackVector, G4bool IDhasAlreadySet=false)
G4UserSteppingAction * userSteppingAction
void ProcessOneEvent(G4Event *anEvent)
void AbortCurrentEvent()
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
G4StateManager * stateManager
G4String randomNumberStatusToG4Event
G4int storetRandomNumberStatusToG4Event
#define G4ThreadLocal
Definition: tls.hh:69
void SetUserAction(G4UserEventAction *userAction)
G4StackManager * GetStackManager() const
void SetVerboseLevel(G4int value)
G4UserEventAction * userEventAction
G4int GetVerboseLevel()
bool G4bool
Definition: G4Types.hh:79
void SetPrimaryTransformer(G4PrimaryTransformer *tf)
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4TrackingManager * GetTrackingManager() const
G4EvManMessenger * theMessenger
G4VUserEventInformation * GetUserInformation()
void StoreRandomNumberStatusToG4Event(G4int vl)
G4TrackingManager * trackManager
static G4EventManager * GetEventManager()
void KeepTheCurrentEvent()
G4UserEventAction * GetUserEventAction()
G4UserStackingAction * userStackingAction
G4UserSteppingAction * GetUserSteppingAction()
void SetVerboseLevel(G4int const value)
void SetUserInformation(G4VUserEventInformation *anInfo)
const G4Event * GetConstCurrentEvent()
G4Event * currentEvent
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
G4UserStackingAction * GetUserStackingAction()
G4PrimaryTransformer * GetPrimaryTransformer() const
int G4int
Definition: G4Types.hh:78
G4StackManager * trackContainer
std::vector< G4Track * > G4TrackVector
static G4ThreadLocal G4EventManager * fpEventManager
void DoProcessing(G4Event *anEvent)
G4SDManager * sdManager
G4UserTrackingAction * userTrackingAction
G4UserTrackingAction * GetUserTrackingAction()