Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:24

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 //      GEANT 4 class header file 
0030 //
0031 //      History: first implementation, based on object model of
0032 //      2nd December 1995, G.Cosmo
0033 //      ---------- G4hEnergyLoss physics process -----------
0034 //                by Laszlo Urban, 30 May 1997 
0035 //
0036 // ************************************************************             
0037 // It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
0038 // It calculates the continuous energy loss for charged hadrons.
0039 // Processes giving contribution to the continuous loss :
0040 //   ionisation (= cont.ion.loss + delta ray production)
0041 //   can be added more easily ..........
0042 // This class creates static proton/antiproton dE/dx and range tables ,
0043 // which tables can be used by other processes.
0044 // The energy loss for other charged hadrons is calculated from the p/pbar
0045 // tables with scaled kinetic energy.
0046 //
0047 // 7/10/98  L.Urban some bugs fixed + some cleanup 
0048 // 22/10/98 L.Urban cleanup
0049 // 02/02/99 L.Urban several bugs fixed
0050 // 31/03/00 V.Ivanchenko rename to lowenergy as G4hLowEnergyLoss.hh 
0051 // 09/08/00 V.Ivanchenko remove GetContinuousStepLimit and IsApplicable
0052 // 23/11/01 V.Ivanchenko Move static member-functions from header to source
0053 // 22/01/03 V.Ivanchenko Cuts per region
0054 // 18/04/03 V.Ivanchenko Make dRoverRange protected
0055 //
0056 // 31 Jul 2008 MGP     Short term supply of energy loss of hadrons through clone of 
0057 //                     former G4hLowEnergyLoss (with some initial cleaning)
0058 //                     To be replaced by reworked class to deal with condensed/discrete 
0059 //                     issues properly
0060 //
0061 // --------------------------------------------------------------
0062 
0063 // Class description:
0064 // Short term supply of energy loss of hadrons through clone of former G4hLowEnergyLoss 
0065 // (with some initial cleaning)
0066 // To be replaced by reworked class to deal with condensed/discrete issues properly
0067 
0068 // --------------------------------------------------------------
0069 
0070 
0071 #ifndef G4HRDENERGYLOSS_HH
0072 #define G4HRDENERGYLOSS_HH 1
0073 
0074 #include "G4ios.hh"
0075 #include "globals.hh"
0076 #include "Randomize.hh"
0077 #include "G4VContinuousDiscreteProcess.hh"
0078 #include "G4Material.hh"
0079 #include "G4Element.hh"
0080 #include "G4Proton.hh"
0081 #include "G4AntiProton.hh"
0082 #include "G4Electron.hh"
0083 #include "G4VParticleChange.hh"
0084 #include "G4Track.hh"
0085 #include "G4Step.hh"
0086 #include "G4PhysicsLogVector.hh"
0087 #include "G4PhysicsLinearVector.hh"
0088 
0089 class G4EnergyLossMessenger;
0090 
0091 class G4hRDEnergyLoss : public G4VContinuousDiscreteProcess
0092 
0093 {
0094 public:
0095   
0096   G4hRDEnergyLoss(const G4String& );
0097   
0098   ~G4hRDEnergyLoss();
0099   
0100   virtual G4double GetMeanFreePath(
0101                    const G4Track& track,
0102                    G4double previousStepSize,
0103                    enum  G4ForceCondition* condition
0104                    ) = 0 ;
0105   
0106   virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
0107                       const G4Step& Step) = 0 ;
0108   
0109   // ---- MGP ---- All this static stuff is expected to disappear in a future 
0110   // development cycle
0111   
0112   //  get the number of processes contributing to the cont.energy loss
0113   static G4int GetNumberOfProcesses();
0114   
0115   //  set the number of processes contributing to the cont.energy loss
0116   static void SetNumberOfProcesses(G4int number);
0117   
0118   //  Increment the number of processes contributing to the cont.energy loss
0119   static void PlusNumberOfProcesses();
0120   
0121   //  decrement the number of processes contributing to the cont.energy loss
0122   static void MinusNumberOfProcesses();
0123   
0124   static void SetdRoverRange(G4double value);
0125   static void SetRndmStep     (G4bool   value);
0126   static void SetEnlossFluc   (G4bool   value);
0127   static void SetStepFunction (G4double c1, G4double c2);
0128 
0129 protected:
0130   
0131   G4bool CutsWhereModified();
0132   
0133   //  G4Material *lastMaterial ;
0134   const G4double MaxExcitationNumber ;
0135   const G4double probLimFluct ;
0136   const long nmaxDirectFluct,nmaxCont1,nmaxCont2 ;
0137   
0138   static void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
0139   
0140 protected:
0141   
0142   static G4ThreadLocal G4PhysicsTable* theDEDXpTable ;
0143   static G4ThreadLocal G4PhysicsTable* theDEDXpbarTable ;
0144   static G4ThreadLocal G4PhysicsTable* theRangepTable ;
0145   static G4ThreadLocal G4PhysicsTable* theRangepbarTable ;
0146   
0147   //inverse of the range tables
0148   static G4ThreadLocal G4PhysicsTable* theInverseRangepTable ;
0149   static G4ThreadLocal G4PhysicsTable* theInverseRangepbarTable ;
0150   
0151   //lab and proper time tables
0152   static G4ThreadLocal G4PhysicsTable* theLabTimepTable ;
0153   static G4ThreadLocal G4PhysicsTable* theLabTimepbarTable ;
0154   
0155   static G4ThreadLocal G4PhysicsTable* theProperTimepTable ;
0156   static G4ThreadLocal G4PhysicsTable* theProperTimepbarTable ;
0157   
0158   //  processes inherited from G4hRDEnergyLoss
0159   //   register themselves  in the static array Recorder
0160   static G4ThreadLocal G4PhysicsTable** RecorderOfpProcess;
0161   static G4ThreadLocal G4PhysicsTable** RecorderOfpbarProcess;
0162   static G4ThreadLocal G4int CounterOfpProcess ;
0163   static G4ThreadLocal G4int CounterOfpbarProcess ;
0164   
0165   // particle mass
0166   static G4ThreadLocal G4double ParticleMass ;
0167   
0168   // cut in range
0169   static G4ThreadLocal G4double ptableElectronCutInRange;
0170   static G4ThreadLocal G4double pbartableElectronCutInRange;
0171   
0172   static G4ThreadLocal G4double Charge ;
0173   
0174   static G4ThreadLocal G4double LowestKineticEnergy;
0175   static G4ThreadLocal G4double HighestKineticEnergy;
0176   static G4ThreadLocal G4int TotBin; // number of bins in table,
0177   // calculated in BuildPhysicsTable
0178   
0179   static G4ThreadLocal G4double RTable,LOGRTable; // LOGRTable=std::log(HighestKineticEnergy
0180   //          /LowestKineticEnergy)/TotBin
0181   //   RTable = std::exp(LOGRTable)
0182 
0183   G4PhysicsTable* theLossTable ;
0184   
0185   G4double linLossLimit ;
0186   
0187   G4double MinKineticEnergy ;
0188   
0189   static G4ThreadLocal G4double dRoverRange ; // maximum allowed deltarange/range
0190   //  in one step
0191   static G4ThreadLocal G4double finalRange ;  // last step before stop
0192   static G4ThreadLocal G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit
0193   
0194   static G4ThreadLocal G4bool rndmStepFlag ;
0195   static G4ThreadLocal G4bool EnlossFlucFlag ;
0196 
0197 
0198 private:
0199   
0200   // hide  assignment operator
0201   
0202   G4hRDEnergyLoss(G4hRDEnergyLoss &);
0203   G4hRDEnergyLoss & operator=(const G4hRDEnergyLoss &right);
0204   
0205   // variables for the integration routines
0206   static G4ThreadLocal G4double Mass,taulow,tauhigh,ltaulow,ltauhigh;
0207    
0208   // ====================================================================
0209   //  static part of the class
0210     
0211   static void BuildRangeTable(const G4ParticleDefinition& aParticleType);
0212   
0213   static void BuildInverseRangeTable(const G4ParticleDefinition& aParticleType);
0214   
0215   static void BuildTimeTables(const G4ParticleDefinition& aParticleType);
0216   
0217   static void BuildLabTimeVector(G4int materialIndex,
0218                  G4PhysicsLogVector* rangeVector);
0219   
0220   static void BuildProperTimeVector(G4int materialIndex,
0221                     G4PhysicsLogVector* rangeVector);
0222   
0223   static void InvertRangeVector(G4int materialIndex,
0224                 G4PhysicsLogVector* rangeVector);
0225   
0226   static void BuildRangeVector(G4int materialIndex,
0227                    G4PhysicsLogVector* rangeVector);
0228   
0229   static G4double LabTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin);
0230   
0231   static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin);
0232   
0233   static G4double RangeIntLin(G4PhysicsVector* physicsVector, G4int nbin);
0234   
0235   static G4double RangeIntLog(G4PhysicsVector* physicsVector, G4int nbin);
0236   
0237   static void BuildRangeCoeffATable( const G4ParticleDefinition& aParticleType);
0238   static void BuildRangeCoeffBTable( const G4ParticleDefinition& aParticleType);
0239   static void BuildRangeCoeffCTable(const G4ParticleDefinition& aParticleType);
0240   
0241   // ====================================================================
0242     
0243   static G4ThreadLocal G4PhysicsTable* theDEDXTable;
0244   
0245   static G4ThreadLocal G4PhysicsTable* theRangeTable;
0246   static G4ThreadLocal G4PhysicsTable* theInverseRangeTable;
0247   
0248   static G4ThreadLocal G4PhysicsTable* theLabTimeTable;
0249   static G4ThreadLocal G4PhysicsTable* theProperTimeTable;
0250   
0251   static G4ThreadLocal G4PhysicsTable** RecorderOfProcess;
0252   static G4ThreadLocal G4int CounterOfProcess;
0253   
0254   static G4ThreadLocal G4PhysicsTable* thepRangeCoeffATable;
0255   static G4ThreadLocal G4PhysicsTable* thepRangeCoeffBTable;
0256   static G4ThreadLocal G4PhysicsTable* thepRangeCoeffCTable;
0257   static G4ThreadLocal G4PhysicsTable* thepbarRangeCoeffATable;
0258   static G4ThreadLocal G4PhysicsTable* thepbarRangeCoeffBTable;
0259   static G4ThreadLocal G4PhysicsTable* thepbarRangeCoeffCTable;
0260   
0261   static G4ThreadLocal G4PhysicsTable* theRangeCoeffATable;
0262   static G4ThreadLocal G4PhysicsTable* theRangeCoeffBTable;
0263   static G4ThreadLocal G4PhysicsTable* theRangeCoeffCTable;
0264   static G4ThreadLocal G4int NumberOfProcesses ;
0265     
0266 };
0267 
0268 #endif