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 // 28 // 29 // GEANT4 Class header file 29 // GEANT4 Class header file 30 // 30 // 31 // 31 // 32 // File name: G4PAIModel 32 // File name: G4PAIModel 33 // 33 // 34 // Author: V. Grichine based on Vladimi 34 // Author: V. Grichine based on Vladimir Ivanchenko code 35 // 35 // 36 // Creation date: 05.10.2003 36 // Creation date: 05.10.2003 37 // 37 // 38 // Modifications: 38 // Modifications: 39 // 08-04-05 Major optimisation of internal int 39 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 40 // 26-09-07 Fixed tmax computation (V.Ivantche 40 // 26-09-07 Fixed tmax computation (V.Ivantchenko) 41 // 19.08.13 V.Ivanchenko extract data handling << 42 // added sharing of internal data bet << 43 // 41 // 44 // 42 // 45 // Class Description: 43 // Class Description: 46 // 44 // 47 // Implementation of PAI model of energy loss 45 // Implementation of PAI model of energy loss and 48 // delta-electron production by heavy charged 46 // delta-electron production by heavy charged particles 49 47 50 // ------------------------------------------- 48 // ------------------------------------------------------------------- 51 // 49 // 52 50 53 #ifndef G4PAIModel_h 51 #ifndef G4PAIModel_h 54 #define G4PAIModel_h 1 52 #define G4PAIModel_h 1 55 53 56 #include <CLHEP/Units/PhysicalConstants.h> << 54 #include <vector> 57 << 58 #include "G4VEmModel.hh" 55 #include "G4VEmModel.hh" 59 #include "G4VEmFluctuationModel.hh" << 60 #include "globals.hh" 56 #include "globals.hh" 61 #include <vector> << 57 #include "G4VEmFluctuationModel.hh" >> 58 #include "G4PAIySection.hh" 62 59 >> 60 class G4PhysicsLogVector; >> 61 class G4PhysicsTable; 63 class G4Region; 62 class G4Region; 64 class G4MaterialCutsCouple; 63 class G4MaterialCutsCouple; 65 class G4ParticleChangeForLoss; 64 class G4ParticleChangeForLoss; 66 class G4PAIModelData; << 67 65 68 class G4PAIModel final : public G4VEmModel, pu << 66 class G4PAIModel : public G4VEmModel, public G4VEmFluctuationModel 69 { 67 { 70 68 71 public: 69 public: 72 70 73 explicit G4PAIModel(const G4ParticleDefiniti << 71 G4PAIModel(const G4ParticleDefinition* p = 0, const G4String& nam = "PAI"); 74 const G4String& nam = "PAI"); << 75 72 76 ~G4PAIModel() final; << 73 virtual ~G4PAIModel(); 77 74 78 void Initialise(const G4ParticleDefinition*, << 75 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 79 76 80 void InitialiseLocal(const G4ParticleDefinit << 77 virtual void InitialiseMe(const G4ParticleDefinition*) {}; 81 G4VEmModel* masterModel << 82 78 83 G4double MinEnergyCut(const G4ParticleDefini << 79 virtual G4double ComputeDEDX(const G4MaterialCutsCouple*, 84 const G4MaterialCutsCo << 80 const G4ParticleDefinition*, >> 81 G4double kineticEnergy, >> 82 G4double cutEnergy); 85 83 86 G4double ComputeDEDXPerVolume(const G4Materi << 84 virtual G4double CrossSection(const G4MaterialCutsCouple*, 87 const G4ParticleDefinition*, << 85 const G4ParticleDefinition*, 88 G4double kineticEnergy, << 86 G4double kineticEnergy, 89 G4double cutEnergy) final; << 87 G4double cutEnergy, >> 88 G4double maxEnergy); 90 89 91 G4double CrossSectionPerVolume(const G4Mater << 90 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 92 const G4ParticleDefinition*, << 93 G4double kineticEnergy, << 94 G4double cutEnergy, << 95 G4double maxEnergy) final; << 96 << 97 void SampleSecondaries(std::vector<G4Dynamic << 98 const G4MaterialCutsCouple*, 91 const G4MaterialCutsCouple*, 99 const G4DynamicParticle*, 92 const G4DynamicParticle*, 100 G4double tmin, 93 G4double tmin, 101 G4double maxEnergy) final; << 94 G4double maxEnergy); >> 95 >> 96 virtual G4double SampleFluctuations(const G4Material*, >> 97 const G4DynamicParticle*, >> 98 G4double&, >> 99 G4double&, >> 100 G4double&); >> 101 >> 102 virtual G4double Dispersion( const G4Material*, >> 103 const G4DynamicParticle*, >> 104 G4double&, >> 105 G4double&); >> 106 >> 107 void DefineForRegion(const G4Region* r) ; >> 108 void ComputeSandiaPhotoAbsCof(); >> 109 void BuildPAIonisationTable(); >> 110 void BuildLambdaVector(); >> 111 >> 112 G4double GetdNdxCut( G4int iPlace, G4double transferCut); >> 113 G4double GetdEdxCut( G4int iPlace, G4double transferCut); >> 114 G4double GetPostStepTransfer( G4double scaledTkin ); >> 115 G4double GetEnergyTransfer( G4int iPlace, >> 116 G4double position, >> 117 G4int iTransfer ); 102 118 103 G4double SampleFluctuations(const G4Material << 119 void SetVerboseLevel(G4int verbose){fVerbose=verbose;}; 104 const G4DynamicParticle*, << 105 const G4double, const G4double, << 106 const G4double, << 107 120 108 G4double Dispersion(const G4Material*, const << 109 const G4double, const G4double, << 110 const G4double) final; << 111 121 112 void DefineForRegion(const G4Region* r) fina << 113 122 114 inline G4PAIModelData* GetPAIModelData(); << 123 protected: 115 124 116 inline const std::vector<const G4MaterialCut << 125 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, >> 126 G4double kinEnergy); 117 127 118 inline G4double ComputeMaxEnergy(G4double sc << 128 private: 119 129 120 inline void SetVerboseLevel(G4int verbose); << 130 void SetParticle(const G4ParticleDefinition* p); 121 131 122 // hide assignment operator 132 // hide assignment operator 123 G4PAIModel & operator=(const G4PAIModel &ri << 133 G4PAIModel & operator=(const G4PAIModel &right); 124 G4PAIModel(const G4PAIModel&) = delete; << 134 G4PAIModel(const G4PAIModel&); 125 135 126 protected: << 136 // The vector over proton kinetic energies: the range of gammas >> 137 G4int fVerbose; >> 138 G4double fLowestGamma; >> 139 G4double fHighestGamma; >> 140 G4double fLowestKineticEnergy; >> 141 G4double fHighestKineticEnergy; >> 142 G4int fTotBin; >> 143 G4int fMeanNumber; >> 144 G4PhysicsLogVector* fParticleEnergyVector ; >> 145 G4PAIySection fPAIySection; 127 146 128 G4double MaxSecondaryEnergy(const G4Particle << 147 // vectors 129 G4double kinEner << 130 148 131 private: << 149 G4PhysicsTable* fPAItransferTable; >> 150 std::vector<G4PhysicsTable*> fPAIxscBank; 132 151 133 inline G4int FindCoupleIndex(const G4Materia << 152 G4PhysicsTable* fPAIdEdxTable; >> 153 std::vector<G4PhysicsTable*> fPAIdEdxBank; 134 154 135 inline void SetParticle(const G4ParticleDefi << 155 std::vector<const G4MaterialCutsCouple*> fMaterialCutsCoupleVector; >> 156 std::vector<const G4Region*> fPAIRegionVector; 136 157 137 G4int fVerbose; << 158 const G4MaterialCutsCouple* fCutCouple; >> 159 const G4Material* fMaterial; >> 160 G4double fDeltaCutInKinEnergy; 138 161 139 G4PAIModelData* fModelData; << 162 size_t fMatIndex ; >> 163 G4double** fSandiaPhotoAbsCof ; >> 164 G4int fSandiaIntervalNumber ; 140 165 141 std::vector<const G4MaterialCutsCouple*> fMa << 166 G4PhysicsLogVector* fdEdxVector ; 142 std::vector<const G4Region*> fPAIRegion << 167 std::vector<G4PhysicsLogVector*> fdEdxTable ; >> 168 >> 169 G4PhysicsLogVector* fLambdaVector ; >> 170 std::vector<G4PhysicsLogVector*> fLambdaTable ; >> 171 >> 172 G4PhysicsLogVector* fdNdxCutVector ; >> 173 std::vector<G4PhysicsLogVector*> fdNdxCutTable ; 143 174 144 const G4ParticleDefinition* fParticle; 175 const G4ParticleDefinition* fParticle; 145 const G4ParticleDefinition* fElectron; 176 const G4ParticleDefinition* fElectron; 146 const G4ParticleDefinition* fPositron; 177 const G4ParticleDefinition* fPositron; 147 G4ParticleChangeForLoss* fParticleChange; 178 G4ParticleChangeForLoss* fParticleChange; 148 179 149 G4double fMass; 180 G4double fMass; 150 G4double fRatio; << 181 G4double fSpin; 151 G4double fChargeSquare; 182 G4double fChargeSquare; 152 G4double fLowestTcut; << 183 G4double fRatio; >> 184 G4double fHighKinEnergy; >> 185 G4double fLowKinEnergy; >> 186 G4double fTwoln10; >> 187 G4double fBg2lim; >> 188 G4double fTaulim; >> 189 G4double fQc; >> 190 >> 191 G4bool isInitialised; 153 }; 192 }; 154 193 155 inline G4PAIModelData* G4PAIModel::GetPAIModel << 194 ///////////////////////////////////////////////////////////////////// 156 { << 157 return fModelData; << 158 } << 159 195 160 inline const std::vector<const G4MaterialCutsC << 196 inline G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 161 G4PAIModel::GetVectorOfCouples() << 197 G4double kinEnergy) 162 { 198 { 163 return fMaterialCutsCoupleVector; << 199 G4double tmax = kinEnergy; >> 200 if(p == fElectron) tmax *= 0.5; >> 201 else if(p != fPositron) { >> 202 G4double mass = p->GetPDGMass(); >> 203 G4double ratio= electron_mass_c2/mass; >> 204 G4double gamma= kinEnergy/mass + 1.0; >> 205 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / >> 206 (1. + 2.0*gamma*ratio + ratio*ratio); >> 207 } >> 208 return tmax; 164 } 209 } 165 210 166 inline G4double G4PAIModel::ComputeMaxEnergy(G << 211 /////////////////////////////////////////////////////////////// >> 212 >> 213 inline void G4PAIModel::DefineForRegion(const G4Region* r) 167 { 214 { 168 return MaxSecondaryEnergy(fParticle, scaledE << 215 fPAIRegionVector.push_back(r); 169 } 216 } 170 217 171 inline void G4PAIModel::SetVerboseLevel(G4int << 218 #endif 172 { << 219 173 fVerbose=verbose; << 220 174 } << 221 >> 222 175 223 176 inline G4int G4PAIModel::FindCoupleIndex(const << 177 { << 178 G4int idx = -1; << 179 G4int jMatMax = (G4int)fMaterialCutsCoupleVe << 180 for(G4int jMat = 0;jMat < jMatMax; ++jMat) { << 181 if(couple == fMaterialCutsCoupleVector[jMa << 182 idx = jMat; << 183 break; << 184 } << 185 } << 186 return idx; << 187 } << 188 224 189 inline void G4PAIModel::SetParticle(const G4Pa << 190 { << 191 if(fParticle != p) { << 192 fParticle = p; << 193 fMass = fParticle->GetPDGMass(); << 194 fRatio = CLHEP::proton_mass_c2/fMass; << 195 G4double q = fParticle->GetPDGCharge()/CLH << 196 fChargeSquare = q*q; << 197 } << 198 } << 199 225 200 #endif << 201 226