| [819] | 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4EnergyLossTables.hh,v 1.19 2006/06/29 19:54:35 gunter Exp $
|
|---|
| [1007] | 28 | // GEANT4 tag $Name: geant4-09-02 $
|
|---|
| [819] | 29 | //
|
|---|
| 30 | // $Id:
|
|---|
| 31 | //
|
|---|
| 32 | // -----------------------------------------------------------------------------
|
|---|
| 33 |
|
|---|
| 34 | #ifndef included_G4EnergyLossTables
|
|---|
| 35 | #define included_G4EnergyLossTables
|
|---|
| 36 |
|
|---|
| 37 | #include <map>
|
|---|
| 38 | #include "globals.hh"
|
|---|
| 39 |
|
|---|
| 40 | #include "G4PhysicsTable.hh"
|
|---|
| 41 | #include "G4ParticleDefinition.hh"
|
|---|
| 42 | #include "G4Material.hh"
|
|---|
| 43 | #include "G4ios.hh"
|
|---|
| 44 |
|
|---|
| 45 | //------------------------------------------------------------------------------
|
|---|
| 46 | // A utility class, containing the energy loss tables
|
|---|
| 47 | // for each particle
|
|---|
| 48 | //
|
|---|
| 49 | // Energy loss processes have to register their tables with this
|
|---|
| 50 | // class. The responsibility of creating and deleting the tables
|
|---|
| 51 | // remains with the energy loss classes.
|
|---|
| 52 | // -----------------------------------------------------------------------------
|
|---|
| 53 | //
|
|---|
| 54 | // P. Urban, 06/04/1998
|
|---|
| 55 | // L. Urban, 27/05/1988 , modifications + new functions added
|
|---|
| 56 | // L.Urban , 13/10/98 , revision
|
|---|
| 57 | // L.Urban, 26/10/98 , revision, Interpolate removed
|
|---|
| 58 | // L.Urban , 08/02/99, cache mechanism
|
|---|
| 59 | // L.Urban , 12/04/99 , bug fixed
|
|---|
| 60 | // don't use the helper class.
|
|---|
| 61 | // It can't be hidden for Rogue Wave uses it.
|
|---|
| 62 | // 10.11.99: moved from RWT hash dictionary to STL map, G.Barrand, M.Maire
|
|---|
| 63 | // 26.10.01: all static functions movev from .icc to .cc file (mma)
|
|---|
| 64 | // 15.01.03 Add interfaces required for "cut per region" (V.Ivanchenko)
|
|---|
| 65 | // 12.03.03 Add warnings to obsolete interfaces (V.Ivanchenko)
|
|---|
| 66 | // 12.04.03 move exception to new method (V.Ivanchenko)
|
|---|
| 67 | //
|
|---|
| 68 | // -----------------------------------------------------------------------------
|
|---|
| 69 |
|
|---|
| 70 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 71 |
|
|---|
| 72 | class G4EnergyLossTablesHelper {
|
|---|
| 73 |
|
|---|
| 74 | friend class G4EnergyLossTables;
|
|---|
| 75 | // the only instances are within the class G4EnergyLossTables
|
|---|
| 76 |
|
|---|
| 77 | public:
|
|---|
| 78 | G4EnergyLossTablesHelper();
|
|---|
| 79 |
|
|---|
| 80 | private:
|
|---|
| 81 | G4EnergyLossTablesHelper(const G4PhysicsTable* aDEDXTable,
|
|---|
| 82 | const G4PhysicsTable* aRangeTable,
|
|---|
| 83 | const G4PhysicsTable* anInverseRangeTable,
|
|---|
| 84 | const G4PhysicsTable* aLabTimeTable,
|
|---|
| 85 | const G4PhysicsTable* aProperTimeTable,
|
|---|
| 86 | G4double aLowestKineticEnergy,
|
|---|
| 87 | G4double aHighestKineticEnergy,
|
|---|
| 88 | G4double aMassRatio,
|
|---|
| 89 | G4int aNumberOfBins);
|
|---|
| 90 | // data to be stored in the dictionary
|
|---|
| 91 | const G4PhysicsTable* theDEDXTable;
|
|---|
| 92 | const G4PhysicsTable* theRangeTable;
|
|---|
| 93 | const G4PhysicsTable* theInverseRangeTable;
|
|---|
| 94 | const G4PhysicsTable* theLabTimeTable;
|
|---|
| 95 | const G4PhysicsTable* theProperTimeTable;
|
|---|
| 96 | G4double theLowestKineticEnergy;
|
|---|
| 97 | G4double theHighestKineticEnergy;
|
|---|
| 98 | G4double theMassRatio;
|
|---|
| 99 | G4int theNumberOfBins;
|
|---|
| 100 | };
|
|---|
| 101 |
|
|---|
| 102 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 103 |
|
|---|
| 104 | class G4MaterialCutsCouple;
|
|---|
| 105 |
|
|---|
| 106 | class G4EnergyLossTables {
|
|---|
| 107 |
|
|---|
| 108 | public:
|
|---|
| 109 |
|
|---|
| 110 | // get the table for a given particle
|
|---|
| 111 | // (0 if the table was not found)
|
|---|
| 112 | static const G4PhysicsTable* GetDEDXTable(
|
|---|
| 113 | const G4ParticleDefinition* p);
|
|---|
| 114 | static const G4PhysicsTable* GetRangeTable(
|
|---|
| 115 | const G4ParticleDefinition* p);
|
|---|
| 116 | static const G4PhysicsTable* GetInverseRangeTable(
|
|---|
| 117 | const G4ParticleDefinition* p);
|
|---|
| 118 | static const G4PhysicsTable* GetLabTimeTable(
|
|---|
| 119 | const G4ParticleDefinition* p);
|
|---|
| 120 | static const G4PhysicsTable* GetProperTimeTable(
|
|---|
| 121 | const G4ParticleDefinition* p);
|
|---|
| 122 |
|
|---|
| 123 | // get the DEDX or the range for a given particle/energy/material
|
|---|
| 124 | static G4double GetDEDX(
|
|---|
| 125 | const G4ParticleDefinition *aParticle,
|
|---|
| 126 | G4double KineticEnergy,
|
|---|
| 127 | const G4Material *aMaterial);
|
|---|
| 128 | static G4double GetRange(
|
|---|
| 129 | const G4ParticleDefinition *aParticle,
|
|---|
| 130 | G4double KineticEnergy,
|
|---|
| 131 | const G4Material *aMaterial);
|
|---|
| 132 | static G4double GetLabTime(
|
|---|
| 133 | const G4ParticleDefinition *aParticle,
|
|---|
| 134 | G4double KineticEnergy,
|
|---|
| 135 | const G4Material *aMaterial);
|
|---|
| 136 | static G4double GetDeltaLabTime(
|
|---|
| 137 | const G4ParticleDefinition *aParticle,
|
|---|
| 138 | G4double KineticEnergyStart,
|
|---|
| 139 | G4double KineticEnergyEnd,
|
|---|
| 140 | const G4Material *aMaterial);
|
|---|
| 141 | static G4double GetProperTime(
|
|---|
| 142 | const G4ParticleDefinition *aParticle,
|
|---|
| 143 | G4double KineticEnergy,
|
|---|
| 144 | const G4Material *aMaterial);
|
|---|
| 145 | static G4double GetDeltaProperTime(
|
|---|
| 146 | const G4ParticleDefinition *aParticle,
|
|---|
| 147 | G4double KineticEnergyStart,
|
|---|
| 148 | G4double KineticEnergyEnd,
|
|---|
| 149 | const G4Material *aMaterial);
|
|---|
| 150 |
|
|---|
| 151 | static G4double GetPreciseDEDX(
|
|---|
| 152 | const G4ParticleDefinition *aParticle,
|
|---|
| 153 | G4double KineticEnergy,
|
|---|
| 154 | const G4Material *aMaterial);
|
|---|
| 155 | static G4double GetPreciseRangeFromEnergy(
|
|---|
| 156 | const G4ParticleDefinition *aParticle,
|
|---|
| 157 | G4double KineticEnergy,
|
|---|
| 158 | const G4Material *aMaterial);
|
|---|
| 159 | static G4double GetPreciseEnergyFromRange(
|
|---|
| 160 | const G4ParticleDefinition *aParticle,
|
|---|
| 161 | G4double range,
|
|---|
| 162 | const G4Material *aMaterial);
|
|---|
| 163 |
|
|---|
| 164 | // get the DEDX or the range for a given particle/energy/materialCutsCouple
|
|---|
| 165 | static G4double GetDEDX(
|
|---|
| 166 | const G4ParticleDefinition *aParticle,
|
|---|
| 167 | G4double KineticEnergy,
|
|---|
| 168 | const G4MaterialCutsCouple *couple,
|
|---|
| 169 | G4bool check = true);
|
|---|
| 170 | static G4double GetRange(
|
|---|
| 171 | const G4ParticleDefinition *aParticle,
|
|---|
| 172 | G4double KineticEnergy,
|
|---|
| 173 | const G4MaterialCutsCouple *couple,
|
|---|
| 174 | G4bool check = true);
|
|---|
| 175 |
|
|---|
| 176 | static G4double GetPreciseDEDX(
|
|---|
| 177 | const G4ParticleDefinition *aParticle,
|
|---|
| 178 | G4double KineticEnergy,
|
|---|
| 179 | const G4MaterialCutsCouple *couple);
|
|---|
| 180 | static G4double GetPreciseRangeFromEnergy(
|
|---|
| 181 | const G4ParticleDefinition *aParticle,
|
|---|
| 182 | G4double KineticEnergy,
|
|---|
| 183 | const G4MaterialCutsCouple *couple);
|
|---|
| 184 | static G4double GetPreciseEnergyFromRange(
|
|---|
| 185 | const G4ParticleDefinition *aParticle,
|
|---|
| 186 | G4double range,
|
|---|
| 187 | const G4MaterialCutsCouple *couple,
|
|---|
| 188 | G4bool check = true);
|
|---|
| 189 |
|
|---|
| 190 | // to be called only by energy loss processes
|
|---|
| 191 | static void Register(
|
|---|
| 192 | const G4ParticleDefinition* p,
|
|---|
| 193 | const G4PhysicsTable* tDEDX,
|
|---|
| 194 | const G4PhysicsTable* tRange,
|
|---|
| 195 | const G4PhysicsTable* tInverseRange,
|
|---|
| 196 | const G4PhysicsTable* tLabTime,
|
|---|
| 197 | const G4PhysicsTable* tProperTime,
|
|---|
| 198 | G4double lowestKineticEnergy,
|
|---|
| 199 | G4double highestKineticEnergy,
|
|---|
| 200 | G4double massRatio,
|
|---|
| 201 | G4int NumberOfBins);
|
|---|
| 202 |
|
|---|
| 203 | public:
|
|---|
| 204 | typedef const G4ParticleDefinition* K;
|
|---|
| 205 |
|
|---|
| 206 | private:
|
|---|
| 207 |
|
|---|
| 208 | static void CPRWarning();
|
|---|
| 209 | static void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle, const G4String&);
|
|---|
| 210 |
|
|---|
| 211 | typedef std::map<K,G4EnergyLossTablesHelper,std::less<K> > helper_map;
|
|---|
| 212 | static helper_map dict;
|
|---|
| 213 |
|
|---|
| 214 | static G4EnergyLossTablesHelper GetTables(const G4ParticleDefinition* p);
|
|---|
| 215 |
|
|---|
| 216 | static G4EnergyLossTablesHelper t ;
|
|---|
| 217 | static G4EnergyLossTablesHelper null_loss ;
|
|---|
| 218 | static const G4ParticleDefinition* lastParticle ;
|
|---|
| 219 | static G4double QQPositron ;
|
|---|
| 220 | static G4double Chargesquare ;
|
|---|
| 221 | static G4int oldIndex ;
|
|---|
| 222 | static G4double rmin,rmax,Thigh ;
|
|---|
| 223 | static G4int let_counter;
|
|---|
| 224 | static G4int let_max_num_warnings;
|
|---|
| 225 | static G4bool first_loss;
|
|---|
| 226 |
|
|---|
| 227 | };
|
|---|
| 228 |
|
|---|
| 229 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 230 |
|
|---|
| 231 | #endif
|
|---|