G4ITTransportation.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id: G4ITTransportation.hh 64374 2012-10-31 16:37:23Z gcosmo $
00027 //
00031 //
00032 // Original Author : John Apostolakis
00033 //
00034 // Contact : Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
00035 //
00036 // WARNING : This class is released as a prototype.
00037 // It might strongly evolve or even disapear in the next releases.
00038 //
00039 // -------------------------------------------------------------------
00040 
00041 #ifndef G4ITTransportation_H
00042 #define G4ITTransportation_H
00043 
00044 #include <CLHEP/Units/SystemOfUnits.h>
00045 
00046 #include "G4IT.hh"
00047 #include "G4VITProcess.hh"
00048 #include "G4Track.hh"
00049 #include "G4Step.hh"
00050 #include "G4ParticleChangeForTransport.hh"
00051 
00052 class G4ITNavigator;
00053 //class G4Navigator;
00054 class G4SafetyHelper;
00055 class G4PropagatorInField;
00056 
00057 class G4ITTransportation : public G4VITProcess
00058 {
00059     // Concrete class that does the geometrical transport
00060 public:  // with description
00061 
00062     G4ITTransportation(const G4String& aName =  "ITTransportation",G4int verbosityLevel= 1);
00063     virtual ~G4ITTransportation();
00064 
00065     G4ITTransportation(const G4ITTransportation&);
00066 
00067     G4IT_ADD_CLONE(G4VITProcess, G4ITTransportation)
00068 
00069     virtual void BuildPhysicsTable(const G4ParticleDefinition&){;}
00070 
00071     virtual void ComputeStep(const G4Track&,
00072                              const G4Step&,
00073                              const double timeStep,
00074                              double& spaceStep) ;
00075 
00076     virtual void StartTracking(G4Track* aTrack);
00077     // Give to the track a pointer to the transportation state
00078 
00079 //________________________________________________________
00080 public:  // without description
00081 
00082     virtual G4double AtRestGetPhysicalInteractionLength(
00083         const G4Track& ,
00084         G4ForceCondition*
00085     )
00086     {
00087         return -1.0;
00088     }
00089     // No operation in  AtRestDoIt.
00090 
00091     virtual G4VParticleChange* AtRestDoIt(
00092         const G4Track& ,
00093         const G4Step&
00094     )
00095     {
00096         return 0;
00097     }
00098     // No operation in  AtRestDoIt.
00099 
00100     virtual G4double AlongStepGetPhysicalInteractionLength(
00101         const G4Track& track,
00102         G4double , //   previousStepSize
00103         G4double currentMinimumStep,
00104         G4double& currentSafety,
00105         G4GPILSelection* selection);
00106 
00107     virtual G4double PostStepGetPhysicalInteractionLength(
00108         const G4Track&  , // track
00109         G4double , // previousStepSize
00110         G4ForceCondition* pForceCond);
00111 
00112     virtual G4VParticleChange* AlongStepDoIt( const G4Track& track,
00113         const G4Step&  stepData );
00114 
00115     virtual G4VParticleChange* PostStepDoIt( const G4Track& track,
00116         const G4Step& ) ;
00117 
00118 //________________________________________________________
00119 //    inline virtual G4double GetTransportationTime() ;
00120 
00121     G4PropagatorInField* GetPropagatorInField();
00122     void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
00123     // Access/set the assistant class that Propagate in a Field.
00124 
00125     inline void   SetVerboseLevel( G4int verboseLevel );
00126     inline G4int  GetVerboseLevel() const;
00127     // Level of warnings regarding eg energy conservation
00128     // in field integration.
00129 
00130     inline G4double GetThresholdWarningEnergy() const;
00131     inline G4double GetThresholdImportantEnergy() const;
00132     inline G4int GetThresholdTrials() const;
00133 
00134     inline void SetThresholdWarningEnergy( G4double newEnWarn );
00135     inline void SetThresholdImportantEnergy( G4double newEnImp );
00136     inline void SetThresholdTrials(G4int newMaxTrials );
00137 
00138     // Get/Set parameters for killing loopers:
00139     //   Above 'important' energy a 'looping' particle in field will
00140     //   *NOT* be abandoned, except after fThresholdTrials attempts.
00141     // Below Warning energy, no verbosity for looping particles is issued
00142 
00143     inline G4double GetMaxEnergyKilled() const;
00144     inline G4double GetSumEnergyKilled() const;
00145     inline void ResetKilledStatistics( G4int report = 1);
00146     // Statistics for tracks killed (currently due to looping in field)
00147 
00148     inline void EnableShortStepOptimisation(G4bool optimise=true);
00149     // Whether short steps < safety will avoid to call Navigator (if field=0)
00150 
00151 protected :
00152     //________________________________________________________________
00153     // Protected methods
00154     G4bool               DoesGlobalFieldExist();
00155     // Checks whether a field exists for the "global" field manager.
00156 
00157     //________________________________________________________________
00158     // Process information
00159     struct G4ITTransportationState : public G4ProcessState
00160     {
00161     public :
00162         G4ITTransportationState();
00163         virtual ~G4ITTransportationState();
00164 
00165         G4ThreeVector        fTransportEndPosition;
00166         G4ThreeVector        fTransportEndMomentumDir;
00167         G4double             fTransportEndKineticEnergy;
00168         G4ThreeVector        fTransportEndSpin;
00169         G4bool               fMomentumChanged;
00170         G4bool               fEnergyChanged;
00171         G4bool               fEndGlobalTimeComputed;
00172         G4double             fCandidateEndGlobalTime;
00173         G4bool               fParticleIsLooping;
00174         // The particle's state after this Step, Store for DoIt
00175 
00176         G4TouchableHandle    fCurrentTouchableHandle;
00177         G4bool fGeometryLimitedStep;
00178         // Flag to determine whether a boundary was reached.
00179 
00180         G4ThreeVector  fPreviousSftOrigin;
00181         G4double       fPreviousSafety;
00182         // Remember last safety origin & value.
00183 
00184         // Counter for steps in which particle reports 'looping',
00185         //   if it is above 'Important' Energy
00186         G4int    fNoLooperTrials;
00187 
00188         // G4bool         fFieldExists;
00189         // Whether a magnetic field exists ...
00190         // A data member for this is problematic: it is useful only if it
00191         // can be initialised and updated -- and a scheme is not yet possible.
00192 
00193         G4double endpointDistance;
00194     };
00195 
00196     G4ITTransportationState* const & fTransportationState;
00197 
00198     //________________________________________________________________
00199     // Informations relative to the process only (meaning no information
00200     // relative to the treated particle)
00201     G4ITNavigator*         fLinearNavigator;
00202     G4PropagatorInField* fFieldPropagator;
00203     // The Propagators used to transport the particle
00204 
00205 //    static const G4TouchableHandle nullTouchableHandle;  // Points to (G4VTouchable*) 0
00206 
00207     G4ParticleChangeForTransport fParticleChange;
00208     // New ParticleChange
00209 
00210     // Thresholds for looping particles:
00211     //
00212     G4double fThreshold_Warning_Energy;     //  Warn above this energy
00213     G4double fThreshold_Important_Energy;   //  Hesitate above this
00214     G4int    fThresholdTrials;              //    for this no of trials
00215     // Above 'important' energy a 'looping' particle in field will
00216     //   *NOT* be abandoned, except after fThresholdTrials attempts.
00217     G4double fUnimportant_Energy;
00218     //  Below this energy, no verbosity for looping particles is issued
00219 
00220 
00221     // Statistics for tracks abandoned
00222     G4double fSumEnergyKilled;
00223     G4double fMaxEnergyKilled;
00224 
00225     // Whether to avoid calling G4Navigator for short step ( < safety)
00226     //   If using it, the safety estimate for endpoint will likely be smaller.
00227     G4bool   fShortStepOptimisation;
00228 
00229     G4SafetyHelper* fpSafetyHelper;  // To pass it the safety value obtained
00230 
00231     // Verbosity
00232     G4int    fVerboseLevel;
00233     // Verbosity level for warnings
00234     // eg about energy non-conservation in magnetic field.
00235 
00236     void SetInstantiateProcessState(G4bool flag)
00237     { fInstantiateProcessState = flag; }
00238 
00239     G4bool InstantiateProcessState() { return fInstantiateProcessState; }
00240 
00241 private :
00242     G4bool fInstantiateProcessState;
00243     G4ITTransportation& operator=(const G4ITTransportation&);
00244 };
00245 
00246 #include "G4ITTransportation.icc"
00247 #endif // G4ITTransportation_H

Generated on Mon May 27 17:48:42 2013 for Geant4 by  doxygen 1.4.7