ECCE @ EIC Software
 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"
56 #include "G4RotationMatrix.hh"
57 #include "G4ThreeVector.hh"
58 #include "G4Transform3D.hh"
60 
61 #include "G4ios.hh"
62 
63 //---------------------------
64 // For possible future needs:
65 //---------------------------
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 
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 
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
112 
113 
114 public: // with description
115  // Methods to add/remove models to/from the Model
116  // List.
117  //
119  // Add a model to the Model List.
120 
122  // Remove a model from the Model List.
123 
124  // Methods to activate/inactivate models from the Model
125  // List.
126 
128  // Activate a model in the Model List.
129 
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 
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
155  const G4Navigator* a = 0);
156  // DoIt
158 
159  // AtRest methods:
161  const G4Navigator* a = 0);
163 
164  // For management
166 
167 private:
168  // Private members :
174 
177 
178  // -- *** depracating, to be dropped @ next major release:
180 };
181 
182 inline void
184 {
185  ModelList.push_back(fsm);
186  // forces the fApplicableModelList to be rebuild
188 }
189 
190 inline void
192 {
193  if(!ModelList.remove(fsm)) fInactivatedModels.remove(fsm);
194  // forces the fApplicableModelList to be rebuild
196 }
197 
198 inline G4bool
200 {
201  return (this==&fsm) ? true : false;
202 }
203 
204 inline const G4Envelope*
206 {
207  return fFastTrack.GetEnvelope();
208 }
209 
210 #endif