G4EnergyLossTables.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 // -----------------------------------------------------------------------------
00032 
00033 #ifndef included_G4EnergyLossTables
00034 #define included_G4EnergyLossTables
00035 
00036 #include <map>
00037 #include "globals.hh"
00038 
00039 #include "G4PhysicsTable.hh"
00040 #include "G4ParticleDefinition.hh"
00041 #include "G4Material.hh"
00042 #include "G4ios.hh"
00043 
00044 //------------------------------------------------------------------------------
00045 // A utility class, containing the energy loss tables
00046 // for each particle
00047 //
00048 // Energy loss processes have to register their tables with this
00049 // class. The responsibility of creating and deleting the tables
00050 // remains with the energy loss classes.
00051 // -----------------------------------------------------------------------------
00052 //
00053 // P. Urban, 06/04/1998
00054 // L. Urban, 27/05/1988 , modifications + new functions added
00055 // L.Urban , 13/10/98 , revision
00056 // L.Urban,  26/10/98 , revision, Interpolate removed
00057 // L.Urban , 08/02/99,  cache mechanism
00058 // L.Urban , 12/04/99 , bug fixed
00059 // don't use the helper class.
00060 // It can't be hidden for Rogue Wave uses it.
00061 // 10.11.99: moved from RWT hash dictionary to STL map, G.Barrand, M.Maire
00062 // 26.10.01: all static functions movev from .icc to .cc file (mma)
00063 // 15.01.03 Add interfaces required for "cut per region" (V.Ivanchenko)
00064 // 12.03.03 Add warnings to obsolete interfaces (V.Ivanchenko)
00065 // 12.04.03 move exception to new method (V.Ivanchenko)
00066 //
00067 // -----------------------------------------------------------------------------
00068 
00069 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00070 
00071 class G4EnergyLossTablesHelper {
00072 
00073 friend class G4EnergyLossTables;
00074   // the only instances are within the class G4EnergyLossTables
00075 
00076 public:
00077   G4EnergyLossTablesHelper();
00078 
00079 private:
00080   G4EnergyLossTablesHelper(const G4PhysicsTable* aDEDXTable,
00081                            const G4PhysicsTable* aRangeTable,
00082                            const G4PhysicsTable* anInverseRangeTable,
00083                            const G4PhysicsTable* aLabTimeTable,
00084                            const G4PhysicsTable* aProperTimeTable,
00085                            G4double aLowestKineticEnergy,
00086                            G4double aHighestKineticEnergy,
00087                            G4double aMassRatio,
00088                            G4int aNumberOfBins);
00089   // data to be stored in the dictionary
00090   const G4PhysicsTable* theDEDXTable;
00091   const G4PhysicsTable* theRangeTable;
00092   const G4PhysicsTable* theInverseRangeTable;
00093   const G4PhysicsTable* theLabTimeTable;
00094   const G4PhysicsTable* theProperTimeTable;
00095   G4double theLowestKineticEnergy;
00096   G4double theHighestKineticEnergy;
00097   G4double theMassRatio;
00098   G4int theNumberOfBins;
00099 };
00100 
00101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00102 
00103 class G4MaterialCutsCouple;
00104 
00105 class G4EnergyLossTables {
00106 
00107 public:
00108 
00109   // get the table for a given particle
00110   // (0 if the table was not found)
00111   static const G4PhysicsTable* GetDEDXTable(
00112     const G4ParticleDefinition* p);
00113   static const G4PhysicsTable* GetRangeTable(
00114     const G4ParticleDefinition* p);
00115   static const G4PhysicsTable* GetInverseRangeTable(
00116     const G4ParticleDefinition* p);
00117   static const G4PhysicsTable* GetLabTimeTable(
00118     const G4ParticleDefinition* p);
00119   static const G4PhysicsTable* GetProperTimeTable(
00120     const G4ParticleDefinition* p);
00121 
00122   // get the DEDX or the range for a given particle/energy/material
00123   static G4double GetDEDX(
00124     const G4ParticleDefinition *aParticle,
00125     G4double KineticEnergy,
00126     const G4Material *aMaterial);
00127   static G4double GetRange(
00128     const G4ParticleDefinition *aParticle,
00129     G4double KineticEnergy,
00130     const G4Material *aMaterial);
00131   static G4double GetLabTime(
00132     const G4ParticleDefinition *aParticle,
00133     G4double KineticEnergy,
00134     const G4Material *aMaterial);
00135   static G4double GetDeltaLabTime(
00136     const G4ParticleDefinition *aParticle,
00137     G4double KineticEnergyStart,
00138     G4double KineticEnergyEnd,
00139     const G4Material *aMaterial);
00140   static G4double GetProperTime(
00141     const G4ParticleDefinition *aParticle,
00142     G4double KineticEnergy,
00143     const G4Material *aMaterial);
00144   static G4double GetDeltaProperTime(
00145     const G4ParticleDefinition *aParticle,
00146     G4double KineticEnergyStart,
00147     G4double KineticEnergyEnd,
00148     const G4Material *aMaterial);
00149 
00150   static G4double GetPreciseDEDX(
00151     const G4ParticleDefinition *aParticle,
00152     G4double KineticEnergy,
00153     const G4Material *aMaterial);
00154   static G4double GetPreciseRangeFromEnergy(
00155     const G4ParticleDefinition *aParticle,
00156     G4double KineticEnergy,
00157     const G4Material *aMaterial);
00158   static G4double GetPreciseEnergyFromRange(
00159     const G4ParticleDefinition *aParticle,
00160     G4double range,
00161     const G4Material *aMaterial);
00162 
00163   // get the DEDX or the range for a given particle/energy/materialCutsCouple
00164   static G4double GetDEDX(
00165     const G4ParticleDefinition *aParticle,
00166     G4double KineticEnergy,
00167     const G4MaterialCutsCouple *couple,
00168     G4bool check = true);
00169   static G4double GetRange(
00170     const G4ParticleDefinition *aParticle,
00171     G4double KineticEnergy,
00172     const G4MaterialCutsCouple *couple,
00173     G4bool check = true);
00174 
00175   static G4double GetPreciseDEDX(
00176     const G4ParticleDefinition *aParticle,
00177     G4double KineticEnergy,
00178     const G4MaterialCutsCouple *couple);
00179   static G4double GetPreciseRangeFromEnergy(
00180     const G4ParticleDefinition *aParticle,
00181     G4double KineticEnergy,
00182     const G4MaterialCutsCouple *couple);
00183   static G4double GetPreciseEnergyFromRange(
00184     const G4ParticleDefinition *aParticle,
00185     G4double range,
00186     const G4MaterialCutsCouple *couple,
00187     G4bool check = true);
00188 
00189   // to be called only by energy loss processes
00190   static void Register(
00191     const G4ParticleDefinition* p,
00192     const G4PhysicsTable* tDEDX,
00193     const G4PhysicsTable* tRange,
00194     const G4PhysicsTable* tInverseRange,
00195     const G4PhysicsTable* tLabTime,
00196     const G4PhysicsTable* tProperTime,
00197     G4double lowestKineticEnergy,
00198     G4double highestKineticEnergy,
00199     G4double massRatio,
00200     G4int NumberOfBins);
00201 
00202 public:
00203   typedef const G4ParticleDefinition* K;
00204 
00205 private:
00206 
00207   static void CPRWarning();
00208   static void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle, const G4String&);
00209 
00210   typedef std::map<K,G4EnergyLossTablesHelper,std::less<K> > helper_map;
00211   static helper_map dict;
00212 
00213   static G4EnergyLossTablesHelper GetTables(const G4ParticleDefinition* p);
00214 
00215   static G4EnergyLossTablesHelper t ;
00216   static G4EnergyLossTablesHelper null_loss ;
00217   static const G4ParticleDefinition* lastParticle ;
00218   static G4double QQPositron ;
00219   static G4double Chargesquare ;
00220   static G4int oldIndex ;
00221   static G4double rmin,rmax,Thigh ;
00222   static G4int  let_counter;
00223   static G4int  let_max_num_warnings;
00224   static G4bool first_loss;
00225 
00226 };
00227 
00228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00229 
00230 #endif

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