Geant4  10.01.p03
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: G4FastSimulationManager.hh 68056 2013-03-13 14:44:48Z gcosmo $
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"
57 #include "G4RotationMatrix.hh"
58 #include "G4ThreeVector.hh"
59 #include "G4Transform3D.hh"
61 
62 #include "G4ios.hh"
63 
64 //---------------------------
65 // For possible future needs:
66 //---------------------------
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 
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 
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
113 
114 
115 public: // with description
116  // Methods to add/remove models to/from the Model
117  // List.
118  //
120  // Add a model to the Model List.
121 
123  // Remove a model from the Model List.
124 
125  // Methods to activate/inactivate models from the Model
126  // List.
127 
129  // Activate a model in the Model List.
130 
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 
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
156  const G4Navigator* a = 0);
157  // DoIt
159 
160  // AtRest methods:
162  const G4Navigator* a = 0);
164 
165  // For management
167 
168 private:
169  // Private members :
175 
178 
179  // -- *** depracating, to be dropped @ next major release:
181 };
182 
183 inline void
185 {
186  ModelList.push_back(fsm);
187  // forces the fApplicableModelList to be rebuild
189 }
190 
191 inline void
193 {
194  if(!ModelList.remove(fsm)) fInactivatedModels.remove(fsm);
195  // forces the fApplicableModelList to be rebuild
197 }
198 
199 inline G4bool
201 {
202  return (this==&fsm) ? true : false;
203 }
204 
205 inline const G4Envelope*
207 {
208  return fFastTrack.GetEnvelope();
209 }
210 
211 #endif
G4FastSimulationVector< G4VFastSimulationModel > fApplicableModelList
G4VParticleChange * InvokePostStepDoIt()
G4bool AtRestGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=0)
G4double a
Definition: TRTMaterials.hh:39
G4FastSimulationVector< G4VFastSimulationModel > fInactivatedModels
G4bool ActivateFastSimulationModel(const G4String &)
void AddFastSimulationModel(G4VFastSimulationModel *)
G4VFastSimulationModel * fTriggedFastSimulationModel
bool G4bool
Definition: G4Types.hh:79
G4bool operator==(const G4FastSimulationManager &) const
#define FALSE
Definition: globals.hh:52
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound, bool &foundPrevious) const
G4VParticleChange * InvokeAtRestDoIt()
G4FastSimulationVector< G4Transform3D > GhostPlacements
const G4Envelope * GetEnvelope() const
const std::vector< G4VFastSimulationModel * > & GetFastSimulationModelList() const
G4Region G4Envelope
G4ParticleDefinition * fLastCrossedParticle
void RemoveFastSimulationModel(G4VFastSimulationModel *)
T * remove(const T *)
G4bool InActivateFastSimulationModel(const G4String &)
G4bool PostStepGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=0)
G4FastSimulationManager(G4Envelope *anEnvelope, G4bool IsUnique=FALSE)
G4Envelope * GetEnvelope() const
Definition: G4FastTrack.hh:188
G4FastSimulationVector< G4VFastSimulationModel > ModelList