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
G4FastSimulationManager.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4FastSimulationManager.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
// G4FastSimulationManager.hh
32
//
33
// Description:
34
// Manages the Fast Simulation models attached to a envelope.
35
//
36
// History:
37
// Oct 97: Verderi && MoraDeFreitas - First Implementation.
38
//
39
//---------------------------------------------------------------
40
41
42
#ifndef G4FastSimulationManager_h
43
#define G4FastSimulationManager_h 1
44
45
#include "
globals.hh
"
46
47
#include "
G4LogicalVolume.hh
"
48
#include "
G4Region.hh
"
49
#include "
G4VPhysicalVolume.hh
"
50
#include "
G4ParticleTable.hh
"
51
#include "
G4ParticleDefinition.hh
"
52
#include "
G4VParticleChange.hh
"
53
#include "
G4FastTrack.hh
"
54
#include "
G4FastStep.hh
"
55
#include "
G4VFastSimulationModel.hh
"
56
#include "
G4RotationMatrix.hh
"
57
#include "
G4ThreeVector.hh
"
58
#include "
G4Transform3D.hh
"
59
#include "
G4FastSimulationVector.hh
"
60
61
#include "
G4ios.hh
"
62
63
//---------------------------
64
// For possible future needs:
65
//---------------------------
66
typedef
G4Region
G4Envelope
;
67
68
//-------------------------------------------
69
//
70
// G4FastSimulationManager class
71
//
72
//-------------------------------------------
73
74
// Class Description:
75
// The G4VFastSimulationModel objects are attached to the envelope
76
// through a G4FastSimulationManager.
77
// This object will manage the list of models and will message them
78
// at tracking time.
79
//
80
81
82
class
G4FastSimulationManager
83
{
84
public
:
// with description
85
//------------------------
86
// Constructor/Destructor
87
//------------------------
88
// Only one Constructor. By default the envelope can
89
// be placed n-Times.
90
// If the user is sure that it is placed just one time,
91
// the IsUnique flag should be set TRUE to avoid the
92
// G4AffineTransform re-calculations each time we reach
93
// the envelope.
94
95
G4FastSimulationManager
(
G4Envelope
*anEnvelope,
96
G4bool
IsUnique =
FALSE
);
97
// This is the only constructor. In this constructor you specify
98
// the envelope by giving the G4Region (typedef-ed as G4Envelope)
99
// pointer. The G4FastSimulationManager object will bind itself to
100
// this envelope and will notify this G4Region to become an envelope.
101
// If you know that this region is used for only one logical volume,
102
// you can turn the IsUnique boolean to "true" to allow some optimization.
103
//
104
// Note that if you choose to use the G4VFastSimulationModel(const G4String&,
105
// G4Region*, G4bool) constructor for you model, the G4FastSimulationManager
106
// will be constructed using the given G4Region* and G4bool values of the
107
// model constructor.
108
//
109
110
public
:
// without description
111
~G4FastSimulationManager
();
112
113
114
public
:
// with description
115
// Methods to add/remove models to/from the Model
116
// List.
117
//
118
void
AddFastSimulationModel
(
G4VFastSimulationModel
*);
119
// Add a model to the Model List.
120
121
void
RemoveFastSimulationModel
(
G4VFastSimulationModel
*);
122
// Remove a model from the Model List.
123
124
// Methods to activate/inactivate models from the Model
125
// List.
126
127
G4bool
ActivateFastSimulationModel
(
const
G4String
&);
128
// Activate a model in the Model List.
129
130
G4bool
InActivateFastSimulationModel
(
const
G4String
&);
131
// Inactivate a model in the Model List.
132
133
public
:
// without description
134
// Methods for print/control commands
135
void
ListTitle
()
const
;
136
void
ListModels
()
const
;
137
void
ListModels
(
const
G4ParticleDefinition
*)
const
;
138
void
ListModels
(
const
G4String
& aName)
const
;
139
const
G4Envelope
*
GetEnvelope
()
const
;
140
141
G4VFastSimulationModel
*
GetFastSimulationModel
(
const
G4String
& modelName,
142
const
G4VFastSimulationModel
* previousFound,
143
bool
&foundPrevious)
const
;
144
145
const
std::vector<G4VFastSimulationModel*>&
GetFastSimulationModelList
()
const
146
{
return
ModelList
;}
147
148
149
//----------------------------------------------
150
// Interface methods for the
151
// G4FastSimulationManagerProcess process.
152
//----------------------------------------------
153
// Trigger
154
G4bool
PostStepGetFastSimulationManagerTrigger
(
const
G4Track
&,
155
const
G4Navigator
*
a
= 0);
156
// DoIt
157
G4VParticleChange
*
InvokePostStepDoIt
();
158
159
// AtRest methods:
160
G4bool
AtRestGetFastSimulationManagerTrigger
(
const
G4Track
&,
161
const
G4Navigator
*
a
= 0);
162
G4VParticleChange
*
InvokeAtRestDoIt
();
163
164
// For management
165
G4bool
operator ==
(
const
G4FastSimulationManager
&)
const
;
166
167
private
:
168
// Private members :
169
G4FastTrack
fFastTrack
;
170
G4FastStep
fFastStep
;
171
G4VFastSimulationModel
*
fTriggedFastSimulationModel
;
172
G4FastSimulationVector <G4VFastSimulationModel>
ModelList
;
173
G4FastSimulationVector <G4VFastSimulationModel>
fInactivatedModels
;
174
175
G4ParticleDefinition
*
fLastCrossedParticle
;
176
G4FastSimulationVector <G4VFastSimulationModel>
fApplicableModelList
;
177
178
// -- *** depracating, to be dropped @ next major release:
179
G4FastSimulationVector <G4Transform3D>
GhostPlacements
;
180
};
181
182
inline
void
183
G4FastSimulationManager::AddFastSimulationModel
(
G4VFastSimulationModel
* fsm)
184
{
185
ModelList
.push_back(fsm);
186
// forces the fApplicableModelList to be rebuild
187
fLastCrossedParticle
= 0;
188
}
189
190
inline
void
191
G4FastSimulationManager::RemoveFastSimulationModel
(
G4VFastSimulationModel
* fsm)
192
{
193
if
(!
ModelList
.
remove
(fsm))
fInactivatedModels
.
remove
(fsm);
194
// forces the fApplicableModelList to be rebuild
195
fLastCrossedParticle
= 0;
196
}
197
198
inline
G4bool
199
G4FastSimulationManager::operator ==
(
const
G4FastSimulationManager
& fsm)
const
200
{
201
return
(
this
==&fsm) ?
true
:
false
;
202
}
203
204
inline
const
G4Envelope
*
205
G4FastSimulationManager::GetEnvelope
()
const
206
{
207
return
fFastTrack
.
GetEnvelope
();
208
}
209
210
#endif
geant4
tree
geant4-10.6-release
source
processes
parameterisation
include
G4FastSimulationManager.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:52
using
1.8.2 with
ECCE GitHub integration