Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 ////////////////////////////////////////////// 26 /////////////////////////////////////////////////////////////////////////// 27 // 27 // 28 // base class for 'fast' parametrisation model 28 // base class for 'fast' parametrisation model describing X-ray transition 29 // created in some G4Envelope. Angular distrib 29 // created in some G4Envelope. Angular distribuiton is very rough !!! (see DoIt 30 // method 30 // method 31 // 31 // 32 // History: 32 // History: 33 // 06.10.05 V. Grichine first step to discret 33 // 06.10.05 V. Grichine first step to discrete process 34 // 15.01.02 V. Grichine first version 34 // 15.01.02 V. Grichine first version 35 // 28.07.05, P.Gumplinger add G4ProcessType to 35 // 28.07.05, P.Gumplinger add G4ProcessType to constructor 36 // 28.09.07, V.Ivanchenko general cleanup with 36 // 28.09.07, V.Ivanchenko general cleanup without change of algorithms 37 // 19.09.21, V. Grichine, set/get functions fo 37 // 19.09.21, V. Grichine, set/get functions for angle anf energy ranges and number of bins 38 38 39 #ifndef G4VXTRenergyLoss_h 39 #ifndef G4VXTRenergyLoss_h 40 #define G4VXTRenergyLoss_h 1 40 #define G4VXTRenergyLoss_h 1 41 41 42 #include "globals.hh" 42 #include "globals.hh" 43 #include "G4Gamma.hh" 43 #include "G4Gamma.hh" 44 #include "G4LogicalVolume.hh" 44 #include "G4LogicalVolume.hh" 45 #include "G4Material.hh" 45 #include "G4Material.hh" 46 #include "G4ParticleChange.hh" 46 #include "G4ParticleChange.hh" 47 #include "G4PhysicsTable.hh" 47 #include "G4PhysicsTable.hh" 48 #include "G4Step.hh" 48 #include "G4Step.hh" 49 #include "G4Track.hh" 49 #include "G4Track.hh" 50 #include "G4VDiscreteProcess.hh" 50 #include "G4VDiscreteProcess.hh" 51 51 52 class G4SandiaTable; 52 class G4SandiaTable; 53 class G4VParticleChange; 53 class G4VParticleChange; 54 class G4PhysicsFreeVector; 54 class G4PhysicsFreeVector; 55 class G4PhysicsLinearVector; 55 class G4PhysicsLinearVector; 56 class G4PhysicsLogVector; 56 class G4PhysicsLogVector; 57 57 58 class G4VXTRenergyLoss : public G4VDiscretePro 58 class G4VXTRenergyLoss : public G4VDiscreteProcess 59 { 59 { 60 public: 60 public: 61 explicit G4VXTRenergyLoss(G4LogicalVolume* a 61 explicit G4VXTRenergyLoss(G4LogicalVolume* anEnvelope, G4Material*, 62 G4Material*, G4dou 62 G4Material*, G4double, G4double, G4int, 63 const G4String& pr 63 const G4String& processName = "XTRenergyLoss", 64 G4ProcessType type 64 G4ProcessType type = fElectromagnetic); 65 virtual ~G4VXTRenergyLoss(); 65 virtual ~G4VXTRenergyLoss(); 66 66 67 virtual void ProcessDescription(std::ostream 67 virtual void ProcessDescription(std::ostream&) const override; 68 virtual void DumpInfo() const override { Pro 68 virtual void DumpInfo() const override { ProcessDescription(G4cout); }; 69 69 70 G4VXTRenergyLoss(G4VXTRenergyLoss&) = delete 70 G4VXTRenergyLoss(G4VXTRenergyLoss&) = delete; 71 G4VXTRenergyLoss& operator=(const G4VXTRener 71 G4VXTRenergyLoss& operator=(const G4VXTRenergyLoss& right) = delete; 72 72 73 // Virtual methods to be implemented in inhe 73 // Virtual methods to be implemented in inherited particular TR radiators 74 virtual G4double GetStackFactor(G4double ene 74 virtual G4double GetStackFactor(G4double energy, G4double gamma, 75 G4double var 75 G4double varAngle); 76 76 77 virtual G4bool IsApplicable(const G4Particle 77 virtual G4bool IsApplicable(const G4ParticleDefinition&) override; 78 78 79 virtual G4VParticleChange* PostStepDoIt(cons 79 virtual G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 80 cons 80 const G4Step& aStep) override; 81 81 82 virtual G4double GetMeanFreePath(const G4Tra 82 virtual G4double GetMeanFreePath(const G4Track& aTrack, 83 G4double pr 83 G4double previousStepSize, 84 G4ForceCond 84 G4ForceCondition* condition) override; 85 85 86 virtual void BuildPhysicsTable(const G4Parti 86 virtual void BuildPhysicsTable(const G4ParticleDefinition&) override; 87 void BuildEnergyTable(); 87 void BuildEnergyTable(); 88 void BuildAngleForEnergyBank(); 88 void BuildAngleForEnergyBank(); 89 89 90 void BuildTable(){}; 90 void BuildTable(){}; 91 void BuildAngleTable(); 91 void BuildAngleTable(); 92 void BuildGlobalAngleTable(); 92 void BuildGlobalAngleTable(); 93 93 94 G4complex OneInterfaceXTRdEdx(G4double energ 94 G4complex OneInterfaceXTRdEdx(G4double energy, G4double gamma, 95 G4double varAn 95 G4double varAngle); 96 96 97 G4double SpectralAngleXTRdEdx(G4double varAn 97 G4double SpectralAngleXTRdEdx(G4double varAngle); 98 98 99 virtual G4double SpectralXTRdEdx(G4double en 99 virtual G4double SpectralXTRdEdx(G4double energy); 100 100 101 G4double AngleSpectralXTRdEdx(G4double energ 101 G4double AngleSpectralXTRdEdx(G4double energy); 102 102 103 G4double AngleXTRdEdx(G4double varAngle); 103 G4double AngleXTRdEdx(G4double varAngle); 104 104 105 G4double OneBoundaryXTRNdensity(G4double ene 105 G4double OneBoundaryXTRNdensity(G4double energy, G4double gamma, 106 G4double var 106 G4double varAngle) const; 107 107 108 // for photon energy distribution tables 108 // for photon energy distribution tables 109 G4double XTRNSpectralAngleDensity(G4double v 109 G4double XTRNSpectralAngleDensity(G4double varAngle); 110 G4double XTRNSpectralDensity(G4double energy 110 G4double XTRNSpectralDensity(G4double energy); 111 111 112 // for photon angle distribution tables 112 // for photon angle distribution tables 113 G4double XTRNAngleSpectralDensity(G4double e 113 G4double XTRNAngleSpectralDensity(G4double energy); 114 G4double XTRNAngleDensity(G4double varAngle) 114 G4double XTRNAngleDensity(G4double varAngle); 115 115 116 void GetNumberOfPhotons(); 116 void GetNumberOfPhotons(); 117 117 118 // Auxiliary functions for plate/gas materia 118 // Auxiliary functions for plate/gas material parameters 119 G4double GetPlateFormationZone(G4double, G4d 119 G4double GetPlateFormationZone(G4double, G4double, G4double); 120 G4complex GetPlateComplexFZ(G4double, G4doub 120 G4complex GetPlateComplexFZ(G4double, G4double, G4double); 121 void ComputePlatePhotoAbsCof(); 121 void ComputePlatePhotoAbsCof(); 122 G4double GetPlateLinearPhotoAbs(G4double); 122 G4double GetPlateLinearPhotoAbs(G4double); 123 void GetPlateZmuProduct(); 123 void GetPlateZmuProduct(); 124 G4double GetPlateZmuProduct(G4double, G4doub 124 G4double GetPlateZmuProduct(G4double, G4double, G4double); 125 125 126 G4double GetGasFormationZone(G4double, G4dou 126 G4double GetGasFormationZone(G4double, G4double, G4double); 127 G4complex GetGasComplexFZ(G4double, G4double 127 G4complex GetGasComplexFZ(G4double, G4double, G4double); 128 void ComputeGasPhotoAbsCof(); 128 void ComputeGasPhotoAbsCof(); 129 G4double GetGasLinearPhotoAbs(G4double); 129 G4double GetGasLinearPhotoAbs(G4double); 130 void GetGasZmuProduct(); 130 void GetGasZmuProduct(); 131 G4double GetGasZmuProduct(G4double, G4double 131 G4double GetGasZmuProduct(G4double, G4double, G4double); 132 132 133 G4double GetPlateCompton(G4double); 133 G4double GetPlateCompton(G4double); 134 G4double GetGasCompton(G4double); 134 G4double GetGasCompton(G4double); 135 G4double GetComptonPerAtom(G4double, G4doubl 135 G4double GetComptonPerAtom(G4double, G4double); 136 136 137 G4double GetXTRrandomEnergy(G4double scaledT 137 G4double GetXTRrandomEnergy(G4double scaledTkin, G4int iTkin); 138 G4double GetXTRenergy(G4int iPlace, G4double 138 G4double GetXTRenergy(G4int iPlace, G4double position, G4int iTransfer); 139 139 140 G4double GetRandomAngle(G4double energyXTR, 140 G4double GetRandomAngle(G4double energyXTR, G4int iTkin); 141 G4double GetAngleXTR(G4int iTR, G4double pos 141 G4double GetAngleXTR(G4int iTR, G4double position, G4int iAngle); 142 142 143 // set/get methods for class fields 143 // set/get methods for class fields 144 144 145 void SetGamma(G4double gamma) { fGamma = 145 void SetGamma(G4double gamma) { fGamma = gamma; }; 146 G4double GetGamma() { return fGamma; }; 146 G4double GetGamma() { return fGamma; }; 147 void SetEnergy(G4double energy) { fEnerg 147 void SetEnergy(G4double energy) { fEnergy = energy; }; 148 G4double GetEnergy() { return fEnergy; }; 148 G4double GetEnergy() { return fEnergy; }; 149 void SetVarAngle(G4double varAngle) { fV 149 void SetVarAngle(G4double varAngle) { fVarAngle = varAngle; }; 150 G4double GetVarAngle() { return fVarAngle; } 150 G4double GetVarAngle() { return fVarAngle; }; 151 void SetCompton(G4bool pC) { fCompton = pC 151 void SetCompton(G4bool pC) { fCompton = pC; }; 152 G4bool GetCompton() { return fCompton; }; 152 G4bool GetCompton() { return fCompton; }; 153 153 154 G4int GetKrange(){ return fKrange;}; << 155 void SetKrange( G4int kk ){ fKrange = kk;}; << 156 154 157 155 158 void SetAlphaGas(G4double ag){ fAlphaGas 156 void SetAlphaGas(G4double ag){ fAlphaGas = ag;}; 159 G4double GetAlphaGas() { return fAlphaGas; } 157 G4double GetAlphaGas() { return fAlphaGas; }; 160 void SetAlphaPlate(G4double ap){ fAlphaP 158 void SetAlphaPlate(G4double ap){ fAlphaPlate = ap;}; 161 G4double GetAlphaPlate() { return fAlphaPlat 159 G4double GetAlphaPlate() { return fAlphaPlate; }; 162 160 163 void SetTheMinEnergyTR(G4double minetr){ 161 void SetTheMinEnergyTR(G4double minetr){ fTheMinEnergyTR = minetr;}; 164 G4double GetTheMinEnergyTR() { return fTheMi 162 G4double GetTheMinEnergyTR() { return fTheMinEnergyTR; }; 165 void SetTheMaxEnergyTR(G4double maxetr){ 163 void SetTheMaxEnergyTR(G4double maxetr){ fTheMaxEnergyTR = maxetr;}; 166 G4double GetTheMaxEnergyTR() { return fTheMa 164 G4double GetTheMaxEnergyTR() { return fTheMaxEnergyTR; }; 167 165 168 void SetMinEnergyTR(G4double minetr){ fM 166 void SetMinEnergyTR(G4double minetr){ fMinEnergyTR = minetr;}; 169 G4double GetMinEnergyTR() { return fMinEnerg 167 G4double GetMinEnergyTR() { return fMinEnergyTR; }; 170 void SetMaxEnergyTR(G4double maxetr){ fM 168 void SetMaxEnergyTR(G4double maxetr){ fMaxEnergyTR = maxetr;}; 171 G4double GetMaxEnergyTR() { return fMaxEnerg 169 G4double GetMaxEnergyTR() { return fMaxEnergyTR; }; 172 170 173 void SetTheMinAngle(G4double minang){ fT 171 void SetTheMinAngle(G4double minang){ fTheMinAngle = minang;}; 174 G4double GetTheMinAngle() { return fTheMinAn 172 G4double GetTheMinAngle() { return fTheMinAngle; }; 175 void SetTheMaxAngle(G4double maxang){ fT 173 void SetTheMaxAngle(G4double maxang){ fTheMaxAngle = maxang;}; 176 G4double GetTheMaxAngle() { return fTheMaxAn 174 G4double GetTheMaxAngle() { return fTheMaxAngle; }; 177 175 178 void SetMinThetaTR(G4double minatr){ fMi 176 void SetMinThetaTR(G4double minatr){ fMinThetaTR = minatr;}; 179 G4double GetMinThetaTR() { return fMinThetaT 177 G4double GetMinThetaTR() { return fMinThetaTR; }; 180 void SetMaxThetaTR(G4double maxatr){ fMa 178 void SetMaxThetaTR(G4double maxatr){ fMaxThetaTR = maxatr;}; 181 G4double GetMaxThetaTR() { return fMaxThetaT 179 G4double GetMaxThetaTR() { return fMaxThetaTR; }; 182 180 183 // modes of XTR angle distribution 181 // modes of XTR angle distribution 184 182 185 void SetFastAngle(G4bool fatr){ fFastAngle 183 void SetFastAngle(G4bool fatr){ fFastAngle = fatr;}; 186 G4bool GetFastAngle() { return fFastAngle; } 184 G4bool GetFastAngle() { return fFastAngle; }; 187 void SetAngleRadDistr(G4bool fatr){ fAngle 185 void SetAngleRadDistr(G4bool fatr){ fAngleRadDistr = fatr;}; 188 G4bool GetAngleRadDistr() { return fAngleRad 186 G4bool GetAngleRadDistr() { return fAngleRadDistr; }; 189 187 190 188 191 189 192 190 193 G4PhysicsLogVector* GetProtonVector() { retu 191 G4PhysicsLogVector* GetProtonVector() { return fProtonEnergyVector; }; 194 G4int GetTotBin() { return fTotBin; }; 192 G4int GetTotBin() { return fTotBin; }; 195 G4PhysicsFreeVector* GetAngleVector(G4double 193 G4PhysicsFreeVector* GetAngleVector(G4double energy, G4int n); 196 194 197 protected: 195 protected: 198 // min TR energy 196 // min TR energy 199 G4double fTheMinEnergyTR; 197 G4double fTheMinEnergyTR; 200 // max TR energy 198 // max TR energy 201 G4double fTheMaxEnergyTR; 199 G4double fTheMaxEnergyTR; 202 G4double fTheMinAngle; // min theta of TR 200 G4double fTheMinAngle; // min theta of TR quanta 203 G4double fTheMaxAngle; // 1.e-4; // max 201 G4double fTheMaxAngle; // 1.e-4; // max theta of TR quanta 204 202 205 // static const members 203 // static const members 206 204 207 // min Tkin of proton in tables 205 // min Tkin of proton in tables 208 static constexpr G4double fMinProtonTkin = 1 206 static constexpr G4double fMinProtonTkin = 100. * CLHEP::GeV; 209 // max Tkin of proton in tables 207 // max Tkin of proton in tables 210 static constexpr G4double fMaxProtonTkin = 1 208 static constexpr G4double fMaxProtonTkin = 100. * CLHEP::TeV; 211 // physical constants for plasma energy 209 // physical constants for plasma energy 212 static constexpr G4double fPlasmaCof = 210 static constexpr G4double fPlasmaCof = 213 4. * CLHEP::pi * CLHEP::fine_structure_con 211 4. * CLHEP::pi * CLHEP::fine_structure_const * CLHEP::hbarc * CLHEP::hbarc * 214 CLHEP::hbarc / CLHEP::electron_mass_c2; 212 CLHEP::hbarc / CLHEP::electron_mass_c2; 215 static constexpr G4double fCofTR = CLHEP::fi 213 static constexpr G4double fCofTR = CLHEP::fine_structure_const / CLHEP::pi; 216 214 217 G4int fTotBin; // number of bins in log-ga 215 G4int fTotBin; // number of bins in log-gamma scale 218 G4int fBinTR; // number of bins in TR ene 216 G4int fBinTR; // number of bins in TR energy-angle vectors 219 G4int fKrange; << 217 220 G4ParticleDefinition* fPtrGamma; // pointer 218 G4ParticleDefinition* fPtrGamma; // pointer to TR photon 221 219 222 G4double* fGammaCutInKineticEnergy; // TR p 220 G4double* fGammaCutInKineticEnergy; // TR photon cut in energy array 223 G4LogicalVolume* fEnvelope; 221 G4LogicalVolume* fEnvelope; 224 G4PhysicsTable* fAngleDistrTable; 222 G4PhysicsTable* fAngleDistrTable; 225 G4PhysicsTable* fEnergyDistrTable; 223 G4PhysicsTable* fEnergyDistrTable; 226 G4PhysicsTable* fAngleForEnergyTable; 224 G4PhysicsTable* fAngleForEnergyTable; 227 G4PhysicsLogVector* fProtonEnergyVector; 225 G4PhysicsLogVector* fProtonEnergyVector; 228 G4PhysicsLogVector* fXTREnergyVector; 226 G4PhysicsLogVector* fXTREnergyVector; 229 G4SandiaTable* fPlatePhotoAbsCof; 227 G4SandiaTable* fPlatePhotoAbsCof; 230 G4SandiaTable* fGasPhotoAbsCof; 228 G4SandiaTable* fGasPhotoAbsCof; 231 229 232 G4ParticleChange fParticleChange; 230 G4ParticleChange fParticleChange; 233 std::vector<G4PhysicsTable*> fAngleBank; 231 std::vector<G4PhysicsTable*> fAngleBank; 234 232 235 G4double fGammaTkinCut; // Tkin cut of TR p 233 G4double fGammaTkinCut; // Tkin cut of TR photon in current mat. 236 G4double fMinEnergyTR; // min TR energy i 234 G4double fMinEnergyTR; // min TR energy in material 237 G4double fMaxEnergyTR; // max TR energy i 235 G4double fMaxEnergyTR; // max TR energy in material 238 G4double fMinThetaTR, fMaxThetaTR; // mi 236 G4double fMinThetaTR, fMaxThetaTR; // min-max theta of TR quanta 239 G4double fTotalDist; 237 G4double fTotalDist; 240 G4double fPlateThick; 238 G4double fPlateThick; 241 G4double fGasThick; 239 G4double fGasThick; 242 G4double fAlphaPlate; 240 G4double fAlphaPlate; 243 G4double fAlphaGas; 241 G4double fAlphaGas; 244 G4double fGamma; // current Lorentz fact 242 G4double fGamma; // current Lorentz factor 245 G4double fEnergy; // energy and 243 G4double fEnergy; // energy and 246 G4double fVarAngle; // angle squared! 244 G4double fVarAngle; // angle squared! 247 G4double fLambda; 245 G4double fLambda; 248 G4double fSigma1; 246 G4double fSigma1; 249 G4double fSigma2; // plasma energy Sq of ma 247 G4double fSigma2; // plasma energy Sq of matter1/2 250 248 251 G4int fMatIndex1; 249 G4int fMatIndex1; 252 G4int fMatIndex2; 250 G4int fMatIndex2; 253 G4int fPlateNumber; 251 G4int fPlateNumber; 254 252 255 G4bool fExitFlux; 253 G4bool fExitFlux; 256 G4bool fFastAngle, fAngleRadDistr; 254 G4bool fFastAngle, fAngleRadDistr; 257 G4bool fCompton; 255 G4bool fCompton; 258 << 259 G4int secID = -1; // creator modelID << 260 }; 256 }; 261 257 262 #endif 258 #endif 263 259