G4VEnergyLoss.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 //
00027 // $Id$
00028 //
00029 //
00030 // ------------------------------------------------------------
00031 // 26.10.01 static inline functions moved to .cc file (mma)
00032 // 08.11.01 some static methods,data members are not static L.Urban
00033 // 15.01.03 Migrade to cut per region (V.Ivanchenko)
00034 // ------------------------------------------------------------
00035 //
00036 // Class Description
00037 //
00038 //  General service class for the energy loss classes
00039 //
00040 //  It contains code needed to compute the range tables,
00041 //  time tables, the inverse range tables and some auxiliary
00042 //  tables.
00043 //  The energy loss fluctuation code is here,too.
00044 //
00045 //  All the EnergyLoss classes are inherited from G4VEnergyLoss
00046 //  class.
00047 //
00048 
00049 //  -----------------------------------------------------------
00050 //  created  on 28 January 2000  by L. Urban
00051 //  -----------------------------------------------------------
00052 
00053 #ifndef G4VEnergyLoss_h
00054 #define G4VEnergyLoss_h 1
00055 
00056 #include "globals.hh"
00057 #include "G4ios.hh"
00058 #include "Randomize.hh"
00059 #include "G4Poisson.hh"
00060 #include "G4Electron.hh"
00061 #include "G4VContinuousDiscreteProcess.hh"
00062 #include "G4PhysicsLogVector.hh"
00063 #include "G4PhysicsLinearVector.hh"
00064 #include "G4MaterialCutsCouple.hh"
00065 
00066 class G4EnergyLossMessenger;
00067 
00068 class G4VEnergyLoss : public G4VContinuousDiscreteProcess
00069 {
00070   public:
00071 
00072       G4VEnergyLoss(const G4String&,G4ProcessType   aType = fNotDefined );
00073 
00074       virtual ~G4VEnergyLoss();
00075 
00076       virtual G4double GetContinuousStepLimit(const G4Track& track,
00077                                     G4double previousStepSize,
00078                                     G4double currentMinimumStep,
00079                                     G4double& currentSafety) = 0 ;
00080 
00081       virtual G4VParticleChange* AlongStepDoIt(const G4Track& track,
00082                                      const G4Step& Step) = 0 ;
00083 
00084       virtual G4double GetMeanFreePath(const G4Track& track,
00085                                      G4double previousStepSize,
00086                                      G4ForceCondition* condition) = 0;
00087 
00088       virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
00089                                             const G4Step& Step) = 0;
00090 
00091 
00092 
00093   protected:// with description
00094 
00095     // code for the energy loss fluctuation
00096 
00097     G4double GetLossWithFluct(const G4DynamicParticle* aParticle,
00098                               const G4MaterialCutsCouple* couple,
00099                               G4double ChargeSquare,
00100                               G4double   MeanLoss,
00101                               G4double step);
00102 
00103     // Build range table starting from the DEDXtable
00104     G4PhysicsTable*
00105     BuildRangeTable(G4PhysicsTable* theDEDXTable,
00106                     G4PhysicsTable* theRangeTable,
00107                     G4double Tmin,G4double Tmax,G4int nbin);
00108 
00109     // Build time tables starting from the DEDXtable
00110     G4PhysicsTable*
00111     BuildLabTimeTable(G4PhysicsTable* theDEDXTable,
00112                       G4PhysicsTable* theLabTimeTable,
00113                       G4double Tmin,G4double Tmax,G4int nbin);
00114 
00115     G4PhysicsTable*
00116     BuildProperTimeTable(G4PhysicsTable* theDEDXTable,
00117                       G4PhysicsTable* ProperTimeTable,
00118                       G4double Tmin,G4double Tmax,G4int nbin);
00119 
00120     // Build tables of coefficients needed for inverting the range table
00121     G4PhysicsTable*
00122     BuildRangeCoeffATable(G4PhysicsTable* theRangeTable,
00123                           G4PhysicsTable* theCoeffATable,
00124                           G4double Tmin,G4double Tmax,G4int nbin);
00125     G4PhysicsTable*
00126     BuildRangeCoeffBTable(G4PhysicsTable* theRangeTable,
00127                           G4PhysicsTable* theCoeffBTable,
00128                           G4double Tmin,G4double Tmax,G4int nbin);
00129     G4PhysicsTable*
00130     BuildRangeCoeffCTable(G4PhysicsTable* theRangeTable,
00131                           G4PhysicsTable* theCoeffCTable,
00132                           G4double Tmin,G4double Tmax,G4int nbin);
00133 
00134     // Invert range table
00135     G4PhysicsTable*
00136     BuildInverseRangeTable(G4PhysicsTable* theRangeTable,
00137                            G4PhysicsTable* theRangeCoeffATable,
00138                            G4PhysicsTable* theRangeCoeffBTable,
00139                            G4PhysicsTable* theRangeCoeffCTable,
00140                            G4PhysicsTable* theInverseRangeTable,
00141                            G4double Tmin,G4double Tmax,G4int nbin);
00142 
00143    private:
00144 
00145       void BuildRangeVector(G4PhysicsTable* theDEDXTable,
00146                      G4double Tmin,G4double Tmax,G4int nbin,
00147                      G4int materialIndex,G4PhysicsLogVector* rangeVector);
00148 
00149       G4double RangeIntLin(G4PhysicsVector* physicsVector,G4int nbin);
00150 
00151       G4double RangeIntLog(G4PhysicsVector* physicsVector,G4int nbin);
00152 
00153       void BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
00154                      G4double Tmin,G4double Tmax,G4int nbin,
00155                      G4int materialIndex,G4PhysicsLogVector* rangeVector);
00156 
00157       void BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
00158                      G4double Tmin,G4double Tmax,G4int nbin,
00159                      G4int materialIndex,G4PhysicsLogVector* rangeVector);
00160 
00161       G4double LabTimeIntLog(G4PhysicsVector* physicsVector,G4int nbin);
00162 
00163       G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,G4int nbin);
00164 
00165       void InvertRangeVector(G4PhysicsTable* theRangeTable,
00166                              G4PhysicsTable* theRangeCoeffATable,
00167                              G4PhysicsTable* theRangeCoeffBTable,
00168                              G4PhysicsTable* theRangeCoeffCTable,
00169                              G4double Tmin,G4double Tmax,G4int nbin,
00170                        G4int materialIndex,G4PhysicsLogVector* rangeVector);
00171 
00172 
00173   protected:
00174 
00175     G4double ParticleMass;
00176 
00177   private:
00178 
00179     // data members to speed up the fluctuation calculation
00180     const G4Material* lastMaterial;
00181     G4int imat;
00182     G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
00183     G4double e1LogFluct,e2LogFluct,ipotLogFluct;
00184 
00185     const G4int nmaxCont1,nmaxCont2 ;
00186 
00187     // for some integration routines
00188     G4double taulow,tauhigh,ltaulow,ltauhigh;
00189 
00190   // static part of the class
00191 
00192   public:  // With description
00193 
00194     static void SetRndmStep(G4bool value);
00195     // use / do not use randomisation in energy loss steplimit
00196     // ( default = no randomisation)
00197 
00198     static void SetEnlossFluc(G4bool value);
00199     // compute energy loss with/without fluctuation
00200     // ( default : with fluctuation)
00201 
00202     static void SetSubSec(G4bool value);
00203     // switch on/off the generation of the subcutoff secondaries
00204     // ( default = no subcutoff secondary generation )
00205 
00206     static void SetMinDeltaCutInRange(G4double value);
00207     // sets minimal cut value for the subcutoff secondaries
00208     // (i.e. the kinetic energy of these secondaries can not be
00209     //  smaller than the energy corresponds to MinDeltaCutInRange).
00210 
00211 
00212     static void SetStepFunction (G4double c1, G4double c2);
00213     // sets values for data members used to compute the step limit:
00214     //   dRoverRange : max. relative range change in one step,
00215     //   finalRange  : if range <= finalRange --> last step for the particle.
00216 
00217 
00218   protected: // With description
00219 
00220      static G4bool EqualCutVectors( G4double* vec1, G4double* vec2 );
00221      static G4double* CopyCutVectors( G4double* dest, G4double* source );
00222      G4bool CutsWhereModified();
00223 
00224   // data members
00225   protected:
00226 
00227    static G4double dRoverRange;     // dRoverRange is the maximum allowed
00228                                      // deltarange/range in one Step
00229    static G4double finalRange;      // final step before stopping
00230    static G4double finalRangeRequested; //from UI command
00231    static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit
00232 
00233    static G4bool   rndmStepFlag;    // control the randomization of the step
00234    static G4bool   EnlossFlucFlag;  // control the energy loss fluctuation
00235    static G4bool       subSecFlag;  // control the generation of subcutoff delta
00236 
00237    static G4double MinDeltaCutInRange; // minimum cut for delta rays
00238    static G4double* MinDeltaEnergy ;
00239    static G4bool* LowerLimitForced ;
00240 
00241    static G4bool setMinDeltaCutInRange ;
00242 
00243    static G4EnergyLossMessenger* ELossMessenger;
00244 };
00245 
00246 #endif
00247 
00248 
00249 

Generated on Mon May 27 17:50:12 2013 for Geant4 by  doxygen 1.4.7