Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:05

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // 3.4.2000 Veronique Lefebure:
0029 //          Move utils/include/G4VEnergyLoss.hh to 
0030 //               lowenergy/include/G4RDVeLowEnergyLoss.hh
0031 // 
0032 // ------------------------------------------------------------
0033 //  GEANT 4 class header file 
0034 //
0035 // 
0036 // Class Description 
0037 //
0038 //  General service class for the energy loss classes
0039 //  
0040 //  It contains code needed to compute the range tables,
0041 //  time tables, the inverse range tables and some auxiliary
0042 //  tables.
0043 //  The energy loss fluctuation code is here,too.
0044 //
0045 //  All the EnergyLoss classes are inherited from G4RDVeLowEnergyLoss
0046 //  class.
0047 //
0048 //  -----------------------------------------------------------
0049 //  created  on 28 January 2000  by L. Urban
0050 //  -----------------------------------------------------------
0051 //
0052 //  Modifications:
0053 // 20/09/00 V.Ivanchenko update fluctuations
0054 // 23/11/01 V.Ivanchenko Move static member-functions from header to source
0055 // 22/01/03 V.Ivanchenko Cut per range
0056 //
0057 // Class description:
0058 // Abstract class for Low Energy Electromagnetic electron energy loss
0059 // Further documentation available from http://www.ge.infn.it/geant4/lowE
0060 
0061 //  -----------------------------------------------------------
0062 
0063 #ifndef G4RDVeLowEnergyLoss_h
0064 #define G4RDVeLowEnergyLoss_h 1
0065 
0066 #include "globals.hh"
0067 #include "G4ios.hh"
0068 #include "Randomize.hh"
0069 #include "G4Poisson.hh"
0070 #include "G4Electron.hh"
0071 #include "G4VContinuousDiscreteProcess.hh"
0072 #include "G4PhysicsLogVector.hh"
0073 #include "G4PhysicsLinearVector.hh"
0074 #include "G4MaterialCutsCouple.hh"
0075 
0076 class G4RDVeLowEnergyLoss : public G4VContinuousDiscreteProcess
0077 {
0078   public:
0079 
0080       G4RDVeLowEnergyLoss(const G4String& ,
0081                    G4ProcessType   aType = fNotDefined );
0082       G4RDVeLowEnergyLoss(G4RDVeLowEnergyLoss &);
0083 
0084       virtual ~G4RDVeLowEnergyLoss();
0085 
0086       virtual G4double GetContinuousStepLimit(const G4Track& track,
0087                                     G4double previousStepSize,
0088                                     G4double currentMinimumStep,
0089                                     G4double& currentSafety) = 0 ;
0090 
0091       virtual G4VParticleChange* AlongStepDoIt(const G4Track& track,
0092                                      const G4Step& Step) = 0 ;
0093 
0094       virtual G4double GetMeanFreePath(const G4Track& track,
0095                                      G4double previousStepSize,
0096                                      G4ForceCondition* condition) = 0;
0097 
0098       virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
0099                                             const G4Step& Step) = 0;
0100 
0101 
0102 
0103   protected:// with description
0104 
0105     // code for the energy loss fluctuation
0106 
0107     G4double GetLossWithFluct(const G4DynamicParticle* aParticle,
0108                               const G4MaterialCutsCouple* couple,
0109                               G4double  MeanLoss,
0110                               G4double  step);
0111 
0112 
0113    private:
0114 
0115   // hide default constructor and assignment operator as private
0116       G4RDVeLowEnergyLoss();
0117       G4RDVeLowEnergyLoss & operator=(const G4RDVeLowEnergyLoss &right);
0118 
0119   protected:
0120 
0121     // data members to speed up the fluctuation calculation
0122     const G4Material* lastMaterial;
0123     G4int imat;
0124     G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
0125     G4double e1LogFluct,e2LogFluct,ipotLogFluct;
0126 
0127     const G4int nmaxCont1,nmaxCont2 ;
0128 
0129   // static part of the class
0130 
0131   public:  // With description
0132 
0133     static void SetRndmStep     (G4bool   value);
0134     // use / do not use randomisation in energy loss steplimit
0135     // ( default = no randomisation)
0136 
0137     static void SetEnlossFluc   (G4bool   value);
0138     // compute energy loss with/without fluctuation
0139     // ( default : with fluctuation)
0140 
0141     static void SetStepFunction (G4double c1, G4double c2);
0142     // sets values for data members used to compute the step limit:
0143     //   dRoverRange : max. relative range change in one step,
0144     //   finalRange  : if range <= finalRange --> last step for the particle.
0145 
0146 
0147   protected: // With description
0148 
0149     // Build range table starting from the DEDXtable
0150     static G4PhysicsTable*
0151      BuildRangeTable(G4PhysicsTable* theDEDXTable,
0152                      G4PhysicsTable* theRangeTable,
0153                      G4double Tmin,G4double Tmax,G4int nbin);
0154 
0155     // Build time tables starting from the DEDXtable
0156     static G4PhysicsTable*
0157      BuildLabTimeTable(G4PhysicsTable* theDEDXTable,
0158                        G4PhysicsTable* theLabTimeTable,
0159                        G4double Tmin,G4double Tmax,G4int nbin);
0160 
0161     static G4PhysicsTable*
0162      BuildProperTimeTable(G4PhysicsTable* theDEDXTable,
0163                        G4PhysicsTable* ProperTimeTable,
0164                        G4double Tmin,G4double Tmax,G4int nbin);
0165 
0166     // Build tables of coefficients needed for inverting the range table 
0167     static G4PhysicsTable*
0168      BuildRangeCoeffATable(G4PhysicsTable* theRangeTable,
0169                            G4PhysicsTable* theCoeffATable,
0170                            G4double Tmin,G4double Tmax,G4int nbin);
0171     static G4PhysicsTable*
0172      BuildRangeCoeffBTable(G4PhysicsTable* theRangeTable,
0173                            G4PhysicsTable* theCoeffBTable,
0174                            G4double Tmin,G4double Tmax,G4int nbin);
0175     static G4PhysicsTable*
0176      BuildRangeCoeffCTable(G4PhysicsTable* theRangeTable,
0177                            G4PhysicsTable* theCoeffCTable,
0178                            G4double Tmin,G4double Tmax,G4int nbin);
0179 
0180     // Invert range table
0181     static G4PhysicsTable*
0182      BuildInverseRangeTable(G4PhysicsTable* theRangeTable,
0183                             G4PhysicsTable* theRangeCoeffATable,
0184                             G4PhysicsTable* theRangeCoeffBTable,
0185                             G4PhysicsTable* theRangeCoeffCTable,
0186                             G4PhysicsTable* theInverseRangeTable,
0187                             G4double Tmin,G4double Tmax,G4int nbin);
0188 
0189   private:
0190 
0191     static void BuildRangeVector(G4PhysicsTable* theDEDXTable,
0192                         G4double Tmin,G4double Tmax,G4int nbin,
0193                         G4int materialIndex,G4PhysicsLogVector* rangeVector);
0194 
0195     static void BuildRangeVectorNew(const G4PhysicsTable*,G4int,
0196                                           G4int,G4PhysicsLogVector*);
0197 
0198     static G4double RangeIntLin(G4PhysicsVector* physicsVector
0199                                                         ,G4int nbin);
0200 
0201     static G4double RangeIntLog(G4PhysicsVector* physicsVector
0202                                                         ,G4int nbin);
0203 
0204     static void BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
0205                         G4double Tmin,G4double Tmax,G4int nbin,
0206                         G4int materialIndex,G4PhysicsLogVector* rangeVector);
0207 
0208     static void BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
0209                         G4double Tmin,G4double Tmax,G4int nbin,
0210                         G4int materialIndex,G4PhysicsLogVector* rangeVector);
0211 
0212     static G4double LabTimeIntLog(G4PhysicsVector* physicsVector
0213                                                         ,G4int nbin);
0214 
0215     static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,
0216                                                          G4int nbin);
0217 
0218     static void InvertRangeVector(G4PhysicsTable* theRangeTable,
0219                                   G4PhysicsTable* theRangeCoeffATable,
0220                                   G4PhysicsTable* theRangeCoeffBTable,
0221                                   G4PhysicsTable* theRangeCoeffCTable,
0222                                   G4double Tmin,G4double Tmax,G4int nbin,
0223                        G4int materialIndex,G4PhysicsLogVector* rangeVector);
0224 
0225 
0226   // data members
0227   protected:
0228 
0229    // variables for the integration routines
0230    static G4double ParticleMass,taulow,tauhigh,ltaulow,ltauhigh;
0231 
0232 
0233    static G4double dRoverRange;     // dRoverRange is the maximum allowed
0234                                      // deltarange/range in one Step
0235    static G4double finalRange;      // final step before stopping
0236    static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit
0237 
0238    static G4bool   rndmStepFlag;    // control the randomization of the step
0239    static G4bool   EnlossFlucFlag;  // control the energy loss fluctuation
0240 
0241 
0242 };
0243 
0244 #endif
0245 
0246 
0247