[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: G4VEnergyLoss.hh,v 1.18 2006/06/29 19:54:47 gunter Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // |
---|
| 31 | // ------------------------------------------------------------ |
---|
| 32 | // 26.10.01 static inline functions moved to .cc file (mma) |
---|
| 33 | // 08.11.01 some static methods,data members are not static L.Urban |
---|
| 34 | // 15.01.03 Migrade to cut per region (V.Ivanchenko) |
---|
| 35 | // ------------------------------------------------------------ |
---|
| 36 | // |
---|
| 37 | // Class Description |
---|
| 38 | // |
---|
| 39 | // General service class for the energy loss classes |
---|
| 40 | // |
---|
| 41 | // It contains code needed to compute the range tables, |
---|
| 42 | // time tables, the inverse range tables and some auxiliary |
---|
| 43 | // tables. |
---|
| 44 | // The energy loss fluctuation code is here,too. |
---|
| 45 | // |
---|
| 46 | // All the EnergyLoss classes are inherited from G4VEnergyLoss |
---|
| 47 | // class. |
---|
| 48 | // |
---|
| 49 | |
---|
| 50 | // ----------------------------------------------------------- |
---|
| 51 | // created on 28 January 2000 by L. Urban |
---|
| 52 | // ----------------------------------------------------------- |
---|
| 53 | |
---|
| 54 | #ifndef G4VEnergyLoss_h |
---|
| 55 | #define G4VEnergyLoss_h 1 |
---|
| 56 | |
---|
| 57 | #include "globals.hh" |
---|
| 58 | #include "G4ios.hh" |
---|
| 59 | #include "Randomize.hh" |
---|
| 60 | #include "G4Poisson.hh" |
---|
| 61 | #include "G4Electron.hh" |
---|
| 62 | #include "G4VContinuousDiscreteProcess.hh" |
---|
| 63 | #include "G4PhysicsLogVector.hh" |
---|
| 64 | #include "G4PhysicsLinearVector.hh" |
---|
| 65 | #include "G4MaterialCutsCouple.hh" |
---|
| 66 | |
---|
| 67 | class G4EnergyLossMessenger; |
---|
| 68 | |
---|
| 69 | class G4VEnergyLoss : public G4VContinuousDiscreteProcess |
---|
| 70 | { |
---|
| 71 | public: |
---|
| 72 | |
---|
| 73 | G4VEnergyLoss(const G4String& , |
---|
| 74 | G4ProcessType aType = fNotDefined ); |
---|
| 75 | G4VEnergyLoss(G4VEnergyLoss &); |
---|
| 76 | |
---|
| 77 | virtual ~G4VEnergyLoss(); |
---|
| 78 | |
---|
| 79 | virtual G4double GetContinuousStepLimit(const G4Track& track, |
---|
| 80 | G4double previousStepSize, |
---|
| 81 | G4double currentMinimumStep, |
---|
| 82 | G4double& currentSafety) = 0 ; |
---|
| 83 | |
---|
| 84 | virtual G4VParticleChange* AlongStepDoIt(const G4Track& track, |
---|
| 85 | const G4Step& Step) = 0 ; |
---|
| 86 | |
---|
| 87 | virtual G4double GetMeanFreePath(const G4Track& track, |
---|
| 88 | G4double previousStepSize, |
---|
| 89 | G4ForceCondition* condition) = 0; |
---|
| 90 | |
---|
| 91 | virtual G4VParticleChange* PostStepDoIt(const G4Track& track, |
---|
| 92 | const G4Step& Step) = 0; |
---|
| 93 | |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | protected:// with description |
---|
| 97 | |
---|
| 98 | // code for the energy loss fluctuation |
---|
| 99 | |
---|
| 100 | G4double GetLossWithFluct(const G4DynamicParticle* aParticle, |
---|
| 101 | const G4MaterialCutsCouple* couple, |
---|
| 102 | G4double ChargeSquare, |
---|
| 103 | G4double MeanLoss, |
---|
| 104 | G4double step); |
---|
| 105 | |
---|
| 106 | // Build range table starting from the DEDXtable |
---|
| 107 | G4PhysicsTable* |
---|
| 108 | BuildRangeTable(G4PhysicsTable* theDEDXTable, |
---|
| 109 | G4PhysicsTable* theRangeTable, |
---|
| 110 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 111 | |
---|
| 112 | // Build time tables starting from the DEDXtable |
---|
| 113 | G4PhysicsTable* |
---|
| 114 | BuildLabTimeTable(G4PhysicsTable* theDEDXTable, |
---|
| 115 | G4PhysicsTable* theLabTimeTable, |
---|
| 116 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 117 | |
---|
| 118 | G4PhysicsTable* |
---|
| 119 | BuildProperTimeTable(G4PhysicsTable* theDEDXTable, |
---|
| 120 | G4PhysicsTable* ProperTimeTable, |
---|
| 121 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 122 | |
---|
| 123 | // Build tables of coefficients needed for inverting the range table |
---|
| 124 | G4PhysicsTable* |
---|
| 125 | BuildRangeCoeffATable(G4PhysicsTable* theRangeTable, |
---|
| 126 | G4PhysicsTable* theCoeffATable, |
---|
| 127 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 128 | G4PhysicsTable* |
---|
| 129 | BuildRangeCoeffBTable(G4PhysicsTable* theRangeTable, |
---|
| 130 | G4PhysicsTable* theCoeffBTable, |
---|
| 131 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 132 | G4PhysicsTable* |
---|
| 133 | BuildRangeCoeffCTable(G4PhysicsTable* theRangeTable, |
---|
| 134 | G4PhysicsTable* theCoeffCTable, |
---|
| 135 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 136 | |
---|
| 137 | // Invert range table |
---|
| 138 | G4PhysicsTable* |
---|
| 139 | BuildInverseRangeTable(G4PhysicsTable* theRangeTable, |
---|
| 140 | G4PhysicsTable* theRangeCoeffATable, |
---|
| 141 | G4PhysicsTable* theRangeCoeffBTable, |
---|
| 142 | G4PhysicsTable* theRangeCoeffCTable, |
---|
| 143 | G4PhysicsTable* theInverseRangeTable, |
---|
| 144 | G4double Tmin,G4double Tmax,G4int nbin); |
---|
| 145 | |
---|
| 146 | private: |
---|
| 147 | |
---|
| 148 | // hide default constructor and assignment operator as private |
---|
| 149 | G4VEnergyLoss(); |
---|
| 150 | G4VEnergyLoss & operator=(const G4VEnergyLoss &right); |
---|
| 151 | |
---|
| 152 | void BuildRangeVector(G4PhysicsTable* theDEDXTable, |
---|
| 153 | G4double Tmin,G4double Tmax,G4int nbin, |
---|
| 154 | G4int materialIndex,G4PhysicsLogVector* rangeVector); |
---|
| 155 | |
---|
| 156 | G4double RangeIntLin(G4PhysicsVector* physicsVector,G4int nbin); |
---|
| 157 | |
---|
| 158 | G4double RangeIntLog(G4PhysicsVector* physicsVector,G4int nbin); |
---|
| 159 | |
---|
| 160 | void BuildLabTimeVector(G4PhysicsTable* theDEDXTable, |
---|
| 161 | G4double Tmin,G4double Tmax,G4int nbin, |
---|
| 162 | G4int materialIndex,G4PhysicsLogVector* rangeVector); |
---|
| 163 | |
---|
| 164 | void BuildProperTimeVector(G4PhysicsTable* theDEDXTable, |
---|
| 165 | G4double Tmin,G4double Tmax,G4int nbin, |
---|
| 166 | G4int materialIndex,G4PhysicsLogVector* rangeVector); |
---|
| 167 | |
---|
| 168 | G4double LabTimeIntLog(G4PhysicsVector* physicsVector,G4int nbin); |
---|
| 169 | |
---|
| 170 | G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,G4int nbin); |
---|
| 171 | |
---|
| 172 | void InvertRangeVector(G4PhysicsTable* theRangeTable, |
---|
| 173 | G4PhysicsTable* theRangeCoeffATable, |
---|
| 174 | G4PhysicsTable* theRangeCoeffBTable, |
---|
| 175 | G4PhysicsTable* theRangeCoeffCTable, |
---|
| 176 | G4double Tmin,G4double Tmax,G4int nbin, |
---|
| 177 | G4int materialIndex,G4PhysicsLogVector* rangeVector); |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | protected: |
---|
| 181 | |
---|
| 182 | G4double ParticleMass; |
---|
| 183 | |
---|
| 184 | private: |
---|
| 185 | |
---|
| 186 | // data members to speed up the fluctuation calculation |
---|
| 187 | const G4Material* lastMaterial; |
---|
| 188 | G4int imat; |
---|
| 189 | G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct; |
---|
| 190 | G4double e1LogFluct,e2LogFluct,ipotLogFluct; |
---|
| 191 | |
---|
| 192 | const G4int nmaxCont1,nmaxCont2 ; |
---|
| 193 | |
---|
| 194 | // for some integration routines |
---|
| 195 | G4double taulow,tauhigh,ltaulow,ltauhigh; |
---|
| 196 | |
---|
| 197 | // static part of the class |
---|
| 198 | |
---|
| 199 | public: // With description |
---|
| 200 | |
---|
| 201 | static void SetRndmStep(G4bool value); |
---|
| 202 | // use / do not use randomisation in energy loss steplimit |
---|
| 203 | // ( default = no randomisation) |
---|
| 204 | |
---|
| 205 | static void SetEnlossFluc(G4bool value); |
---|
| 206 | // compute energy loss with/without fluctuation |
---|
| 207 | // ( default : with fluctuation) |
---|
| 208 | |
---|
| 209 | static void SetSubSec(G4bool value); |
---|
| 210 | // switch on/off the generation of the subcutoff secondaries |
---|
| 211 | // ( default = no subcutoff secondary generation ) |
---|
| 212 | |
---|
| 213 | static void SetMinDeltaCutInRange(G4double value); |
---|
| 214 | // sets minimal cut value for the subcutoff secondaries |
---|
| 215 | // (i.e. the kinetic energy of these secondaries can not be |
---|
| 216 | // smaller than the energy corresponds to MinDeltaCutInRange). |
---|
| 217 | |
---|
| 218 | |
---|
| 219 | static void SetStepFunction (G4double c1, G4double c2); |
---|
| 220 | // sets values for data members used to compute the step limit: |
---|
| 221 | // dRoverRange : max. relative range change in one step, |
---|
| 222 | // finalRange : if range <= finalRange --> last step for the particle. |
---|
| 223 | |
---|
| 224 | |
---|
| 225 | protected: // With description |
---|
| 226 | |
---|
| 227 | static G4bool EqualCutVectors( G4double* vec1, G4double* vec2 ); |
---|
| 228 | static G4double* CopyCutVectors( G4double* dest, G4double* source ); |
---|
| 229 | G4bool CutsWhereModified(); |
---|
| 230 | |
---|
| 231 | // data members |
---|
| 232 | protected: |
---|
| 233 | |
---|
| 234 | static G4double dRoverRange; // dRoverRange is the maximum allowed |
---|
| 235 | // deltarange/range in one Step |
---|
| 236 | static G4double finalRange; // final step before stopping |
---|
| 237 | static G4double finalRangeRequested; //from UI command |
---|
| 238 | static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit |
---|
| 239 | |
---|
| 240 | static G4bool rndmStepFlag; // control the randomization of the step |
---|
| 241 | static G4bool EnlossFlucFlag; // control the energy loss fluctuation |
---|
| 242 | static G4bool subSecFlag; // control the generation of subcutoff delta |
---|
| 243 | |
---|
| 244 | static G4double MinDeltaCutInRange; // minimum cut for delta rays |
---|
| 245 | static G4double* MinDeltaEnergy ; |
---|
| 246 | static G4bool* LowerLimitForced ; |
---|
| 247 | |
---|
| 248 | static G4bool setMinDeltaCutInRange ; |
---|
| 249 | |
---|
| 250 | static G4EnergyLossMessenger* ELossMessenger; |
---|
| 251 | }; |
---|
| 252 | |
---|
| 253 | #endif |
---|
| 254 | |
---|
| 255 | |
---|
| 256 | |
---|