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