Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // 27 // ------------------------------------------- 24 // ------------------------------------------------------------------- 28 // 25 // 29 // GEANT4 Class header file 26 // GEANT4 Class header file 30 // 27 // 31 // 28 // 32 // File name: G4PAIModel 29 // File name: G4PAIModel 33 // 30 // 34 // Author: V. Grichine based on Vladimi 31 // Author: V. Grichine based on Vladimir Ivanchenko code 35 // 32 // 36 // Creation date: 05.10.2003 33 // Creation date: 05.10.2003 37 // 34 // 38 // Modifications: 35 // Modifications: 39 // 08-04-05 Major optimisation of internal int << 40 // 26-09-07 Fixed tmax computation (V.Ivantche << 41 // 19.08.13 V.Ivanchenko extract data handling << 42 // added sharing of internal data bet << 43 // 36 // 44 // 37 // 45 // Class Description: 38 // Class Description: 46 // 39 // 47 // Implementation of PAI model of energy loss 40 // Implementation of PAI model of energy loss and 48 // delta-electron production by heavy charged 41 // delta-electron production by heavy charged particles 49 42 50 // ------------------------------------------- 43 // ------------------------------------------------------------------- 51 // 44 // 52 45 53 #ifndef G4PAIModel_h 46 #ifndef G4PAIModel_h 54 #define G4PAIModel_h 1 47 #define G4PAIModel_h 1 55 48 56 #include <CLHEP/Units/PhysicalConstants.h> << 49 #include <vector> 57 << 58 #include "G4VEmModel.hh" 50 #include "G4VEmModel.hh" 59 #include "G4VEmFluctuationModel.hh" << 60 #include "globals.hh" 51 #include "globals.hh" 61 #include <vector> << 52 #include "G4VEmFluctuationModel.hh" 62 53 >> 54 class G4PhysicsLogVector; >> 55 class G4PhysicsTable; 63 class G4Region; 56 class G4Region; 64 class G4MaterialCutsCouple; 57 class G4MaterialCutsCouple; 65 class G4ParticleChangeForLoss; << 66 class G4PAIModelData; << 67 58 68 class G4PAIModel final : public G4VEmModel, pu << 59 >> 60 class G4PAIModel : public G4VEmModel, public G4VEmFluctuationModel 69 { 61 { 70 62 71 public: 63 public: 72 64 73 explicit G4PAIModel(const G4ParticleDefiniti << 65 G4PAIModel(const G4ParticleDefinition* p = 0, const G4String& nam = "PAI"); 74 const G4String& nam = "PAI"); << 75 66 76 ~G4PAIModel() final; << 67 ~G4PAIModel(); 77 68 78 void Initialise(const G4ParticleDefinition*, << 69 void Initialise(const G4ParticleDefinition*, const G4DataVector&); 79 70 80 void InitialiseLocal(const G4ParticleDefinit << 71 81 G4VEmModel* masterModel << 72 void InitialiseMe(const G4ParticleDefinition*) {}; 82 73 83 G4double MinEnergyCut(const G4ParticleDefini << 74 G4double HighEnergyLimit(const G4ParticleDefinition* p); 84 const G4MaterialCutsCo << 75 >> 76 G4double LowEnergyLimit(const G4ParticleDefinition* p); >> 77 >> 78 void SetHighEnergyLimit(G4double e) {fHighKinEnergy = e;}; 85 79 86 G4double ComputeDEDXPerVolume(const G4Materi << 80 void SetLowEnergyLimit(G4double e) {fLowKinEnergy = e;}; 87 const G4ParticleDefinition*, << 88 G4double kineticEnergy, << 89 G4double cutEnergy) final; << 90 81 91 G4double CrossSectionPerVolume(const G4Mater << 82 G4double MinEnergyCut(const G4ParticleDefinition*, 92 const G4ParticleDefinition*, << 83 const G4MaterialCutsCouple*); 93 G4double kineticEnergy, << 94 G4double cutEnergy, << 95 G4double maxEnergy) final; << 96 84 97 void SampleSecondaries(std::vector<G4Dynamic << 85 G4bool IsInCharge(const G4ParticleDefinition*); 98 const G4MaterialCutsCouple*, << 99 const G4DynamicParticle*, << 100 G4double tmin, << 101 G4double maxEnergy) final; << 102 86 103 G4double SampleFluctuations(const G4Material << 87 G4double ComputeDEDX(const G4MaterialCutsCouple*, 104 const G4DynamicParticle*, << 88 const G4ParticleDefinition*, 105 const G4double, const G4double, << 89 G4double kineticEnergy, 106 const G4double, << 90 G4double cutEnergy); >> 91 >> 92 G4double CrossSection(const G4MaterialCutsCouple*, >> 93 const G4ParticleDefinition*, >> 94 G4double kineticEnergy, >> 95 G4double cutEnergy, >> 96 G4double maxEnergy); >> 97 >> 98 G4DynamicParticle* SampleSecondary( >> 99 const G4MaterialCutsCouple*, >> 100 const G4DynamicParticle*, >> 101 G4double tmin, >> 102 G4double maxEnergy); >> 103 >> 104 std::vector<G4DynamicParticle*>* SampleSecondaries( >> 105 const G4MaterialCutsCouple*, >> 106 const G4DynamicParticle*, >> 107 G4double tmin, >> 108 G4double maxEnergy); >> 109 >> 110 G4double MaxSecondaryEnergy(const G4DynamicParticle*); >> 111 >> 112 G4double SampleFluctuations(const G4Material*, >> 113 const G4DynamicParticle*, >> 114 G4double&, >> 115 G4double&, >> 116 G4double&); >> 117 >> 118 G4double Dispersion( const G4Material*, >> 119 const G4DynamicParticle*, >> 120 G4double&, >> 121 G4double&); >> 122 >> 123 void DefineForRegion(const G4Region* r) ; >> 124 void ComputeSandiaPhotoAbsCof(); >> 125 void BuildPAIonisationTable(); >> 126 void BuildLambdaVector(const G4MaterialCutsCouple* matCutsCouple); >> 127 G4double GetdNdxCut( G4int iPlace, G4double transferCut); >> 128 G4double GetdEdxCut( G4int iPlace, G4double transferCut); >> 129 G4double GetPostStepTransfer( G4double scaledTkin ); >> 130 G4double GetEnergyTransfer( G4int iPlace, >> 131 G4double position, >> 132 G4int iTransfer ); 107 133 108 G4double Dispersion(const G4Material*, const << 109 const G4double, const G4double, << 110 const G4double) final; << 111 134 112 void DefineForRegion(const G4Region* r) fina << 113 135 114 inline G4PAIModelData* GetPAIModelData(); << 136 protected: 115 137 116 inline const std::vector<const G4MaterialCut << 138 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, >> 139 G4double kinEnergy); 117 140 118 inline G4double ComputeMaxEnergy(G4double sc << 141 private: 119 142 120 inline void SetVerboseLevel(G4int verbose); << 143 void SetParticle(const G4ParticleDefinition* p); 121 144 122 // hide assignment operator 145 // hide assignment operator 123 G4PAIModel & operator=(const G4PAIModel &ri << 146 G4PAIModel & operator=(const G4PAIModel &right); 124 G4PAIModel(const G4PAIModel&) = delete; << 147 G4PAIModel(const G4PAIModel&); 125 148 126 protected: << 149 // The vector over proton kinetic energies: the range of gammas 127 150 128 G4double MaxSecondaryEnergy(const G4Particle << 151 G4double fLowestKineticEnergy; 129 G4double kinEner << 152 G4double fHighestKineticEnergy; >> 153 G4int fTotBin; >> 154 G4int fMeanNumber; >> 155 G4PhysicsLogVector* fProtonEnergyVector ; 130 156 131 private: << 132 157 133 inline G4int FindCoupleIndex(const G4Materia << 134 158 135 inline void SetParticle(const G4ParticleDefi << 159 // vectors >> 160 G4PhysicsTable* fPAItransferBank; >> 161 std::vector<G4PhysicsTable*> fPAIxscBank; >> 162 G4PhysicsTable* fPAIdEdxTable; >> 163 std::vector<G4PhysicsTable*> fPAIdEdxBank; >> 164 std::vector<const G4MaterialCutsCouple*> fMaterialCutsCoupleVector; >> 165 std::vector<const G4Region*> fPAIRegionVector; >> 166 size_t fMatIndex ; >> 167 G4double** fSandiaPhotoAbsCof ; >> 168 G4int fSandiaIntervalNumber ; 136 169 137 G4int fVerbose; << 170 G4PhysicsLogVector* fdEdxVector ; >> 171 std::vector<G4PhysicsLogVector*> fdEdxTable ; >> 172 G4PhysicsLogVector* fLambdaVector ; >> 173 std::vector<G4PhysicsLogVector*> fLambdaTable ; >> 174 G4PhysicsLogVector* fdNdxCutVector ; >> 175 std::vector<G4PhysicsLogVector*> fdNdxCutTable ; 138 176 139 G4PAIModelData* fModelData; << 140 177 141 std::vector<const G4MaterialCutsCouple*> fMa << 142 std::vector<const G4Region*> fPAIRegion << 143 178 144 const G4ParticleDefinition* fParticle; << 179 145 const G4ParticleDefinition* fElectron; << 180 const G4ParticleDefinition* fParticle; 146 const G4ParticleDefinition* fPositron; << 147 G4ParticleChangeForLoss* fParticleChange; << 148 181 149 G4double fMass; 182 G4double fMass; 150 G4double fRatio; << 183 G4double fSpin; 151 G4double fChargeSquare; 184 G4double fChargeSquare; 152 G4double fLowestTcut; << 185 G4double fRatio; >> 186 G4double fHighKinEnergy; >> 187 G4double fLowKinEnergy; >> 188 G4double fTwoln10; >> 189 G4double fBg2lim; >> 190 G4double fTaulim; >> 191 G4double fQc; 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*, 161 G4PAIModel::GetVectorOfCouples() << 197 G4double kinEnergy) 162 { 198 { 163 return fMaterialCutsCoupleVector; << 164 } << 165 199 166 inline G4double G4PAIModel::ComputeMaxEnergy(G << 200 G4double gamma= kinEnergy/fMass + 1.0; 167 { << 201 G4double tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 168 return MaxSecondaryEnergy(fParticle, scaledE << 202 (1. + 2.0*gamma*fRatio + fRatio*fRatio); >> 203 >> 204 return tmax; 169 } 205 } 170 206 171 inline void G4PAIModel::SetVerboseLevel(G4int << 207 ///////////////////////////////////////////////////////////////////////// 172 { << 173 fVerbose=verbose; << 174 } << 175 208 176 inline G4int G4PAIModel::FindCoupleIndex(const << 209 inline G4double G4PAIModel::MaxSecondaryEnergy(const G4DynamicParticle* dp) 177 { 210 { 178 G4int idx = -1; << 211 179 G4int jMatMax = (G4int)fMaterialCutsCoupleVe << 212 G4double kineticEnergy = dp->GetKineticEnergy(); 180 for(G4int jMat = 0;jMat < jMatMax; ++jMat) { << 213 G4double gamma= kineticEnergy/fMass + 1.0; 181 if(couple == fMaterialCutsCoupleVector[jMa << 214 G4double tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 182 idx = jMat; << 215 (1. + 2.0*gamma*fRatio + fRatio*fRatio); 183 break; << 216 184 } << 217 return tmax; 185 } << 186 return idx; << 187 } 218 } 188 219 189 inline void G4PAIModel::SetParticle(const G4Pa << 220 /////////////////////////////////////////////////////////////// >> 221 >> 222 inline void G4PAIModel::DefineForRegion(const G4Region* r) 190 { 223 { 191 if(fParticle != p) { << 224 // G4Region* rPAI = r; 192 fParticle = p; << 225 // fPAIRegionVector.push_back(rPAI); 193 fMass = fParticle->GetPDGMass(); << 226 fPAIRegionVector.push_back(r); 194 fRatio = CLHEP::proton_mass_c2/fMass; << 195 G4double q = fParticle->GetPDGCharge()/CLH << 196 fChargeSquare = q*q; << 197 } << 198 } 227 } 199 228 >> 229 >> 230 200 #endif 231 #endif >> 232 >> 233 >> 234 >> 235 >> 236 >> 237 >> 238 201 239