File indexing completed on 2025-01-18 09:58:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef included_G4EnergyLossTables
0032 #define included_G4EnergyLossTables
0033
0034 #include <map>
0035 #include "globals.hh"
0036
0037 #include "G4PhysicsTable.hh"
0038 #include "G4ParticleDefinition.hh"
0039 #include "G4Material.hh"
0040 #include "G4ios.hh"
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 class G4EnergyLossTablesHelper {
0070
0071 friend class G4EnergyLossTables;
0072
0073
0074 public:
0075 G4EnergyLossTablesHelper();
0076
0077 private:
0078 G4EnergyLossTablesHelper(const G4PhysicsTable* aDEDXTable,
0079 const G4PhysicsTable* aRangeTable,
0080 const G4PhysicsTable* anInverseRangeTable,
0081 const G4PhysicsTable* aLabTimeTable,
0082 const G4PhysicsTable* aProperTimeTable,
0083 G4double aLowestKineticEnergy,
0084 G4double aHighestKineticEnergy,
0085 G4double aMassRatio,
0086 G4int aNumberOfBins);
0087
0088 const G4PhysicsTable* theDEDXTable;
0089 const G4PhysicsTable* theRangeTable;
0090 const G4PhysicsTable* theInverseRangeTable;
0091 const G4PhysicsTable* theLabTimeTable;
0092 const G4PhysicsTable* theProperTimeTable;
0093 G4double theLowestKineticEnergy;
0094 G4double theHighestKineticEnergy;
0095 G4double theMassRatio;
0096 G4int theNumberOfBins;
0097 };
0098
0099
0100
0101 class G4MaterialCutsCouple;
0102
0103 class G4EnergyLossTables {
0104
0105 public:
0106
0107
0108
0109 static const G4PhysicsTable* GetDEDXTable(
0110 const G4ParticleDefinition* p);
0111 static const G4PhysicsTable* GetRangeTable(
0112 const G4ParticleDefinition* p);
0113 static const G4PhysicsTable* GetInverseRangeTable(
0114 const G4ParticleDefinition* p);
0115 static const G4PhysicsTable* GetLabTimeTable(
0116 const G4ParticleDefinition* p);
0117 static const G4PhysicsTable* GetProperTimeTable(
0118 const G4ParticleDefinition* p);
0119
0120
0121 static G4double GetDEDX(
0122 const G4ParticleDefinition *aParticle,
0123 G4double KineticEnergy,
0124 const G4Material *aMaterial);
0125 static G4double GetRange(
0126 const G4ParticleDefinition *aParticle,
0127 G4double KineticEnergy,
0128 const G4Material *aMaterial);
0129 static G4double GetLabTime(
0130 const G4ParticleDefinition *aParticle,
0131 G4double KineticEnergy,
0132 const G4Material *aMaterial);
0133 static G4double GetDeltaLabTime(
0134 const G4ParticleDefinition *aParticle,
0135 G4double KineticEnergyStart,
0136 G4double KineticEnergyEnd,
0137 const G4Material *aMaterial);
0138 static G4double GetProperTime(
0139 const G4ParticleDefinition *aParticle,
0140 G4double KineticEnergy,
0141 const G4Material *aMaterial);
0142 static G4double GetDeltaProperTime(
0143 const G4ParticleDefinition *aParticle,
0144 G4double KineticEnergyStart,
0145 G4double KineticEnergyEnd,
0146 const G4Material *aMaterial);
0147
0148 static G4double GetPreciseDEDX(
0149 const G4ParticleDefinition *aParticle,
0150 G4double KineticEnergy,
0151 const G4Material *aMaterial);
0152 static G4double GetPreciseRangeFromEnergy(
0153 const G4ParticleDefinition *aParticle,
0154 G4double KineticEnergy,
0155 const G4Material *aMaterial);
0156 static G4double GetPreciseEnergyFromRange(
0157 const G4ParticleDefinition *aParticle,
0158 G4double range,
0159 const G4Material *aMaterial);
0160
0161
0162 static G4double GetDEDX(
0163 const G4ParticleDefinition *aParticle,
0164 G4double KineticEnergy,
0165 const G4MaterialCutsCouple *couple,
0166 G4bool check = true);
0167 static G4double GetRange(
0168 const G4ParticleDefinition *aParticle,
0169 G4double KineticEnergy,
0170 const G4MaterialCutsCouple *couple,
0171 G4bool check = true);
0172
0173 static G4double GetPreciseDEDX(
0174 const G4ParticleDefinition *aParticle,
0175 G4double KineticEnergy,
0176 const G4MaterialCutsCouple *couple);
0177 static G4double GetPreciseRangeFromEnergy(
0178 const G4ParticleDefinition *aParticle,
0179 G4double KineticEnergy,
0180 const G4MaterialCutsCouple *couple);
0181 static G4double GetPreciseEnergyFromRange(
0182 const G4ParticleDefinition *aParticle,
0183 G4double range,
0184 const G4MaterialCutsCouple *couple,
0185 G4bool check = true);
0186
0187
0188 static void Register(
0189 const G4ParticleDefinition* p,
0190 const G4PhysicsTable* tDEDX,
0191 const G4PhysicsTable* tRange,
0192 const G4PhysicsTable* tInverseRange,
0193 const G4PhysicsTable* tLabTime,
0194 const G4PhysicsTable* tProperTime,
0195 G4double lowestKineticEnergy,
0196 G4double highestKineticEnergy,
0197 G4double massRatio,
0198 G4int NumberOfBins);
0199
0200 public:
0201 typedef const G4ParticleDefinition* K;
0202
0203 private:
0204
0205 static void CPRWarning();
0206 static void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle,
0207 const G4String&);
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226 using helper_map = std::map<K, G4EnergyLossTablesHelper, std::less<K> >;
0227 static helper_map *dict;
0228
0229 static G4EnergyLossTablesHelper GetTables(const G4ParticleDefinition* p);
0230
0231 static G4EnergyLossTablesHelper *t;
0232 static G4EnergyLossTablesHelper *null_loss;
0233 static G4ParticleDefinition* lastParticle ;
0234 static G4double QQPositron ;
0235 static G4double Chargesquare ;
0236 static G4int oldIndex ;
0237 static G4double rmin,rmax,Thigh ;
0238 static G4int let_counter;
0239 static G4int let_max_num_warnings;
0240 static G4bool first_loss;
0241
0242 };
0243
0244
0245
0246 #endif