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] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/parameterisation/include/G4FastTrack.hh (Version 11.3.0) and /processes/parameterisation/include/G4FastTrack.hh (Version 8.1.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
                                                   >>  27 // $Id: G4FastTrack.hh,v 1.7 2006/06/29 21:09:18 gunter Exp $
                                                   >>  28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
 27 //                                                 29 //
                                                   >>  30 // $Id:
 28 //--------------------------------------------     31 //---------------------------------------------------------------
 29 //                                                 32 //
 30 //  G4FastTrack.hh                                 33 //  G4FastTrack.hh
 31 //                                                 34 //
 32 //  Description:                                   35 //  Description:
 33 //    Keeps the current track information and      36 //    Keeps the current track information and special features
 34 //    for Parameterised Simulation Models.         37 //    for Parameterised Simulation Models.
 35 //                                                 38 //
 36 //  History:                                       39 //  History:
 37 //    Oct 97: Verderi && MoraDeFreitas - First     40 //    Oct 97: Verderi && MoraDeFreitas - First Implementation.
 38 //                                                 41 //
 39 //--------------------------------------------     42 //---------------------------------------------------------------
 40                                                    43 
                                                   >>  44 
 41 #ifndef G4FastTrack_h                              45 #ifndef G4FastTrack_h
 42 #define G4FastTrack_h                              46 #define G4FastTrack_h
 43                                                    47 
 44 #include "G4AffineTransform.hh"                <<  48 #include "G4VSolid.hh"
 45 #include "G4LogicalVolume.hh"                      49 #include "G4LogicalVolume.hh"
 46 #include "G4Navigator.hh"                      << 
 47 #include "G4Region.hh"                             50 #include "G4Region.hh"
                                                   >>  51 #include "G4AffineTransform.hh"
 48 #include "G4Track.hh"                              52 #include "G4Track.hh"
 49 #include "G4VSolid.hh"                         <<  53 #include "G4Navigator.hh"
 50                                                    54 
 51 //---------------------------                      55 //---------------------------
 52 // For possible future needs:                      56 // For possible future needs:
 53 //---------------------------                      57 //---------------------------
 54 using G4Envelope = G4Region;                   <<  58 typedef G4Region G4Envelope;
                                                   >>  59 
 55                                                    60 
 56 //-------------------------------------------      61 //-------------------------------------------
 57 //                                                 62 //
 58 //        G4FastTrack class                        63 //        G4FastTrack class
 59 //                                                 64 //
 60 //-------------------------------------------      65 //-------------------------------------------
 61                                                    66 
 62 // Class Description:                              67 // Class Description:
 63 //  The G4FastTrack provides you access to the     68 //  The G4FastTrack provides you access to the current G4Track,
 64 // gives simple access to envelope related fea     69 // gives simple access to envelope related features (G4Region,
 65 // G4LogicalVolume, G4VSolid, G4AffineTransfor     70 // G4LogicalVolume, G4VSolid, G4AffineTransform references between
 66 // the global and the envelope local coordinat     71 // the global and the envelope local coordinates systems) and
 67 // simple access to the position, momentum exp     72 // simple access to the position, momentum expressed in the
 68 // envelope coordinate system. Using those qua     73 // envelope coordinate system. Using those quantities and the
 69 // G4VSolid methods, you can for example easil     74 // G4VSolid methods, you can for example easily check how far you
 70 // are from the envelope boundary.             <<  75 // are from the envelope boundary. 
 71 //                                                 76 //
 72                                                    77 
                                                   >>  78 
 73 class G4FastTrack                                  79 class G4FastTrack
 74 {                                                  80 {
 75   public:  // without description              <<  81 public: // without description
 76     //------------------------                 <<  82   //------------------------
 77     // Constructor/Destructor                  <<  83   // Constructor/Destructor
 78     //------------------------                 <<  84   //------------------------
 79     // Only one Constructor. By default the en <<  85   // Only one Constructor. By default the envelope can
 80     // be placed n-Times. If the user is sure  <<  86   // be placed n-Times. If the user is sure that it'll be 
 81     // placed just one time, the IsUnique flag <<  87   // placed just one time, the IsUnique flag should be set 
 82     // TRUE to avoid the G4AffineTransform re- <<  88   // TRUE to avoid the G4AffineTransform re-calculations each 
 83     // time we reach the envelope.             <<  89   // time we reach the envelope.
 84     G4FastTrack(G4Envelope* anEnvelope, G4bool <<  90   G4FastTrack(G4Envelope *anEnvelope,
 85     ~G4FastTrack() = default;                  <<  91         G4bool IsUnique);
 86                                                <<  92   ~G4FastTrack();
 87     //---------------------------------------- <<  93 
 88     // The fast simulation manager uses the Se <<  94   //------------------------------------------------------------
 89     // method to setup the current G4FastTrack <<  95   // The fast simulation manager uses the SetCurrentTrack
 90     //---------------------------------------- <<  96   // method to setup the current G4FastTrack object 
 91     void SetCurrentTrack(const G4Track&, const <<  97   //------------------------------------------------------------
 92                                                <<  98   void SetCurrentTrack(const G4Track&, const G4Navigator* a = 0);
 93     //---------------------------------------- <<  99 
 94     // The fast simulation manager uses the On << 100   //------------------------------------------------------------
 95     // method to test if the particle is leavi << 101   // The fast simulation manager uses the OnTheBoundaryButExiting
 96     //---------------------------------------- << 102   // method to test if the particle is leaving the envelope.
 97     G4bool OnTheBoundaryButExiting() const;    << 103   //------------------------------------------------------------
 98                                                << 104   G4bool OnTheBoundaryButExiting() const;
 99     //----------------------------------       << 105 
100     // Informations useful to the user :       << 106   //----------------------------------
101     // General public get functions.           << 107   // Informations useful to the user :
102     //----------------------------------       << 108   // General public get functions.
103                                                << 109   //----------------------------------
104     // Returns the current G4Track.            << 110 
105     const G4Track* GetPrimaryTrack() const;    << 111 public: // with Description
106                                                << 112 
107     // Returns the Envelope G4Region pointer.  << 113   const G4Track* GetPrimaryTrack() const;
108     G4Envelope* GetEnvelope() const;           << 114   // Returns the current G4Track.
109                                                << 115 
110     // Returns the Envelope G4LogicalVolume po << 116   G4Envelope* GetEnvelope() const;
111     G4LogicalVolume* GetEnvelopeLogicalVolume( << 117   // Returns the Envelope G4Region pointer.
112                                                << 118 
113     // Returns the Envelope G4VPhysicalVolume  << 119   G4LogicalVolume* GetEnvelopeLogicalVolume() const;
114     G4VPhysicalVolume* GetEnvelopePhysicalVolu << 120   // Returns the Envelope G4LogicalVolume pointer.
115                                                << 121 
116     // Returns the Envelope G4VSolid pointer.  << 122   G4VPhysicalVolume* GetEnvelopePhysicalVolume() const;
117     G4VSolid* GetEnvelopeSolid() const;        << 123   // Returns the Envelope G4VPhysicalVolume pointer.
118                                                << 124 
119     //-----------------------------------      << 125   G4VSolid* GetEnvelopeSolid() const;
120     // Primary track informations in the       << 126   // Returns the Envelope G4VSolid pointer.
121     // Envelope coordinate system.             << 127 
122     //-----------------------------------      << 128   //-----------------------------------
123                                                << 129   // Primary track informations in the
124     // Returns the particle position in envelo << 130   // Envelope coordinate system.
125     G4ThreeVector GetPrimaryTrackLocalPosition << 131   //-----------------------------------
126                                                << 132 
127     // Returns the particle momentum in envelo << 133   G4ThreeVector GetPrimaryTrackLocalPosition() const;
128     G4ThreeVector GetPrimaryTrackLocalMomentum << 134   // Returns the particle position in envelope coordinates.
129                                                << 135 
130     // Returns the particle direction in envel << 136   G4ThreeVector GetPrimaryTrackLocalMomentum() const;
131     G4ThreeVector GetPrimaryTrackLocalDirectio << 137   // Returns the particle momentum in envelope coordinates.
132                                                << 138 
133     // Returns the particle polarization in en << 139   G4ThreeVector GetPrimaryTrackLocalDirection() const;
134     G4ThreeVector GetPrimaryTrackLocalPolariza << 140   // Returns the particle direction in envelope coordinates.
135                                                << 141 
136     //------------------------------------     << 142   G4ThreeVector GetPrimaryTrackLocalPolarization() const;
137     // 3D transformation of the envelope:      << 143   // Returns the particle polarization in envelope coordinates.
138     //------------------------------------     << 144   
139                                                << 145   //------------------------------------
140     // Returns the envelope Global -> Local G4 << 146   // 3D transformation of the envelope:
141     const G4AffineTransform* GetAffineTransfor << 147   //------------------------------------
142                                                << 148   // Global -> Local
143     // Returns the envelope Local -> Global G4 << 149 
144     const G4AffineTransform* GetInverseAffineT << 150   const G4AffineTransform* GetAffineTransformation() const;  
145                                                << 151   // Returns the envelope Global -> Local G4AffineTransform
146   private:                                     << 152 
147     //-----------------                        << 153   // Local -> Global
148     // Private members                         << 154   const G4AffineTransform* GetInverseAffineTransformation() const; 
149     //-----------------                        << 155   // Returns the envelope Local -> Global G4AffineTransform
150     // Current G4Track pointer                 << 156 
151     const G4Track* fTrack{nullptr};            << 157   //-----------------
152                                                << 158   // Private members
153     //---------------------------------------- << 159   //-----------------
154     // Records the Affine/InverseAffine transf << 160 private:
155     // of the envelope.                        << 161 
156     //---------------------------------------- << 162   // Current G4Track pointer
157     void FRecordsAffineTransformation(const G4 << 163   const G4Track* fTrack;
158     G4bool fAffineTransformationDefined{false} << 164 
159     G4Envelope* fEnvelope;                     << 165   //------------------------------------------------
160     G4bool fIsUnique;                          << 166   // Records the Affine/InverseAffine transformation
161     G4LogicalVolume* fEnvelopeLogicalVolume{nu << 167   // of the envelope.
162     G4VPhysicalVolume* fEnvelopePhysicalVolume << 168   //------------------------------------------------
163     G4VSolid* fEnvelopeSolid{nullptr};         << 169   void FRecordsAffineTransformation(const G4Navigator*);
164     G4ThreeVector fLocalTrackPosition, fLocalT << 170   G4bool fAffineTransformationDefined;
165       fLocalTrackPolarization;                 << 171   G4Envelope* fEnvelope;
166     G4AffineTransform fAffineTransformation, f << 172   G4bool fIsUnique;
                                                   >> 173   G4LogicalVolume* fEnvelopeLogicalVolume;
                                                   >> 174   G4VPhysicalVolume* fEnvelopePhysicalVolume;
                                                   >> 175   G4VSolid* fEnvelopeSolid;
                                                   >> 176   G4ThreeVector fLocalTrackPosition, fLocalTrackMomentum, 
                                                   >> 177     fLocalTrackDirection, fLocalTrackPolarization;
                                                   >> 178   G4AffineTransform fAffineTransformation, fInverseAffineTransformation;
167 };                                                179 };
168                                                   180 
169 // -----------------                           << 181 //*******************************************************************
170 // -- Inline methods                           << 182 //
171 // -----------------                           << 183 //  Inline functions
                                                   >> 184 //
                                                   >> 185 //*******************************************************************
172                                                   186 
173 inline G4Envelope* G4FastTrack::GetEnvelope()     187 inline G4Envelope* G4FastTrack::GetEnvelope() const
174 {                                                 188 {
175   return fEnvelope;                               189   return fEnvelope;
176 }                                                 190 }
177                                                   191 
178 inline G4LogicalVolume* G4FastTrack::GetEnvelo    192 inline G4LogicalVolume* G4FastTrack::GetEnvelopeLogicalVolume() const
179 {                                                 193 {
180   return fEnvelopeLogicalVolume;                  194   return fEnvelopeLogicalVolume;
181 }                                                 195 }
182                                                   196 
183 inline G4VPhysicalVolume* G4FastTrack::GetEnve    197 inline G4VPhysicalVolume* G4FastTrack::GetEnvelopePhysicalVolume() const
184 {                                                 198 {
185   return fEnvelopePhysicalVolume;                 199   return fEnvelopePhysicalVolume;
186 }                                                 200 }
187                                                   201 
188 inline G4VSolid* G4FastTrack::GetEnvelopeSolid    202 inline G4VSolid* G4FastTrack::GetEnvelopeSolid() const
189 {                                                 203 {
190   return fEnvelopeSolid;                          204   return fEnvelopeSolid;
191 }                                                 205 }
192                                                   206 
193 inline const G4Track* G4FastTrack::GetPrimaryT    207 inline const G4Track* G4FastTrack::GetPrimaryTrack() const
194 {                                                 208 {
195   return fTrack;                                  209   return fTrack;
196 }                                                 210 }
197                                                   211 
198 inline G4ThreeVector G4FastTrack::GetPrimaryTr    212 inline G4ThreeVector G4FastTrack::GetPrimaryTrackLocalPosition() const
199 {                                                 213 {
200   return fLocalTrackPosition;                     214   return fLocalTrackPosition;
201 }                                                 215 }
202                                                   216 
203 inline G4ThreeVector G4FastTrack::GetPrimaryTr    217 inline G4ThreeVector G4FastTrack::GetPrimaryTrackLocalMomentum() const
204 {                                                 218 {
205   return fLocalTrackMomentum;                     219   return fLocalTrackMomentum;
206 }                                                 220 }
207                                                   221 
208 inline G4ThreeVector G4FastTrack::GetPrimaryTr    222 inline G4ThreeVector G4FastTrack::GetPrimaryTrackLocalDirection() const
209 {                                                 223 {
210   return fLocalTrackDirection;                    224   return fLocalTrackDirection;
211 }                                                 225 }
212                                                   226 
213 inline G4ThreeVector G4FastTrack::GetPrimaryTr    227 inline G4ThreeVector G4FastTrack::GetPrimaryTrackLocalPolarization() const
214 {                                                 228 {
215   return fLocalTrackPolarization;                 229   return fLocalTrackPolarization;
216 }                                                 230 }
217                                                   231 
218 inline const G4AffineTransform* G4FastTrack::G    232 inline const G4AffineTransform* G4FastTrack::GetAffineTransformation() const
219 {                                                 233 {
220   return &fAffineTransformation;                  234   return &fAffineTransformation;
221 }                                                 235 }
222                                                   236 
223 inline const G4AffineTransform* G4FastTrack::G    237 inline const G4AffineTransform* G4FastTrack::GetInverseAffineTransformation() const
224 {                                                 238 {
225   return &fInverseAffineTransformation;           239   return &fInverseAffineTransformation;
226 }                                                 240 }
227                                                   241 
228 inline G4bool G4FastTrack::OnTheBoundaryButExi << 242 inline G4bool G4FastTrack::OnTheBoundaryButExiting() const 
229 {                                                 243 {
230   // tests if particle are on the boundary and    244   // tests if particle are on the boundary and leaving.
231   return GetEnvelopeSolid()->DistanceToOut(Get << 245   return GetEnvelopeSolid()->
232                                            Get << 246     DistanceToOut(GetPrimaryTrackLocalPosition(),
233          == 0.;                                << 247       GetPrimaryTrackLocalDirection())==0.;
234 }                                                 248 }
235                                                   249 
236 #endif                                            250 #endif
237                                                   251