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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/transportation/include/G4Transportation.hh (Version 11.3.0) and /processes/transportation/include/G4Transportation.hh (Version 3.1)


                                                   >>   1 // This code implementation is the intellectual property of
                                                   >>   2 // the GEANT4 collaboration.
  1 //                                                  3 //
  2 // ******************************************* <<   4 // By copying, distributing or modifying the Program (or any work
  3 // * License and Disclaimer                    <<   5 // based on the Program) you indicate your acceptance of this statement,
  4 // *                                           <<   6 // and all its terms.
  5 // * The  Geant4 software  is  copyright of th << 
  6 // * the Geant4 Collaboration.  It is provided << 
  7 // * conditions of the Geant4 Software License << 
  8 // * LICENSE and available at  http://cern.ch/ << 
  9 // * include a list of copyright holders.      << 
 10 // *                                           << 
 11 // * Neither the authors of this software syst << 
 12 // * institutes,nor the agencies providing fin << 
 13 // * work  make  any representation or  warran << 
 14 // * regarding  this  software system or assum << 
 15 // * use.  Please see the license in the file  << 
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                           << 
 18 // * This  code  implementation is the result  << 
 19 // * technical work of the GEANT4 collaboratio << 
 20 // * By using,  copying,  modifying or  distri << 
 21 // * any work based  on the software)  you  ag << 
 22 // * use  in  resulting  scientific  publicati << 
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // ******************************************* << 
 25 //                                             << 
 26 //                                                  7 //
                                                   >>   8 // $Id: G4Transportation.hh,v 1.2 1999/12/15 14:53:49 gunter Exp $
                                                   >>   9 // GEANT4 tag $Name: geant4-03-01 $
 27 //                                                 10 //
 28 //                                                 11 // 
 29 // -------------------------------------------     12 // ------------------------------------------------------------
 30 //        GEANT 4  include file implementation <<  13 //  GEANT 4  include file implementation
 31 // ------------------------------------------- << 
 32 //                                                 14 //
 33 // Class description:                          <<  15 //  For information related to this code contact:
                                                   >>  16 //  CERN, IT Division (formely CN), ASD group
                                                   >>  17 // ------------------------------------------------------------
 34 //                                                 18 //
 35 // G4Transportation is a process responsible f <<  19 //   This class' object is a process responsible for the transportation of 
 36 // a particle, i.e. the geometrical propagatio <<  20 // a particle, ie the geometrical propagation that encounters the 
 37 // geometrical sub-volumes of the detectors.       21 // geometrical sub-volumes of the detectors.
 38 // It is also tasked with part of updating the <<  22 //
 39                                                <<  23 //   It is also tasked with part of updating the "safety".
                                                   >>  24 //
 40 // ===========================================     25 // =======================================================================
 41 // Created:  19 March 1997, J. Apostolakis         26 // Created:  19 March 1997, J. Apostolakis
 42 // ===========================================     27 // =======================================================================
 43 #ifndef G4Transportation_hh                        28 #ifndef G4Transportation_hh
 44 #define G4Transportation_hh 1                      29 #define G4Transportation_hh 1
 45                                                    30 
 46 #include "G4VProcess.hh"                           31 #include "G4VProcess.hh"
                                                   >>  32 #include "G4FieldManager.hh"
 47                                                    33 
                                                   >>  34 #include "G4Navigator.hh"
                                                   >>  35 #include "G4TransportationManager.hh"
                                                   >>  36 #include "G4PropagatorInField.hh"
 48 #include "G4Track.hh"                              37 #include "G4Track.hh"
 49 #include "G4Step.hh"                               38 #include "G4Step.hh"
 50 #include "G4ParticleChangeForTransport.hh"         39 #include "G4ParticleChangeForTransport.hh"
 51                                                    40 
 52 class G4Navigator;                             << 
 53 class G4PropagatorInField;                     << 
 54 class G4SafetyHelper;                          << 
 55 class G4TransportationLogger;                  << 
 56                                                << 
 57 class G4Transportation : public G4VProcess         41 class G4Transportation : public G4VProcess 
 58 {                                                  42 {
 59   // Concrete class that does the geometrical      43   // Concrete class that does the geometrical transport 
 60                                                    44 
 61   public:  // with description                 <<  45   public:
 62                                                <<  46      G4Transportation();
 63      G4Transportation( G4int verbosityLevel= 1 << 
 64      ~G4Transportation();                          47      ~G4Transportation(); 
 65                                                    48 
                                                   >>  49      //  G4double          GetContinuousStepLimit  (
 66      G4double      AlongStepGetPhysicalInterac     50      G4double      AlongStepGetPhysicalInteractionLength(
 67                              const G4Track& tr     51                              const G4Track& track,
 68                                    G4double  p <<  52            G4double  previousStepSize,
 69                                    G4double  c <<  53                  G4double  currentMinimumStep, 
 70                                    G4double& c <<  54            G4double& currentSafety,
 71                                    G4GPILSelec <<  55            G4GPILSelection* selection
 72                             ); // override;    <<  56           );
 73                                                    57 
 74      G4VParticleChange* AlongStepDoIt(             58      G4VParticleChange* AlongStepDoIt(
 75                              const G4Track& tr <<  59            const G4Track& track,
 76                              const G4Step& ste <<  60            const G4Step& stepData
 77                             ); // override;    <<  61           );
 78                                                    62 
                                                   >>  63      // This only does the relocation
                                                   >>  64      // 
 79      G4VParticleChange* PostStepDoIt(              65      G4VParticleChange* PostStepDoIt(
 80                              const G4Track& tr <<  66            const G4Track& track,
 81                              const G4Step&  st <<  67            const G4Step&  stepData
 82                             ); // override;    <<  68           );
 83        // Responsible for the relocation       << 
 84                                                    69 
                                                   >>  70      // This forces the PostStepDoIt action to be called, 
                                                   >>  71      //   but does not limit the step.
                                                   >>  72      //
 85      G4double PostStepGetPhysicalInteractionLe     73      G4double PostStepGetPhysicalInteractionLength(
 86                              const G4Track& ,      74                              const G4Track& ,
 87                              G4double   previo <<  75            G4double   previousStepSize,
 88                              G4ForceCondition* <<  76            G4ForceCondition* pForceCond
 89                             ); // override;    <<  77           );
 90        // Forces the PostStepDoIt action to be << 
 91        // but does not limit the step          << 
 92                                                    78 
 93      inline G4bool FieldExertedForce() { retur <<  79      //  Access/set the assistant class that Propagate in a Field
 94                                                << 
 95      G4PropagatorInField* GetPropagatorInField     80      G4PropagatorInField* GetPropagatorInField();
 96      void SetPropagatorInField( G4PropagatorIn     81      void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
 97        // Access/set the assistant class that  << 
 98                                                << 
 99      inline G4double GetThresholdWarningEnergy << 
100      inline G4double GetThresholdImportantEner << 
101      inline G4int GetThresholdTrials() const;  << 
102                                                << 
103      inline void SetThresholdWarningEnergy( G4 << 
104      inline void SetThresholdImportantEnergy(  << 
105      inline void SetThresholdTrials(G4int newM << 
106      // Get/Set parameters for killing loopers << 
107      //   Above 'important' energy a 'looping' << 
108      //   *NOT* be abandoned, except after fTh << 
109      // Below Warning energy, no verbosity for << 
110                                                << 
111      void SetHighLooperThresholds(); // Shortc << 
112      void SetLowLooperThresholds(); // Set low << 
113      void PushThresholdsToLogger(); // Inform  << 
114      void ReportLooperThresholds(); // Print v << 
115                                                << 
116      inline G4double GetMaxEnergyKilled() cons << 
117      inline G4double GetSumEnergyKilled() cons << 
118      inline void ResetKilledStatistics( G4int  << 
119      // Statistics for tracks killed (currentl << 
120                                                << 
121      inline void EnableShortStepOptimisation(G << 
122      // Whether short steps < safety will avoi << 
123                                                << 
124      static G4bool EnableMagneticMoment(G4bool << 
125      // Whether to enable particles to be defl << 
126                                                << 
127      static G4bool EnableGravity(G4bool useGra << 
128      // Whether to enable particles to be defl << 
129                                                << 
130      static void   SetSilenceLooperWarnings( G << 
131      // Do not warn (or throw exception) about << 
132      static G4bool GetSilenceLooperWarnings(); << 
133                                                << 
134   public: // without description               << 
135      static G4bool EnableUseMagneticMoment(G4b << 
136      { return EnableMagneticMoment(useMoment); << 
137                                                << 
138   public:  // without description              << 
139                                                << 
140      G4double AtRestGetPhysicalInteractionLeng << 
141                                                << 
142        { return -1.0; }  // No operation in At << 
143                                                << 
144      G4VParticleChange* AtRestDoIt( const G4Tr << 
145        { return 0; }     // No operation in At << 
146                                                << 
147      void StartTracking(G4Track* aTrack);      << 
148        // Reset state for new (potentially res << 
149                                                << 
150      virtual void ProcessDescription(std::ostr << 
151      void PrintStatistics( std::ostream& outSt << 
152                                                << 
153   protected:                                   << 
154                                                    82 
155      void SetTouchableInformation(const G4Touc <<  83      //  no operation in  AtRestDoIt
                                                   >>  84      G4double AtRestGetPhysicalInteractionLength(
                                                   >>  85                              const G4Track& ,
                                                   >>  86            G4ForceCondition* 
                                                   >>  87           ) { return -1.0; };
156                                                    88 
157      void ReportMissingLogger(const char * met <<  89      //  no operation in  AtRestDoIt
158                                                <<  90      G4VParticleChange* AtRestDoIt(
                                                   >>  91            const G4Track& ,
                                                   >>  92            const G4Step&
                                                   >>  93           ) {return NULL;};
159   protected:                                       94   protected:
                                                   >>  95      //  Checks whether a field exists for the "global" field manager.
                                                   >>  96      G4bool               DoesGlobalFieldExist();
160                                                    97 
161      G4Navigator* fLinearNavigator;            <<  98   private:
162        // The navigator for the 'mass' geometr <<  99      // Needed to add the Relocation in the PostStepDoIt
163        // (the real one, that physics occurs i << 100      //                                         Copied from SteppingManager
                                                   >> 101      G4VTouchable* GetFreeTouchable();
                                                   >> 102         // Get Touchable which is free, i.e. not assigined to Track/StepPoint
                                                   >> 103         // If no free touchable is availabe, the NULL will be returned
                                                   >> 104         // Once you get a Touchable, it will be set to NotFree. 
                                                   >> 105      void SetTheOtherTouchableFree(G4VTouchable* pTouch);
                                                   >> 106         // Set the partner of the given Touchable to be free. For example,
                                                   >> 107         // the argument has fTouchable1, then fTouchable2 will be set to 
                                                   >> 108 
                                                   >> 109   private:
                                                   >> 110      // The Propagators used to transport the particle
                                                   >> 111      G4Navigator*         fLinearNavigator;
164      G4PropagatorInField* fFieldPropagator;       112      G4PropagatorInField* fFieldPropagator;
165        // The Propagators used to transport th << 
166                                                   113 
167      G4ThreeVector fTransportEndPosition=      << 114      // Field Manager for the whole Detector
168      G4ThreeVector fTransportEndMomentumDir=   << 115      // G4FieldManager*      fGlobalFieldMgr;     // Used MagneticField CC
169      G4double      fTransportEndKineticEnergy= << 116 
170      G4ThreeVector fTransportEndSpin=  G4Three << 117      // The particle's state after this Step, Store for DoIt
171      G4bool        fMomentumChanged=   true;   << 118      G4ThreeVector        fTransportEndPosition;
172      G4bool        fEndGlobalTimeComputed= fal << 119      G4ThreeVector        fTransportEndMomentumDir;
173      G4double      fCandidateEndGlobalTime= 0. << 120      G4double             fTransportEndKineticEnergy;
174        // The particle's state after this Step << 121      G4ThreeVector        fTransportEndSpin;
175                                                << 122      G4bool               fMomentumChanged;
176      G4bool        fAnyFieldExists= false;     << 123      G4bool               fEnergyChanged;
177                                                << 
178      G4bool fParticleIsLooping = false;        << 
179      G4bool fNewTrack= true;          // Flag  << 
180      G4bool fFirstStepInVolume= true;          << 
181      G4bool fLastStepInVolume= false;  // Last << 
182                                 // (temporary  << 
183      G4bool fGeometryLimitedStep= true;        << 
184        // Flag to determine whether a boundary << 
185                                                   124 
186      G4bool fFieldExertedForce= false; // Duri << 125      G4bool               fParticleIsLooping;
187                                                   126 
188      G4TouchableHandle fCurrentTouchableHandle << 127      G4VTouchable*        fCurrentTouchable;
189                                                   128      
190      G4ThreeVector fPreviousSftOrigin;         << 129      // Whether a magnetic field exists ...
191      G4double      fPreviousSafety;            << 130      // G4bool         fFieldExists;
192        // Remember last safety origin & value. << 131      //   The above data member is problematic: it is useful only if
                                                   >> 132      // it is initialised.  However the transportation process(es) are not
                                                   >> 133      // capable of doing this initialisation itself (themselves) and there
                                                   >> 134      // seems no alternative agent capable of doing it right now.
                                                   >> 135      // Eg, at construction time it is likely that the field manager has
                                                   >> 136      // not yet been informed about the detector's field 
                                                   >> 137      // I cannot foresee how the transportation can be informed later. JA 
                                                   >> 138      //   The current answer is to ignore this data member and use 
                                                   >> 139      // the member function DoesGlobalFieldExist() in its place ...
                                                   >> 140      //    John Apostolakis, July 7, 1997
                                                   >> 141 
                                                   >> 142      // Needed for the relocation - Copied from SteppingManager
                                                   >> 143      G4VTouchable* fTouchable1;
                                                   >> 144      G4VTouchable* fTouchable2;
                                                   >> 145      G4bool fIsTouchable1Free;
                                                   >> 146      G4bool fIsTouchable2Free;
                                                   >> 147 
                                                   >> 148      // Flag to determine whether a boundary was reached.
                                                   >> 149      G4bool fGeometryLimitedStep;
                                                   >> 150 
                                                   >> 151      // Remember last safety origin & value.
                                                   >> 152      G4ThreeVector  fPreviousSftOrigin;
                                                   >> 153      G4double       fPreviousSafety; 
193                                                   154 
                                                   >> 155      // New ParticleChange
194      G4ParticleChangeForTransport fParticleCha    156      G4ParticleChangeForTransport fParticleChange;
195        // New ParticleChange                   << 
196                                                   157 
197      G4double fEndPointDistance;               << 158      G4double endpointDistance;
198                                                << 
199      // Thresholds for looping particles:      << 
200      //                                        << 
201      G4double fThreshold_Warning_Energy =   1. << 
202      G4double fThreshold_Important_Energy = 1. << 
203      G4int    fThresholdTrials = 10;       //  << 
204        // Above 'important' energy a 'looping' << 
205        // *NOT* be abandoned, except after fTh << 
206      G4int    fAbandonUnstableTrials = 0;  //  << 
207                                            //  << 
208      // Counter for steps in which particle re << 
209      //  ( Used if it is above 'Important' Ene << 
210      G4int    fNoLooperTrials= 0;              << 
211                                                << 
212      // Statistics for tracks abandoned due to << 
213      //                                        << 
214      G4double fSumEnergyKilled= 0.0;           << 
215      G4double fSumEnerSqKilled= 0.0;           << 
216      G4double fMaxEnergyKilled= -1.0;          << 
217      G4int    fMaxEnergyKilledPDG= 0;          << 
218      unsigned long fNumLoopersKilled= 0;       << 
219      G4double fSumEnergyKilled_NonElectron= 0. << 
220      G4double fSumEnerSqKilled_NonElectron= 0. << 
221      G4double fMaxEnergyKilled_NonElectron= -1 << 
222      G4int    fMaxEnergyKilled_NonElecPDG= 0;  << 
223      unsigned long fNumLoopersKilled_NonElectr << 
224      G4double fSumEnergySaved=  0.0;           << 
225      G4double fMaxEnergySaved= -1.0;           << 
226      G4double fSumEnergyUnstableSaved = 0.0;   << 
227      // Whether to avoid calling G4Navigator f << 
228      // If using it, the safety estimate for e << 
229      //                                        << 
230      G4bool   fShortStepOptimisation;          << 
231                                                << 
232      G4SafetyHelper* fpSafetyHelper;    // To  << 
233      G4TransportationLogger* fpLogger;  // Rep << 
234                                                << 
235   protected:                                   << 
236                                                << 
237      static G4bool fUseMagneticMoment;         << 
238      static G4bool fUseGravity;                << 
239      static G4bool fSilenceLooperWarnings;  // << 
240                                                << 
241 };                                                159 };
242                                                   160 
                                                   >> 161 
243 #include "G4Transportation.icc"                   162 #include "G4Transportation.icc"
244                                                   163 
245 #endif                                            164 #endif  
                                                   >> 165 
                                                   >> 166 // End of G4Transportation.hh
246                                                   167