Back to home page

EIC code displayed by LXR

 
 

    


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

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 // -------------------------------------------------------------------
0029 
0030 // Class description:
0031 // Low Energy electromagnetic process, electron energy loss
0032 // Further documentation available from http://www.ge.infn.it/geant4/lowE
0033 
0034 // -------------------------------------------------------------------
0035 //
0036 // This class is the implementation of the unified Energy Loss process.
0037 // It calculates the continuous energy loss for e+/e-.
0038 // The following processes give contributions to the continuous 
0039 // energy loss (by default) :
0040 //  ---  ionisation (= cont.ion.loss + delta ray production)
0041 //  --- bremsstrahlung (= cont.loss due to soft brems+discrete bremsstrahlung)
0042 //   more can be added   ..........
0043 // This class creates static dE/dx and range tables for e+ and e-,
0044 // which tables can be used by other processes , too.
0045 // G4eLowEnergyLoss is the base class for the processes giving contribution
0046 // to the (continuous) energy loss of e+/e- .
0047 //
0048 //      History: first implementation, based on object model of
0049 //      2nd December 1995, G.Cosmo
0050 //      ---------- G4eLowEnergyLoss physics process -----------
0051 //                by Laszlo Urban, 20 March 1997 
0052 //
0053 //  27.05.98 OldGetRange removed + other corrs , L.Urban
0054 //  10.09.98 cleanup
0055 //  16.10.98 public method SetStepFunction() + messenger class 
0056 //  20.01.99 new data members , L.Urban
0057 //  10.02.00 modifications, new e.m. structure , L.Urban
0058 //  18.10.01 Revision to improve code quality and consistency with design
0059 //  23.11.01 V.Ivanchenko Move static member-functions from header to source
0060 //  28.03.02 V.Ivanchenko add fluorescence flag
0061 //  21.01.03 V.Ivanchenko cut per region
0062 // ------------------------------------------------------------
0063 
0064 #ifndef G4RDeLowEnergyLoss_h
0065 #define G4RDeLowEnergyLoss_h 1
0066 
0067 #include "G4ios.hh"
0068 #include "globals.hh"
0069 #include "Randomize.hh"
0070 #include "G4RDVeLowEnergyLoss.hh"
0071 #include "G4Material.hh"
0072 #include "G4Element.hh"
0073 #include "G4ParticleChangeForLoss.hh"
0074 #include "globals.hh"
0075 #include "G4Track.hh"
0076 #include "G4Step.hh"
0077 #include "G4Electron.hh"
0078 #include "G4Positron.hh"
0079 #include "G4PhysicsLogVector.hh"
0080 #include "G4PhysicsLinearVector.hh"
0081 #include "G4EnergyLossTables.hh"
0082 
0083 class G4EnergyLossMessenger;
0084 
0085 class G4eLowEnergyLoss : public G4RDVeLowEnergyLoss
0086 
0087 {
0088   public:
0089 
0090     G4eLowEnergyLoss(const G4String& );
0091 
0092    ~G4eLowEnergyLoss();
0093 
0094     G4bool IsApplicable(const G4ParticleDefinition&);
0095     //  true for e+/e- , false otherwise
0096 
0097     void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
0098     //  It builds dE/dx and range tables for aParticleType and
0099     //  for every material contained in the materialtable.
0100 
0101     G4double GetContinuousStepLimit(const G4Track& track,
0102                                     G4double previousStepSize,
0103                                     G4double currentMinimumStep,
0104                                     G4double& currentSafety);
0105     // Computes the steplimit due to the energy loss process.
0106 
0107     G4VParticleChange* AlongStepDoIt(const G4Track& track,
0108                                      const G4Step& Step) ;
0109     // Performs the computation of the (continuous) energy loss
0110     // after the step (with fluctuation).
0111 
0112     virtual G4double GetMeanFreePath(const G4Track& track,
0113                                      G4double previousStepSize,
0114                                      G4ForceCondition* condition) = 0;
0115     // Virtual function to be overridden in the derived classes
0116     // ( ionisation and bremsstrahlung) .
0117 
0118     virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
0119                                             const G4Step& step) = 0;
0120     // Virtual function to be overridden in the derived classes
0121     // ( ionisation and bremsstrahlung) .
0122 
0123     static void  SetNbOfProcesses(G4int nb);
0124     // Sets number of processes giving contribution to the energy loss
0125 
0126     static void  PlusNbOfProcesses();
0127     // Increases number of processes giving contribution to the energy loss
0128 
0129     static void  MinusNbOfProcesses();
0130     // Decreases number of processes giving contribution to the energy loss
0131 
0132     static G4int GetNbOfProcesses();
0133     // Gets number of processes giving contribution to the energy loss
0134     // ( default value = 2)
0135 
0136     static void SetLowerBoundEloss(G4double val);
0137     static void SetUpperBoundEloss(G4double val);
0138     static void SetNbinEloss(G4int nb);
0139 
0140     static G4double GetLowerBoundEloss();
0141     static G4double GetUpperBoundEloss();
0142     static G4int    GetNbinEloss();
0143 
0144     void ActivateFluorescence(G4bool val);
0145     // Set fluorescence flag on/off
0146 
0147     G4bool Fluorescence() const;
0148     // Get flurescence flag
0149 
0150   protected:
0151 
0152     virtual std::vector<G4DynamicParticle*>* DeexciteAtom(const G4MaterialCutsCouple* ,
0153                                 G4double, G4double) // incidentEnergy, eLoss
0154   { return 0; };
0155 
0156     G4PhysicsTable* theLossTable;
0157 
0158     G4double MinKineticEnergy ;     // particle with kinetic energy
0159                                     // smaller than MinKineticEnergy
0160                                     // is stopped in  AlongStepDoIt
0161 
0162     G4double Charge,lastCharge ;
0163 
0164     //basic DEDX and Range tables
0165     static G4PhysicsTable* theDEDXElectronTable ;
0166     static G4PhysicsTable* theDEDXPositronTable ;
0167     static G4PhysicsTable* theRangeElectronTable ;
0168     static G4PhysicsTable* theRangePositronTable ;
0169 
0170     //inverse tables of the range tables
0171     static G4PhysicsTable* theInverseRangeElectronTable;
0172     static G4PhysicsTable* theInverseRangePositronTable;
0173 
0174     // lab and proper time tables
0175     static G4PhysicsTable* theLabTimeElectronTable ;
0176     static G4PhysicsTable* theLabTimePositronTable ;
0177     static G4PhysicsTable* theProperTimeElectronTable ;
0178     static G4PhysicsTable* theProperTimePositronTable ;
0179 
0180     //processes inherited from G4eLowEnergyLoss
0181     //register themselves  in the static array Recorder
0182     //for electrons/positrons separately
0183     //nb of contributing processes = NbOfProcesses
0184     static G4int NbOfProcesses;
0185     static G4int CounterOfElectronProcess;
0186     static G4int CounterOfPositronProcess ;
0187     static G4PhysicsTable** RecorderOfElectronProcess;
0188     static G4PhysicsTable** RecorderOfPositronProcess;
0189 
0190 
0191   private:
0192 
0193     G4double GetConstraints(const G4DynamicParticle* aParticle,
0194                             const G4MaterialCutsCouple* couple);
0195 
0196     // hide  assignment operator
0197     G4eLowEnergyLoss (G4eLowEnergyLoss &);
0198     G4eLowEnergyLoss & operator=(const G4eLowEnergyLoss &right);
0199 
0200 
0201     G4PhysicsTable* theDEDXTable;
0202 
0203     G4int            CounterOfProcess;
0204     G4PhysicsTable** RecorderOfProcess;
0205 
0206     G4double fdEdx;                       // computed in GetConstraints
0207     G4double fRangeNow;                   // computed in GetConstraints
0208 
0209     G4double linLossLimit ;               // used in AlongStepDoIt
0210 
0211 
0212     //New ParticleChange
0213     G4ParticleChangeForLoss fParticleChange ;
0214 
0215  //
0216  // static part of the class
0217  //
0218 
0219     static G4int NbinEloss;               // number of bins in table,
0220                                           // calculated in BuildPhysicTable
0221     static G4double LowerBoundEloss;
0222     static G4double UpperBoundEloss;
0223     static G4double RTable,LOGRTable;    // LOGRTable=std::log(UpperBoundEloss-
0224                                          // LowerBoundEloss)/NbinEloss
0225                                          // RTable = std::exp(LOGRTable)
0226 
0227     //for interpolation within the tables
0228     static G4PhysicsTable* theeRangeCoeffATable;
0229     static G4PhysicsTable* theeRangeCoeffBTable;
0230     static G4PhysicsTable* theeRangeCoeffCTable;
0231     static G4PhysicsTable* thepRangeCoeffATable;
0232     static G4PhysicsTable* thepRangeCoeffBTable;
0233     static G4PhysicsTable* thepRangeCoeffCTable;
0234 
0235     static G4EnergyLossMessenger* eLossMessenger;
0236 
0237     G4bool theFluo;                     // Fluorescence flag
0238 
0239 };
0240 
0241 #include "G4eLowEnergyLoss.icc"
0242 
0243 #endif
0244