Geant4  10.02.p01
G4FastTrack.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: G4FastTrack.hh 68056 2013-03-13 14:44:48Z gcosmo $
28 //
29 // $Id:
30 //---------------------------------------------------------------
31 //
32 // G4FastTrack.hh
33 //
34 // Description:
35 // Keeps the current track information and special features
36 // for Parameterised Simulation Models.
37 //
38 // History:
39 // Oct 97: Verderi && MoraDeFreitas - First Implementation.
40 //
41 //---------------------------------------------------------------
42 
43 
44 #ifndef G4FastTrack_h
45 #define G4FastTrack_h
46 
47 #include "G4VSolid.hh"
48 #include "G4LogicalVolume.hh"
49 #include "G4Region.hh"
50 #include "G4AffineTransform.hh"
51 #include "G4Track.hh"
52 #include "G4Navigator.hh"
53 
54 //---------------------------
55 // For possible future needs:
56 //---------------------------
58 
59 
60 //-------------------------------------------
61 //
62 // G4FastTrack class
63 //
64 //-------------------------------------------
65 
66 // Class Description:
67 // The G4FastTrack provides you access to the current G4Track,
68 // gives simple access to envelope related features (G4Region,
69 // G4LogicalVolume, G4VSolid, G4AffineTransform references between
70 // the global and the envelope local coordinates systems) and
71 // simple access to the position, momentum expressed in the
72 // envelope coordinate system. Using those quantities and the
73 // G4VSolid methods, you can for example easily check how far you
74 // are from the envelope boundary.
75 //
76 
77 
79 {
80 public: // without description
81  //------------------------
82  // Constructor/Destructor
83  //------------------------
84  // Only one Constructor. By default the envelope can
85  // be placed n-Times. If the user is sure that it'll be
86  // placed just one time, the IsUnique flag should be set
87  // TRUE to avoid the G4AffineTransform re-calculations each
88  // time we reach the envelope.
89  G4FastTrack(G4Envelope *anEnvelope,
90  G4bool IsUnique);
91  ~G4FastTrack();
92 
93  //------------------------------------------------------------
94  // The fast simulation manager uses the SetCurrentTrack
95  // method to setup the current G4FastTrack object
96  //------------------------------------------------------------
97  void SetCurrentTrack(const G4Track&, const G4Navigator* a = 0);
98 
99  //------------------------------------------------------------
100  // The fast simulation manager uses the OnTheBoundaryButExiting
101  // method to test if the particle is leaving the envelope.
102  //------------------------------------------------------------
104 
105  //----------------------------------
106  // Informations useful to the user :
107  // General public get functions.
108  //----------------------------------
109 
110 public: // with Description
111 
112  const G4Track* GetPrimaryTrack() const;
113  // Returns the current G4Track.
114 
115  G4Envelope* GetEnvelope() const;
116  // Returns the Envelope G4Region pointer.
117 
119  // Returns the Envelope G4LogicalVolume pointer.
120 
122  // Returns the Envelope G4VPhysicalVolume pointer.
123 
124  G4VSolid* GetEnvelopeSolid() const;
125  // Returns the Envelope G4VSolid pointer.
126 
127  //-----------------------------------
128  // Primary track informations in the
129  // Envelope coordinate system.
130  //-----------------------------------
131 
133  // Returns the particle position in envelope coordinates.
134 
136  // Returns the particle momentum in envelope coordinates.
137 
139  // Returns the particle direction in envelope coordinates.
140 
142  // Returns the particle polarization in envelope coordinates.
143 
144  //------------------------------------
145  // 3D transformation of the envelope:
146  //------------------------------------
147  // Global -> Local
148 
150  // Returns the envelope Global -> Local G4AffineTransform
151 
152  // Local -> Global
154  // Returns the envelope Local -> Global G4AffineTransform
155 
156  //-----------------
157  // Private members
158  //-----------------
159 private:
160 
161  // Current G4Track pointer
162  const G4Track* fTrack;
163 
164  //------------------------------------------------
165  // Records the Affine/InverseAffine transformation
166  // of the envelope.
167  //------------------------------------------------
181 };
182 
183 
184 // -----------------
185 // -- Inline methods
186 // -----------------
187 
189 {
190  return fEnvelope;
191 }
192 
194 {
195  return fEnvelopeLogicalVolume;
196 }
197 
199 {
201 }
202 
204 {
205  return fEnvelopeSolid;
206 }
207 
209 {
210  return fTrack;
211 }
212 
214 {
215  return fLocalTrackPosition;
216 }
217 
219 {
220  return fLocalTrackMomentum;
221 }
222 
224 {
225  return fLocalTrackDirection;
226 }
227 
229 {
231 }
232 
234 {
235  return &fAffineTransformation;
236 }
237 
239 {
241 }
242 
244 {
245  // tests if particle are on the boundary and leaving.
246  return GetEnvelopeSolid()->
247  DistanceToOut(GetPrimaryTrackLocalPosition(),
249 }
250 
251 #endif
G4ThreeVector GetPrimaryTrackLocalPosition() const
Definition: G4FastTrack.hh:213
const G4Track * GetPrimaryTrack() const
Definition: G4FastTrack.hh:208
G4ThreeVector GetPrimaryTrackLocalDirection() const
Definition: G4FastTrack.hh:223
G4ThreeVector GetPrimaryTrackLocalPolarization() const
Definition: G4FastTrack.hh:228
CLHEP::Hep3Vector G4ThreeVector
G4bool fAffineTransformationDefined
Definition: G4FastTrack.hh:169
G4ThreeVector fLocalTrackPolarization
Definition: G4FastTrack.hh:175
const G4AffineTransform * GetInverseAffineTransformation() const
Definition: G4FastTrack.hh:238
G4bool OnTheBoundaryButExiting() const
Definition: G4FastTrack.hh:243
void FRecordsAffineTransformation(const G4Navigator *)
Definition: G4FastTrack.cc:109
G4ThreeVector fLocalTrackMomentum
Definition: G4FastTrack.hh:175
G4ThreeVector fLocalTrackPosition
Definition: G4FastTrack.hh:175
G4double a
Definition: TRTMaterials.hh:39
G4LogicalVolume * fEnvelopeLogicalVolume
Definition: G4FastTrack.hh:172
G4Envelope * fEnvelope
Definition: G4FastTrack.hh:170
G4FastTrack(G4Envelope *anEnvelope, G4bool IsUnique)
Definition: G4FastTrack.cc:51
bool G4bool
Definition: G4Types.hh:79
void SetCurrentTrack(const G4Track &, const G4Navigator *a=0)
Definition: G4FastTrack.cc:68
G4VSolid * GetEnvelopeSolid() const
Definition: G4FastTrack.hh:203
G4Region G4Envelope
Definition: G4FastTrack.hh:57
G4bool fIsUnique
Definition: G4FastTrack.hh:171
G4AffineTransform fInverseAffineTransformation
Definition: G4FastTrack.hh:179
G4ThreeVector GetPrimaryTrackLocalMomentum() const
Definition: G4FastTrack.hh:218
G4LogicalVolume * GetEnvelopeLogicalVolume() const
Definition: G4FastTrack.hh:193
G4ThreeVector fLocalTrackDirection
Definition: G4FastTrack.hh:175
const G4AffineTransform * GetAffineTransformation() const
Definition: G4FastTrack.hh:233
G4VSolid * fEnvelopeSolid
Definition: G4FastTrack.hh:174
G4VPhysicalVolume * GetEnvelopePhysicalVolume() const
Definition: G4FastTrack.hh:198
const G4Track * fTrack
Definition: G4FastTrack.hh:162
G4VPhysicalVolume * fEnvelopePhysicalVolume
Definition: G4FastTrack.hh:173
G4Envelope * GetEnvelope() const
Definition: G4FastTrack.hh:188
G4AffineTransform fAffineTransformation
Definition: G4FastTrack.hh:179