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: G4PAIPhotModel 32 // File name: G4PAIPhotModel 33 // 33 // 34 // Author: V. Grichine based on G4PAIMo 34 // Author: V. Grichine based on G4PAIModel code for MT 35 // 35 // 36 // Creation date: 07.10.2013 36 // Creation date: 07.10.2013 37 // 37 // 38 // 38 // 39 // Class Description: 39 // Class Description: 40 // 40 // 41 // Implementation of PAI photon model of energ 41 // Implementation of PAI photon model of energy loss and 42 // delta-electron or X-ray production by charg 42 // delta-electron or X-ray production by charged particles in MT framework 43 // 43 // 44 // ------------------------------------------- 44 // ------------------------------------------------------------------- 45 // 45 // 46 46 47 #ifndef G4PAIPhotModel_h 47 #ifndef G4PAIPhotModel_h 48 #define G4PAIPhotModel_h 1 48 #define G4PAIPhotModel_h 1 49 49 50 #include <CLHEP/Units/PhysicalConstants.h> 50 #include <CLHEP/Units/PhysicalConstants.h> 51 51 52 #include "G4VEmModel.hh" 52 #include "G4VEmModel.hh" 53 #include "G4VEmFluctuationModel.hh" 53 #include "G4VEmFluctuationModel.hh" 54 #include "globals.hh" 54 #include "globals.hh" 55 #include <vector> 55 #include <vector> 56 56 57 class G4Region; 57 class G4Region; 58 class G4MaterialCutsCouple; 58 class G4MaterialCutsCouple; 59 class G4ParticleChangeForLoss; 59 class G4ParticleChangeForLoss; 60 60 61 class G4PAIPhotData; 61 class G4PAIPhotData; 62 62 63 class G4PAIPhotModel final : public G4VEmModel 63 class G4PAIPhotModel final : public G4VEmModel, public G4VEmFluctuationModel 64 { 64 { 65 65 66 public: 66 public: 67 67 68 explicit G4PAIPhotModel(const G4ParticleDefi 68 explicit G4PAIPhotModel(const G4ParticleDefinition* p = nullptr, 69 const G4String& nam = "PAI"); 69 const G4String& nam = "PAI"); 70 70 71 ~G4PAIPhotModel() final; 71 ~G4PAIPhotModel() final; 72 72 73 void Initialise(const G4ParticleDefinition*, 73 void Initialise(const G4ParticleDefinition*, const G4DataVector&) final; 74 74 75 void InitialiseLocal(const G4ParticleDefinit 75 void InitialiseLocal(const G4ParticleDefinition*, 76 G4VEmModel* masterModel 76 G4VEmModel* masterModel) final; 77 77 78 G4double MinEnergyCut(const G4ParticleDefini 78 G4double MinEnergyCut(const G4ParticleDefinition*, 79 const G4MaterialCutsCo 79 const G4MaterialCutsCouple* couple) final; 80 80 81 G4double ComputeDEDXPerVolume(const G4Materi 81 G4double ComputeDEDXPerVolume(const G4Material*, 82 const G4ParticleDefinition 82 const G4ParticleDefinition*, 83 G4double kineticEnergy, 83 G4double kineticEnergy, 84 G4double cutEnergy) final; 84 G4double cutEnergy) final; 85 85 86 G4double CrossSectionPerVolume(const G4Mater 86 G4double CrossSectionPerVolume(const G4Material*, 87 const G4ParticleDefinition*, 87 const G4ParticleDefinition*, 88 G4double kineticEnergy, 88 G4double kineticEnergy, 89 G4double cutEnergy, 89 G4double cutEnergy, 90 G4double maxEnergy) final; 90 G4double maxEnergy) final; 91 91 92 void SampleSecondaries(std::vector<G4Dynamic 92 void SampleSecondaries(std::vector<G4DynamicParticle*>*, 93 const G4MaterialCutsCouple*, 93 const G4MaterialCutsCouple*, 94 const G4DynamicParticle*, 94 const G4DynamicParticle*, 95 G4double tmin, 95 G4double tmin, 96 G4double maxEnergy) final; 96 G4double maxEnergy) final; 97 97 98 G4double SampleFluctuations(const G4Material 98 G4double SampleFluctuations(const G4MaterialCutsCouple*, 99 const G4DynamicParticle*, 99 const G4DynamicParticle*, 100 const G4double, const G4double, << 100 G4double, G4double, G4double) final; 101 const G4double, << 102 101 103 G4double Dispersion(const G4Material*, const 102 G4double Dispersion(const G4Material*, const G4DynamicParticle*, 104 const G4double, const G4double, cons << 103 G4double, G4double) final; 105 104 106 void DefineForRegion(const G4Region* r) fina 105 void DefineForRegion(const G4Region* r) final; 107 106 108 inline G4PAIPhotData* GetPAIPhotData(); 107 inline G4PAIPhotData* GetPAIPhotData(); 109 108 110 inline const std::vector<const G4MaterialCut 109 inline const std::vector<const G4MaterialCutsCouple*>& GetVectorOfCouples(); 111 110 112 inline G4double ComputeMaxEnergy(G4double sc 111 inline G4double ComputeMaxEnergy(G4double scaledEnergy); 113 112 114 inline void SetVerboseLevel(G4int verbose); 113 inline void SetVerboseLevel(G4int verbose); 115 114 116 // hide assignment operator << 117 G4PAIPhotModel & operator=(const G4PAIPhotM << 118 G4PAIPhotModel(const G4PAIPhotModel&) = del << 119 << 120 protected: 115 protected: 121 116 122 G4double MaxSecondaryEnergy(const G4Particle 117 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 123 G4double kinEnergy) final; 118 G4double kinEnergy) final; 124 119 125 private: 120 private: 126 121 127 inline G4int FindCoupleIndex(const G4Materia 122 inline G4int FindCoupleIndex(const G4MaterialCutsCouple*); 128 123 129 inline void SetParticle(const G4ParticleDefi 124 inline void SetParticle(const G4ParticleDefinition* p); 130 125 >> 126 // hide assignment operator >> 127 G4PAIPhotModel & operator=(const G4PAIPhotModel &right) = delete; >> 128 G4PAIPhotModel(const G4PAIPhotModel&) = delete; >> 129 131 G4int fVerbose; 130 G4int fVerbose; 132 131 133 G4PAIPhotData* fModelData; 132 G4PAIPhotData* fModelData; 134 133 135 std::vector<const G4MaterialCutsCouple*> fMa 134 std::vector<const G4MaterialCutsCouple*> fMaterialCutsCoupleVector; 136 std::vector<const G4Region*> fPAIRegion 135 std::vector<const G4Region*> fPAIRegionVector; 137 136 138 const G4ParticleDefinition* fParticle; 137 const G4ParticleDefinition* fParticle; 139 const G4ParticleDefinition* fElectron; 138 const G4ParticleDefinition* fElectron; 140 const G4ParticleDefinition* fPositron; 139 const G4ParticleDefinition* fPositron; 141 G4ParticleChangeForLoss* fParticleChange; 140 G4ParticleChangeForLoss* fParticleChange; 142 141 143 G4double fMass; 142 G4double fMass; 144 G4double fRatio; 143 G4double fRatio; 145 G4double fChargeSquare; 144 G4double fChargeSquare; 146 G4double fLowestTcut; 145 G4double fLowestTcut; 147 }; 146 }; 148 147 149 inline G4PAIPhotData* G4PAIPhotModel::GetPAIPh 148 inline G4PAIPhotData* G4PAIPhotModel::GetPAIPhotData() 150 { 149 { 151 return fModelData; 150 return fModelData; 152 } 151 } 153 152 154 inline const std::vector<const G4MaterialCutsC 153 inline const std::vector<const G4MaterialCutsCouple*>& 155 G4PAIPhotModel::GetVectorOfCouples() 154 G4PAIPhotModel::GetVectorOfCouples() 156 { 155 { 157 return fMaterialCutsCoupleVector; 156 return fMaterialCutsCoupleVector; 158 } 157 } 159 158 160 inline G4double G4PAIPhotModel::ComputeMaxEner 159 inline G4double G4PAIPhotModel::ComputeMaxEnergy(G4double scaledEnergy) 161 { 160 { 162 return MaxSecondaryEnergy(fParticle, scaledE 161 return MaxSecondaryEnergy(fParticle, scaledEnergy/fRatio); 163 } 162 } 164 163 165 inline void G4PAIPhotModel::SetVerboseLevel(G4 164 inline void G4PAIPhotModel::SetVerboseLevel(G4int verbose) 166 { 165 { 167 fVerbose=verbose; 166 fVerbose=verbose; 168 } 167 } 169 168 170 inline G4int G4PAIPhotModel::FindCoupleIndex(c 169 inline G4int G4PAIPhotModel::FindCoupleIndex(const G4MaterialCutsCouple* couple) 171 { 170 { 172 G4int idx = -1; 171 G4int idx = -1; 173 G4int jMatMax = (G4int)fMaterialCutsCoupleVe << 172 size_t jMatMax = fMaterialCutsCoupleVector.size(); 174 for(G4int jMat = 0;jMat < jMatMax; ++jMat) { << 173 for(size_t jMat = 0;jMat < jMatMax; ++jMat) { 175 if(couple == fMaterialCutsCoupleVector[jMa 174 if(couple == fMaterialCutsCoupleVector[jMat]) { 176 idx = jMat; 175 idx = jMat; 177 break; 176 break; 178 } 177 } 179 } 178 } 180 return idx; 179 return idx; 181 } 180 } 182 181 183 inline void G4PAIPhotModel::SetParticle(const 182 inline void G4PAIPhotModel::SetParticle(const G4ParticleDefinition* p) 184 { 183 { 185 if(fParticle != p) { 184 if(fParticle != p) { 186 fParticle = p; 185 fParticle = p; 187 fMass = fParticle->GetPDGMass(); 186 fMass = fParticle->GetPDGMass(); 188 fRatio = CLHEP::proton_mass_c2/fMass; 187 fRatio = CLHEP::proton_mass_c2/fMass; 189 G4double q = fParticle->GetPDGCharge()/CLH 188 G4double q = fParticle->GetPDGCharge()/CLHEP::eplus; 190 fChargeSquare = q*q; 189 fChargeSquare = q*q; 191 } 190 } 192 } 191 } 193 192 194 #endif 193 #endif >> 194 >> 195 >> 196 >> 197 >> 198 >> 199 >> 200 195 201