G4hRDEnergyLoss.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 // $Id: 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file 
00032 //
00033 //      History: first implementation, based on object model of
00034 //      2nd December 1995, G.Cosmo
00035 //      ---------- G4hEnergyLoss physics process -----------
00036 //                by Laszlo Urban, 30 May 1997 
00037 //
00038 // ************************************************************             
00039 // It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
00040 // It calculates the continuous energy loss for charged hadrons.
00041 // Processes giving contribution to the continuous loss :
00042 //   ionisation (= cont.ion.loss + delta ray production)
00043 //   can be added more easily ..........
00044 // This class creates static proton/antiproton dE/dx and range tables ,
00045 // which tables can be used by other processes.
00046 // The energy loss for other charged hadrons is calculated from the p/pbar
00047 // tables with scaled kinetic energy.
00048 //
00049 // 7/10/98  L.Urban some bugs fixed + some cleanup 
00050 // 22/10/98 L.Urban cleanup
00051 // 02/02/99 L.Urban several bugs fixed
00052 // 31/03/00 V.Ivanchenko rename to lowenergy as G4hLowEnergyLoss.hh 
00053 // 09/08/00 V.Ivanchenko remove GetContinuousStepLimit and IsApplicable
00054 // 23/11/01 V.Ivanchenko Move static member-functions from header to source
00055 // 22/01/03 V.Ivanchenko Cuts per region
00056 // 18/04/03 V.Ivanchenko Make dRoverRange protected
00057 //
00058 // 31 Jul 2008 MGP     Short term supply of energy loss of hadrons through clone of 
00059 //                     former G4hLowEnergyLoss (with some initial cleaning)
00060 //                     To be replaced by reworked class to deal with condensed/discrete 
00061 //                     issues properly
00062 //
00063 // --------------------------------------------------------------
00064 
00065 // Class description:
00066 // Short term supply of energy loss of hadrons through clone of former G4hLowEnergyLoss 
00067 // (with some initial cleaning)
00068 // To be replaced by reworked class to deal with condensed/discrete issues properly
00069 
00070 // --------------------------------------------------------------
00071 
00072 
00073 #ifndef G4HRDENERGYLOSS_HH
00074 #define G4HRDENERGYLOSS_HH 1
00075 
00076 #include "G4ios.hh"
00077 #include "globals.hh"
00078 #include "Randomize.hh"
00079 #include "G4VContinuousDiscreteProcess.hh"
00080 #include "G4Material.hh"
00081 #include "G4Element.hh"
00082 #include "G4Proton.hh"
00083 #include "G4AntiProton.hh"
00084 #include "G4Electron.hh"
00085 #include "G4VParticleChange.hh"
00086 #include "G4Track.hh"
00087 #include "G4Step.hh"
00088 #include "G4PhysicsLogVector.hh"
00089 #include "G4PhysicsLinearVector.hh"
00090 
00091 class G4EnergyLossMessenger;
00092 
00093 class G4hRDEnergyLoss : public G4VContinuousDiscreteProcess
00094 
00095 {
00096 public:
00097   
00098   G4hRDEnergyLoss(const G4String& );
00099   
00100   ~G4hRDEnergyLoss();
00101   
00102   virtual G4double GetMeanFreePath(
00103                                    const G4Track& track,
00104                                    G4double previousStepSize,
00105                                    enum  G4ForceCondition* condition
00106                                    ) = 0 ;
00107   
00108   virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
00109                                           const G4Step& Step) = 0 ;
00110   
00111   // ---- MGP ---- All this static stuff is expected to disappear in a future 
00112   // development cycle
00113   
00114   //  get the number of processes contributing to the cont.energy loss
00115   static G4int GetNumberOfProcesses();
00116   
00117   //  set the number of processes contributing to the cont.energy loss
00118   static void SetNumberOfProcesses(G4int number);
00119   
00120   //  Increment the number of processes contributing to the cont.energy loss
00121   static void PlusNumberOfProcesses();
00122   
00123   //  decrement the number of processes contributing to the cont.energy loss
00124   static void MinusNumberOfProcesses();
00125   
00126   static void SetdRoverRange(G4double value);
00127   static void SetRndmStep     (G4bool   value);
00128   static void SetEnlossFluc   (G4bool   value);
00129   static void SetStepFunction (G4double c1, G4double c2);
00130 
00131 protected:
00132   
00133   G4bool CutsWhereModified();
00134   
00135   //  G4Material *lastMaterial ;
00136   const G4double MaxExcitationNumber ;
00137   const G4double probLimFluct ;
00138   const long nmaxDirectFluct,nmaxCont1,nmaxCont2 ;
00139   
00140   static void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
00141   
00142 protected:
00143   
00144   static G4PhysicsTable* theDEDXpTable ;
00145   static G4PhysicsTable* theDEDXpbarTable ;
00146   static G4PhysicsTable* theRangepTable ;
00147   static G4PhysicsTable* theRangepbarTable ;
00148   
00149   //inverse of the range tables
00150   static G4PhysicsTable* theInverseRangepTable ;
00151   static G4PhysicsTable* theInverseRangepbarTable ;
00152   
00153   //lab and proper time tables
00154   static G4PhysicsTable* theLabTimepTable ;
00155   static G4PhysicsTable* theLabTimepbarTable ;
00156   
00157   static G4PhysicsTable* theProperTimepTable ;
00158   static G4PhysicsTable* theProperTimepbarTable ;
00159   
00160   //  processes inherited from G4hRDEnergyLoss
00161   //   register themselves  in the static array Recorder
00162   static G4PhysicsTable** RecorderOfpProcess;
00163   static G4PhysicsTable** RecorderOfpbarProcess;
00164   static G4int CounterOfpProcess ;
00165   static G4int CounterOfpbarProcess ;
00166   
00167   // particle mass
00168   static G4double ParticleMass ;
00169   
00170   // cut in range
00171   static G4double ptableElectronCutInRange;
00172   static G4double pbartableElectronCutInRange;
00173   
00174   static G4double Charge ;
00175   
00176   static G4double LowestKineticEnergy;
00177   static G4double HighestKineticEnergy;
00178   static G4int TotBin; // number of bins in table,
00179   // calculated in BuildPhysicsTable
00180   
00181   static G4double RTable,LOGRTable; // LOGRTable=std::log(HighestKineticEnergy
00182   //          /LowestKineticEnergy)/TotBin
00183   //   RTable = std::exp(LOGRTable)
00184 
00185   G4PhysicsTable* theLossTable ;
00186   
00187   G4double linLossLimit ;
00188   
00189   G4double MinKineticEnergy ;
00190   
00191   static G4double dRoverRange ; // maximum allowed deltarange/range
00192   //  in one step
00193   static G4double finalRange ;  // last step before stop
00194   static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit
00195   
00196   static G4bool rndmStepFlag ;
00197   static G4bool EnlossFlucFlag ;
00198 
00199 
00200 private:
00201   
00202   // hide  assignment operator
00203   
00204   G4hRDEnergyLoss(G4hRDEnergyLoss &);
00205   G4hRDEnergyLoss & operator=(const G4hRDEnergyLoss &right);
00206   
00207   // variables for the integration routines
00208   static G4double Mass,taulow,tauhigh,ltaulow,ltauhigh;
00209    
00210   // ====================================================================
00211   //  static part of the class
00212     
00213   static void BuildRangeTable(const G4ParticleDefinition& aParticleType);
00214   
00215   static void BuildInverseRangeTable(const G4ParticleDefinition& aParticleType);
00216   
00217   static void BuildTimeTables(const G4ParticleDefinition& aParticleType);
00218   
00219   static void BuildLabTimeVector(G4int materialIndex,
00220                                  G4PhysicsLogVector* rangeVector);
00221   
00222   static void BuildProperTimeVector(G4int materialIndex,
00223                                     G4PhysicsLogVector* rangeVector);
00224   
00225   static void InvertRangeVector(G4int materialIndex,
00226                                 G4PhysicsLogVector* rangeVector);
00227   
00228   static void BuildRangeVector(G4int materialIndex,
00229                                G4PhysicsLogVector* rangeVector);
00230   
00231   static G4double LabTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin);
00232   
00233   static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin);
00234   
00235   static G4double RangeIntLin(G4PhysicsVector* physicsVector, G4int nbin);
00236   
00237   static G4double RangeIntLog(G4PhysicsVector* physicsVector, G4int nbin);
00238   
00239   static void BuildRangeCoeffATable( const G4ParticleDefinition& aParticleType);
00240   static void BuildRangeCoeffBTable( const G4ParticleDefinition& aParticleType);
00241   static void BuildRangeCoeffCTable(const G4ParticleDefinition& aParticleType);
00242   
00243   // ====================================================================
00244     
00245   static G4PhysicsTable* theDEDXTable;
00246   
00247   static G4PhysicsTable* theRangeTable;
00248   static G4PhysicsTable* theInverseRangeTable;
00249   
00250   static G4PhysicsTable* theLabTimeTable;
00251   static G4PhysicsTable* theProperTimeTable;
00252   
00253   static G4PhysicsTable** RecorderOfProcess;
00254   static G4int CounterOfProcess;
00255   
00256   static G4PhysicsTable* thepRangeCoeffATable;
00257   static G4PhysicsTable* thepRangeCoeffBTable;
00258   static G4PhysicsTable* thepRangeCoeffCTable;
00259   static G4PhysicsTable* thepbarRangeCoeffATable;
00260   static G4PhysicsTable* thepbarRangeCoeffBTable;
00261   static G4PhysicsTable* thepbarRangeCoeffCTable;
00262   
00263   static G4PhysicsTable* theRangeCoeffATable;
00264   static G4PhysicsTable* theRangeCoeffBTable;
00265   static G4PhysicsTable* theRangeCoeffCTable;
00266   static G4int NumberOfProcesses ;
00267     
00268 };
00269 
00270 #endif
00271 
00272 
00273 

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