ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4EventManager.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file 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
//
28
//
29
30
31
#ifndef G4EventManager_h
32
#define G4EventManager_h 1
33
34
#include "
evmandefs.hh
"
35
#include "
G4StackManager.hh
"
36
#include "
G4TrajectoryContainer.hh
"
37
#include "
G4PrimaryTransformer.hh
"
38
class
G4Event
;
39
class
G4UserEventAction
;
40
class
G4UserStackingAction
;
41
class
G4UserTrackingAction
;
42
class
G4UserSteppingAction
;
43
class
G4EvManMessenger
;
44
#include "
G4TrackingManager.hh
"
45
#include "
G4Track.hh
"
46
#include "
G4VTrajectory.hh
"
47
#include "
G4TrackStatus.hh
"
48
class
G4SDManager
;
49
class
G4StateManager
;
50
#include "
globals.hh
"
51
class
G4VUserEventInformation
;
52
53
// class description:
54
//
55
// G4EventManager controls an event. This class must be a singleton
56
// and should be constructed by G4RunManager.
57
//
58
59
class
G4EventManager
60
{
61
public
:
// with description
62
static
G4EventManager
*
GetEventManager
();
63
// This method returns the singleton pointer of G4EventManager.
64
65
private
:
66
static
G4ThreadLocal
G4EventManager
*
fpEventManager
;
67
68
public
:
69
G4EventManager
();
70
~G4EventManager
();
71
72
private
:
73
G4EventManager
(
const
G4EventManager
&
right
) =
delete
;
74
G4EventManager
&
operator=
(
const
G4EventManager
&
right
) =
delete
;
75
76
public
:
// with description
77
void
ProcessOneEvent
(
G4Event
* anEvent);
78
// This method is the main entry to this class for simulating an event.
79
80
void
ProcessOneEvent
(
G4TrackVector
* trackVector,
G4Event
* anEvent=0);
81
// This is an alternative entry for large HEP experiments which create G4Track
82
// objects by themselves directly without using G4VPrimaryGenerator or user
83
// primary generator action. Dummy G4Event object will be created if "anEvent" is null
84
// for internal use, but this dummy object will be deleted at the end of this
85
// method and will never be available for the use after the processing.
86
// Note that in this case of null G4Event pointer no output of the simulated event
87
// is returned by this method, but the user must implement some mechanism
88
// of storing output by his/herself, e.g. in his/her UserEventAction and/or
89
// sensitive detectors.
90
// If valid G4Event object is given, this object will not be deleted with
91
// this method and output objects such as hits collections and trajectories
92
// will be associated to this event object. If this event object has valid
93
// primary vertices/particles, they will be added to the given trackvector input.
94
95
private
:
96
void
DoProcessing
(
G4Event
* anEvent);
97
void
StackTracks
(
G4TrackVector
*trackVector,
G4bool
IDhasAlreadySet=
false
);
98
99
G4Event
*
currentEvent
;
100
101
G4StackManager
*
trackContainer
;
102
G4TrackingManager
*
trackManager
;
103
G4TrajectoryContainer
*
trajectoryContainer
;
104
G4int
trackIDCounter
;
105
G4int
verboseLevel
;
106
G4SDManager
*
sdManager
;
107
G4PrimaryTransformer
*
transformer
;
108
G4bool
tracking
;
109
G4bool
abortRequested
;
110
111
G4EvManMessenger
*
theMessenger
;
112
113
G4UserEventAction
*
userEventAction
;
114
G4UserStackingAction
*
userStackingAction
;
115
G4UserTrackingAction
*
userTrackingAction
;
116
G4UserSteppingAction
*
userSteppingAction
;
117
118
G4int
storetRandomNumberStatusToG4Event
;
119
G4String
randomNumberStatusToG4Event
;
120
121
G4StateManager
*
stateManager
;
122
123
public
:
// with description
124
inline
const
G4Event
*
GetConstCurrentEvent
()
125
{
return
currentEvent
; }
126
inline
G4Event
*
GetNonconstCurrentEvent
()
127
{
return
currentEvent
; }
128
// These methods returns the pointers of const G4Event*
129
// and G4Event*, respectively. Null will be returned when
130
// an event is not processing.
131
132
public
:
// with description
133
void
AbortCurrentEvent
();
134
// This method aborts the processing of the current event. All stacked
135
// tracks are deleted. The contents of G4Event object is not completed,
136
// but trajectories, hits, and/or digits which are created before the
137
// moment of abortion can be used.
138
139
public
:
// with description
140
void
SetUserAction
(
G4UserEventAction
* userAction);
141
void
SetUserAction
(
G4UserStackingAction
* userAction);
142
void
SetUserAction
(
G4UserTrackingAction
* userAction);
143
void
SetUserAction
(
G4UserSteppingAction
* userAction);
144
inline
G4UserEventAction
*
GetUserEventAction
()
145
{
return
userEventAction
; }
146
inline
G4UserStackingAction
*
GetUserStackingAction
()
147
{
return
userStackingAction
; }
148
inline
G4UserTrackingAction
*
GetUserTrackingAction
()
149
{
return
userTrackingAction
; }
150
inline
G4UserSteppingAction
*
GetUserSteppingAction
()
151
{
return
userSteppingAction
; }
152
// Set and get methods for user action classes. User action classes
153
// which should belong to the other managers will be sent to the
154
// corresponding managers.
155
void
SetNumberOfAdditionalWaitingStacks
(
G4int
iAdd)
156
{
trackContainer
->
SetNumberOfAdditionalWaitingStacks
(iAdd); }
157
158
void
KeepTheCurrentEvent
();
159
// If the current event exists, it is kept undeleted until the end of the current run
160
161
inline
G4StackManager
*
GetStackManager
()
const
162
{
return
trackContainer
; }
163
inline
G4TrackingManager
*
GetTrackingManager
()
const
164
{
return
trackManager
; }
165
166
public
:
// with description
167
inline
G4int
GetVerboseLevel
()
168
{
return
verboseLevel
; }
169
inline
void
SetVerboseLevel
(
G4int
value
)
170
{
171
verboseLevel
=
value
;
172
trackContainer
->
SetVerboseLevel
( value );
173
transformer
->
SetVerboseLevel
( value );
174
}
175
// Set and get method of the verbose level
176
177
void
SetUserInformation
(
G4VUserEventInformation
* anInfo);
178
G4VUserEventInformation
*
GetUserInformation
();
179
// Set and get method of G4VUserEventInformation object associating with
180
// the current event. Both methods are valid only for G4State_EventProc
181
// application state.
182
183
inline
G4PrimaryTransformer
*
GetPrimaryTransformer
()
const
184
{
return
transformer
; }
185
inline
void
SetPrimaryTransformer
(
G4PrimaryTransformer
* tf)
186
{
transformer
= tf; }
187
inline
void
StoreRandomNumberStatusToG4Event
(
G4int
vl)
188
{
storetRandomNumberStatusToG4Event
= vl; }
189
};
190
191
192
193
#endif
194
geant4
tree
geant4-10.6-release
source
event
include
G4EventManager.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:13
using
1.8.2 with
ECCE GitHub integration