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 // $Id: G4VEmModel.cc 84661 2014-10-17 14:30:16Z gcosmo $ >> 27 // 26 // ------------------------------------------- 28 // ------------------------------------------------------------------- 27 // 29 // 28 // GEANT4 Class file 30 // GEANT4 Class file 29 // 31 // 30 // 32 // 31 // File name: G4VEmModel 33 // File name: G4VEmModel 32 // 34 // 33 // Author: Vladimir Ivanchenko 35 // Author: Vladimir Ivanchenko 34 // 36 // 35 // Creation date: 25.07.2005 37 // Creation date: 25.07.2005 36 // 38 // 37 // Modifications: 39 // Modifications: 38 // 25.10.2005 Set default highLimit=100.TeV (V 40 // 25.10.2005 Set default highLimit=100.TeV (V.Ivanchenko) 39 // 06.02.2006 add method ComputeMeanFreePath() 41 // 06.02.2006 add method ComputeMeanFreePath() (mma) 40 // 16.02.2009 Move implementations of virtual 42 // 16.02.2009 Move implementations of virtual methods to source (VI) 41 // 43 // 42 // 44 // 43 // Class Description: 45 // Class Description: 44 // 46 // 45 // Abstract interface to energy loss models 47 // Abstract interface to energy loss models 46 48 47 // ------------------------------------------- 49 // ------------------------------------------------------------------- 48 // 50 // 49 51 50 #include "G4VEmModel.hh" 52 #include "G4VEmModel.hh" 51 #include "G4ElementData.hh" 53 #include "G4ElementData.hh" 52 #include "G4LossTableManager.hh" 54 #include "G4LossTableManager.hh" 53 #include "G4LossTableBuilder.hh" << 54 #include "G4ProductionCutsTable.hh" 55 #include "G4ProductionCutsTable.hh" 55 #include "G4ParticleChangeForLoss.hh" 56 #include "G4ParticleChangeForLoss.hh" 56 #include "G4ParticleChangeForGamma.hh" 57 #include "G4ParticleChangeForGamma.hh" 57 #include "G4EmParameters.hh" << 58 #include "G4SystemOfUnits.hh" 58 #include "G4SystemOfUnits.hh" 59 #include "G4EmUtility.hh" << 60 #include "G4Log.hh" 59 #include "G4Log.hh" 61 #include "Randomize.hh" 60 #include "Randomize.hh" 62 #include <iostream> << 61 //#include "G4MTHepRandom.hh" >> 62 >> 63 #if __clang__ >> 64 #if (defined(G4MULTITHREADED) && !defined(G4USE_STD11) && \ >> 65 !__has_feature(cxx_thread_local)) >> 66 #define CLANG_NOSTDTLS >> 67 #endif >> 68 #endif 63 69 64 //....oooOO0OOooo........oooOO0OOooo........oo 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 //....oooOO0OOooo........oooOO0OOooo........oo 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 66 72 >> 73 const G4double G4VEmModel::inveplus = 1.0/CLHEP::eplus; >> 74 const G4double log106 = 6*G4Log(10.); >> 75 67 G4VEmModel::G4VEmModel(const G4String& nam): 76 G4VEmModel::G4VEmModel(const G4String& nam): 68 inveplus(1.0/CLHEP::eplus), << 77 flucModel(0),anglModel(0), name(nam), lowLimit(0.1*CLHEP::keV), 69 lowLimit(0.1*CLHEP::keV), << 78 highLimit(100.0*CLHEP::TeV),eMinActive(0.0),eMaxActive(DBL_MAX), 70 highLimit(100.0*CLHEP::TeV), << 79 polarAngleLimit(CLHEP::pi),secondaryThreshold(DBL_MAX), 71 polarAngleLimit(CLHEP::pi), << 80 theLPMflag(false),flagDeexcitation(false),flagForceBuildTable(false), 72 name(nam) << 81 isMaster(true),fElementData(0),pParticleChange(0),xSectionTable(0), >> 82 theDensityFactor(0),theDensityIdx(0),fCurrentCouple(0),fCurrentElement(0), >> 83 fCurrentIsotope(0),nsec(5) 73 { 84 { 74 xsec.resize(nsec); 85 xsec.resize(nsec); 75 fEmManager = G4LossTableManager::Instance(); << 86 nSelectors = 0; 76 fEmManager->Register(this); << 87 elmSelectors = 0; 77 isMaster = fEmManager->IsMaster(); << 88 localElmSelectors = true; 78 << 89 localTable = true; 79 G4LossTableBuilder* bld = fEmManager->GetTab << 90 useAngularGenerator = false; 80 theDensityFactor = bld->GetDensityFactors(); << 91 idxTable = 0; 81 theDensityIdx = bld->GetCoupleIndexes(); << 92 >> 93 fManager = G4LossTableManager::Instance(); >> 94 fManager->Register(this); >> 95 >> 96 #if (defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \ >> 97 (defined(CLANG_NOSTDTLS)) >> 98 rndmEngineMod = G4MTHepRandom::getTheEngine(); >> 99 #else // Sequential mode or supporting C++11 standard >> 100 rndmEngineMod = CLHEP::HepRandom::getTheEngine(); >> 101 #endif 82 } 102 } 83 103 84 //....oooOO0OOooo........oooOO0OOooo........oo 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 85 105 86 G4VEmModel::~G4VEmModel() 106 G4VEmModel::~G4VEmModel() 87 { 107 { 88 if(localElmSelectors) { 108 if(localElmSelectors) { 89 for(G4int i=0; i<nSelectors; ++i) { << 109 if(nSelectors > 0) { 90 delete (*elmSelectors)[i]; << 110 for(G4int i=0; i<nSelectors; ++i) { >> 111 delete (*elmSelectors)[i]; >> 112 } 91 } 113 } 92 delete elmSelectors; 114 delete elmSelectors; 93 } 115 } 94 delete anglModel; 116 delete anglModel; 95 117 96 if(localTable && xSectionTable != nullptr) { << 118 if(localTable && xSectionTable) { 97 xSectionTable->clearAndDestroy(); 119 xSectionTable->clearAndDestroy(); 98 delete xSectionTable; 120 delete xSectionTable; 99 xSectionTable = nullptr; << 121 xSectionTable = 0; >> 122 } >> 123 if(isMaster && fElementData) { >> 124 delete fElementData; >> 125 fElementData = 0; 100 } 126 } 101 fEmManager->DeRegister(this); << 127 >> 128 fManager->DeRegister(this); 102 } 129 } 103 130 104 //....oooOO0OOooo........oooOO0OOooo........oo 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 105 132 106 G4ParticleChangeForLoss* G4VEmModel::GetPartic 133 G4ParticleChangeForLoss* G4VEmModel::GetParticleChangeForLoss() 107 { 134 { 108 G4ParticleChangeForLoss* p = nullptr; << 135 G4ParticleChangeForLoss* p = 0; 109 if (pParticleChange != nullptr) { << 136 if (pParticleChange) { 110 p = static_cast<G4ParticleChangeForLoss*>( 137 p = static_cast<G4ParticleChangeForLoss*>(pParticleChange); 111 } else { 138 } else { 112 p = new G4ParticleChangeForLoss(); 139 p = new G4ParticleChangeForLoss(); 113 pParticleChange = p; 140 pParticleChange = p; 114 } 141 } 115 if(fTripletModel != nullptr) { fTripletModel << 116 return p; 142 return p; 117 } 143 } 118 144 119 //....oooOO0OOooo........oooOO0OOooo........oo 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 120 146 121 G4ParticleChangeForGamma* G4VEmModel::GetParti 147 G4ParticleChangeForGamma* G4VEmModel::GetParticleChangeForGamma() 122 { 148 { 123 G4ParticleChangeForGamma* p = nullptr; << 149 G4ParticleChangeForGamma* p = 0; 124 if (pParticleChange != nullptr) { << 150 if (pParticleChange) { 125 p = static_cast<G4ParticleChangeForGamma*> 151 p = static_cast<G4ParticleChangeForGamma*>(pParticleChange); 126 } else { 152 } else { 127 p = new G4ParticleChangeForGamma(); 153 p = new G4ParticleChangeForGamma(); 128 pParticleChange = p; 154 pParticleChange = p; 129 } 155 } 130 if(fTripletModel != nullptr) { fTripletModel << 131 return p; 156 return p; 132 } 157 } 133 158 134 //....oooOO0OOooo........oooOO0OOooo........oo 159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 135 160 136 void G4VEmModel::InitialiseElementSelectors(co 161 void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* part, 137 co << 162 const G4DataVector& cuts) 138 { 163 { >> 164 // using spline for element selectors should be investigated in details >> 165 // because small number of points may provide biased results >> 166 // large number of points requires significant increase of memory >> 167 //G4bool spline = fManager->SplineFlag(); >> 168 G4bool spline = false; >> 169 >> 170 //G4cout << "IES: for " << GetName() << " Emin(MeV)= " << lowLimit/MeV >> 171 // << " Emax(MeV)= " << highLimit/MeV << G4endl; >> 172 >> 173 // two times less bins because probability functon is normalized >> 174 // so correspondingly is more smooth 139 if(highLimit <= lowLimit) { return; } 175 if(highLimit <= lowLimit) { return; } 140 G4EmUtility::InitialiseElementSelectors(this << 176 141 localElmSelectors = true; << 177 G4ProductionCutsTable* theCoupleTable= >> 178 G4ProductionCutsTable::GetProductionCutsTable(); >> 179 G4int numOfCouples = theCoupleTable->GetTableSize(); >> 180 >> 181 // prepare vector >> 182 if(!elmSelectors) { >> 183 elmSelectors = new std::vector<G4EmElementSelector*>; >> 184 } >> 185 if(numOfCouples > nSelectors) { >> 186 for(G4int i=nSelectors; i<numOfCouples; ++i) { >> 187 elmSelectors->push_back(0); >> 188 } >> 189 nSelectors = numOfCouples; >> 190 } >> 191 >> 192 // initialise vector >> 193 for(G4int i=0; i<numOfCouples; ++i) { >> 194 >> 195 // no need in element selectors for infionite cuts >> 196 if(cuts[i] == DBL_MAX) { continue; } >> 197 >> 198 fCurrentCouple = theCoupleTable->GetMaterialCutsCouple(i); >> 199 const G4Material* material = fCurrentCouple->GetMaterial(); >> 200 >> 201 // selector already exist check if should be deleted >> 202 G4bool create = true; >> 203 if((*elmSelectors)[i]) { >> 204 if(material == ((*elmSelectors)[i])->GetMaterial()) { create = false; } >> 205 else { delete (*elmSelectors)[i]; } >> 206 } >> 207 if(create) { >> 208 G4double emin = std::max(lowLimit, >> 209 MinPrimaryEnergy(material, part, cuts[i])); >> 210 G4double emax = std::max(highLimit, 10*emin); >> 211 G4int nbins = G4int(fManager->GetNumberOfBinsPerDecade() >> 212 *G4Log(emax/emin)/log106); >> 213 nbins = std::max(nbins, 3); >> 214 >> 215 (*elmSelectors)[i] = new G4EmElementSelector(this,material,nbins, >> 216 emin,emax,spline); >> 217 } >> 218 ((*elmSelectors)[i])->Initialise(part, cuts[i]); >> 219 /* >> 220 G4cout << "G4VEmModel::InitialiseElmSelectors i= " << i >> 221 << " idx= " << fCurrentCouple->GetIndex() >> 222 << " " << part->GetParticleName() >> 223 << " for " << GetName() << " cut= " << cuts[i] >> 224 << " " << (*elmSelectors)[i] << G4endl; >> 225 ((*elmSelectors)[i])->Dump(part); >> 226 */ >> 227 } 142 } 228 } 143 229 144 //....oooOO0OOooo........oooOO0OOooo........oo 230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 145 231 146 void G4VEmModel::InitialiseLocal(const G4Parti << 232 void G4VEmModel::InitialiseLocal(const G4ParticleDefinition*, >> 233 G4VEmModel*) 147 {} 234 {} 148 235 149 //....oooOO0OOooo........oooOO0OOooo........oo 236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 150 237 151 void G4VEmModel::InitialiseForMaterial(const G 238 void G4VEmModel::InitialiseForMaterial(const G4ParticleDefinition* part, 152 const G << 239 const G4Material* material) 153 { 240 { 154 if(material != nullptr) { << 241 if(material) { 155 G4int n = (G4int)material->GetNumberOfElem << 242 const G4ElementVector* theElementVector = material->GetElementVector(); >> 243 G4int n = material->GetNumberOfElements(); 156 for(G4int i=0; i<n; ++i) { 244 for(G4int i=0; i<n; ++i) { 157 G4int Z = material->GetElement(i)->GetZa << 245 G4int Z = G4lrint(((*theElementVector)[i])->GetZ()); 158 InitialiseForElement(part, Z); 246 InitialiseForElement(part, Z); 159 } 247 } >> 248 } else { >> 249 //G4cout << "G4VEmModel::InitialiseForMaterial for " << GetName(); >> 250 //if(part) { G4cout << " and " << part->GetParticleName(); } >> 251 //G4cout << " with no material" << G4endl; 160 } 252 } 161 } 253 } 162 254 163 //....oooOO0OOooo........oooOO0OOooo........oo 255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 164 256 165 void G4VEmModel::InitialiseForElement(const G4 257 void G4VEmModel::InitialiseForElement(const G4ParticleDefinition*, G4int) 166 {} 258 {} 167 259 168 //....oooOO0OOooo........oooOO0OOooo........oo 260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 169 261 170 G4double G4VEmModel::ComputeDEDXPerVolume(cons 262 G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*, 171 cons << 263 const G4ParticleDefinition*, 172 G4do << 264 G4double,G4double) 173 { 265 { 174 return 0.0; 266 return 0.0; 175 } 267 } 176 268 177 //....oooOO0OOooo........oooOO0OOooo........oo 269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 178 270 179 G4double G4VEmModel::CrossSectionPerVolume(con << 271 G4double G4VEmModel::CrossSectionPerVolume(const G4Material* material, 180 con << 272 const G4ParticleDefinition* p, 181 G4d << 273 G4double ekin, 182 G4d << 274 G4double emin, 183 G4d << 275 G4double emax) 184 { << 276 { 185 SetupForMaterial(p, mat, ekin); << 277 SetupForMaterial(p, material, ekin); 186 const G4double* theAtomNumDensityVector = ma << 278 G4double cross = 0.0; 187 G4int nelm = (G4int)mat->GetNumberOfElements << 279 const G4ElementVector* theElementVector = material->GetElementVector(); >> 280 const G4double* theAtomNumDensityVector = >> 281 material->GetVecNbOfAtomsPerVolume(); >> 282 G4int nelm = material->GetNumberOfElements(); 188 if(nelm > nsec) { 283 if(nelm > nsec) { 189 xsec.resize(nelm); 284 xsec.resize(nelm); 190 nsec = nelm; 285 nsec = nelm; 191 } 286 } 192 G4double cross = 0.0; << 193 for (G4int i=0; i<nelm; ++i) { 287 for (G4int i=0; i<nelm; ++i) { 194 cross += theAtomNumDensityVector[i]* 288 cross += theAtomNumDensityVector[i]* 195 ComputeCrossSectionPerAtom(p,mat->GetEle << 289 ComputeCrossSectionPerAtom(p,(*theElementVector)[i],ekin,emin,emax); 196 xsec[i] = cross; 290 xsec[i] = cross; 197 } 291 } 198 return cross; 292 return cross; 199 } 293 } 200 294 201 //....oooOO0OOooo........oooOO0OOooo........oo 295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 202 296 203 G4double G4VEmModel::GetPartialCrossSection(co << 204 co << 205 G4 << 206 { << 207 return 0.0; << 208 } << 209 << 210 //....oooOO0OOooo........oooOO0OOooo........oo << 211 << 212 void G4VEmModel::StartTracking(G4Track*) 297 void G4VEmModel::StartTracking(G4Track*) 213 {} 298 {} 214 299 215 //....oooOO0OOooo........oooOO0OOooo........oo 300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 216 301 217 const G4Element* G4VEmModel::SelectRandomAtom( << 302 const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material, 218 << 303 const G4ParticleDefinition* pd, 219 << 304 G4double kinEnergy, 220 << 305 G4double tcut, 221 << 306 G4double tmax) 222 { << 307 { 223 G4int n = (G4int)mat->GetNumberOfElements(); << 308 const G4ElementVector* theElementVector = material->GetElementVector(); 224 fCurrentElement = mat->GetElement(0); << 309 G4int n = material->GetNumberOfElements() - 1; 225 if (n > 1) { << 310 fCurrentElement = (*theElementVector)[n]; 226 const G4double x = G4UniformRand()* << 311 if (n > 0) { 227 G4VEmModel::CrossSectionPerVolume(mat,pd << 312 G4double x = rndmEngineMod->flat()* >> 313 G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax); 228 for(G4int i=0; i<n; ++i) { 314 for(G4int i=0; i<n; ++i) { 229 if (x <= xsec[i]) { 315 if (x <= xsec[i]) { 230 fCurrentElement = mat->GetElement(i); << 316 fCurrentElement = (*theElementVector)[i]; 231 break; << 317 break; 232 } 318 } 233 } 319 } 234 } 320 } 235 return fCurrentElement; 321 return fCurrentElement; 236 } 322 } 237 323 238 //....oooOO0OOooo........oooOO0OOooo........oo << 239 << 240 const G4Element* G4VEmModel::GetCurrentElement << 241 { << 242 const G4Element* elm = fCurrentElement; << 243 if(nullptr == elm && nullptr != mat) { << 244 elm = G4EmUtility::SampleRandomElement(mat << 245 } << 246 return elm; << 247 } << 248 << 249 //....oooOO0OOooo........oooOO0OOooo........oo << 250 << 251 G4int G4VEmModel::SelectRandomAtomNumber(const << 252 { << 253 const G4Element* elm = GetCurrentElement(mat << 254 return (nullptr == elm) ? 0 : elm->GetZasInt << 255 } << 256 << 257 //....oooOO0OOooo........oooOO0OOooo........oo << 258 << 259 const G4Isotope* G4VEmModel::GetCurrentIsotope << 260 { << 261 const G4Isotope* iso = nullptr; << 262 const G4Element* el = elm; << 263 if(nullptr == el && nullptr != fCurrentCoupl << 264 el = GetCurrentElement(fCurrentCouple->Get << 265 } << 266 if(nullptr != el) { << 267 iso = G4EmUtility::SampleRandomIsotope(el) << 268 } << 269 return iso; << 270 } << 271 << 272 //....oooOO0OOooo........oooOO0OOooo........oo << 273 << 274 G4int G4VEmModel::SelectIsotopeNumber(const G4 << 275 { << 276 auto iso = GetCurrentIsotope(elm); << 277 return (nullptr != iso) ? iso->GetN() : 0; << 278 } << 279 << 280 //....oooOO0OOooo........oooOO0OOooo........oo 324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 281 325 282 G4double G4VEmModel::ComputeCrossSectionPerAto 326 G4double G4VEmModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 283 << 327 G4double, G4double, G4double, 284 << 328 G4double, G4double) 285 { << 286 return 0.0; << 287 } << 288 << 289 //....oooOO0OOooo........oooOO0OOooo........oo << 290 << 291 G4double << 292 G4VEmModel::ComputeCrossSectionPerShell(const << 293 G4int, << 294 G4doub << 295 { 329 { 296 return 0.0; 330 return 0.0; 297 } 331 } 298 332 299 //....oooOO0OOooo........oooOO0OOooo........oo 333 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 300 334 301 void G4VEmModel::DefineForRegion(const G4Regio 335 void G4VEmModel::DefineForRegion(const G4Region*) 302 {} 336 {} 303 337 304 //....oooOO0OOooo........oooOO0OOooo........oo 338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 305 339 306 void G4VEmModel::FillNumberOfSecondaries(G4int << 307 G4int << 308 { << 309 numberOfTriplets = 0; << 310 numberOfRecoil = 0; << 311 } << 312 << 313 //....oooOO0OOooo........oooOO0OOooo........oo << 314 << 315 G4double G4VEmModel::ChargeSquareRatio(const G 340 G4double G4VEmModel::ChargeSquareRatio(const G4Track& track) 316 { 341 { 317 return GetChargeSquareRatio(track.GetParticl 342 return GetChargeSquareRatio(track.GetParticleDefinition(), 318 track.GetMateria << 343 track.GetMaterial(), track.GetKineticEnergy()); 319 } 344 } 320 345 321 //....oooOO0OOooo........oooOO0OOooo........oo 346 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 322 347 323 G4double G4VEmModel::GetChargeSquareRatio(cons 348 G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p, 324 cons << 349 const G4Material*, G4double) 325 { 350 { 326 const G4double q = p->GetPDGCharge()*inveplu << 351 G4double q = p->GetPDGCharge()*inveplus; 327 return q*q; 352 return q*q; 328 } 353 } 329 354 330 //....oooOO0OOooo........oooOO0OOooo........oo 355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 331 356 332 G4double G4VEmModel::GetParticleCharge(const G 357 G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p, 333 const G << 358 const G4Material*, G4double) 334 { 359 { 335 return p->GetPDGCharge(); 360 return p->GetPDGCharge(); 336 } 361 } 337 362 338 //....oooOO0OOooo........oooOO0OOooo........oo 363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 339 364 340 void G4VEmModel::CorrectionsAlongStep(const G4 365 void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*, 341 const G4 << 366 const G4DynamicParticle*, 342 const G4 << 367 G4double&,G4double&,G4double) 343 {} 368 {} 344 369 345 //....oooOO0OOooo........oooOO0OOooo........oo 370 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 346 371 347 G4double G4VEmModel::Value(const G4MaterialCut 372 G4double G4VEmModel::Value(const G4MaterialCutsCouple* couple, 348 const G4ParticleDef << 373 const G4ParticleDefinition* p, G4double e) 349 { 374 { 350 SetCurrentCouple(couple); 375 SetCurrentCouple(couple); 351 return pFactor*e*e*CrossSectionPerVolume(pBa << 376 return e*e*CrossSectionPerVolume(couple->GetMaterial(),p,e,0.0,DBL_MAX); 352 } 377 } 353 378 354 //....oooOO0OOooo........oooOO0OOooo........oo 379 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 355 380 356 G4double G4VEmModel::MinPrimaryEnergy(const G4 381 G4double G4VEmModel::MinPrimaryEnergy(const G4Material*, 357 const G4 << 382 const G4ParticleDefinition*, 358 G4double 383 G4double) 359 { 384 { 360 return 0.0; 385 return 0.0; 361 } 386 } 362 387 363 //....oooOO0OOooo........oooOO0OOooo........oo 388 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 364 389 365 G4double G4VEmModel::MinEnergyCut(const G4Part 390 G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*, 366 const G4Mate << 391 const G4MaterialCutsCouple*) 367 { 392 { 368 return 0.0; 393 return 0.0; 369 } 394 } 370 395 371 //....oooOO0OOooo........oooOO0OOooo........oo 396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 372 397 373 G4double G4VEmModel::MaxSecondaryEnergy(const 398 G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 374 G4doub << 399 G4double kineticEnergy) 375 { 400 { 376 return kineticEnergy; 401 return kineticEnergy; 377 } 402 } 378 403 379 //....oooOO0OOooo........oooOO0OOooo........oo 404 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 380 405 381 void G4VEmModel::SetupForMaterial(const G4Part << 406 void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*, 382 const G4Mate << 407 const G4Material*, G4double) 383 { << 408 {} 384 GetChargeSquareRatio(p, mat, ekin); << 385 } << 386 409 387 //....oooOO0OOooo........oooOO0OOooo........oo 410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 388 411 389 void 412 void 390 G4VEmModel::SetParticleChange(G4VParticleChang 413 G4VEmModel::SetParticleChange(G4VParticleChange* p, G4VEmFluctuationModel* f) 391 { 414 { 392 if(p != nullptr && pParticleChange != p) { p << 415 if(p && pParticleChange != p) { pParticleChange = p; } 393 if(flucModel != f) { flucModel = f; } << 416 flucModel = f; 394 } 417 } 395 418 396 //....oooOO0OOooo........oooOO0OOooo........oo 419 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 397 420 398 void G4VEmModel::SetCrossSectionTable(G4Physic 421 void G4VEmModel::SetCrossSectionTable(G4PhysicsTable* p, G4bool isLocal) 399 { 422 { 400 xSectionTable = p; << 423 if(p != xSectionTable) { 401 localTable = isLocal; << 424 if(xSectionTable && localTable) { 402 } << 425 xSectionTable->clearAndDestroy(); 403 << 426 delete xSectionTable; 404 //....oooOO0OOooo........oooOO0OOooo........oo << 427 } 405 << 428 xSectionTable = p; 406 void G4VEmModel::SetLPMFlag(G4bool) << 407 { << 408 if (G4EmParameters::Instance()->Verbose() > << 409 G4ExceptionDescription ed; << 410 ed << "The obsolete method SetLPMFlag(..) << 411 << " is called. Please, use G4EmParamet << 412 << " instead"; << 413 G4Exception("G4VEmModel::SetLPMFlag", "em0 << 414 } 429 } 415 } << 430 localTable = isLocal; 416 << 417 //....oooOO0OOooo........oooOO0OOooo........oo << 418 << 419 void G4VEmModel::SetMasterThread(G4bool) << 420 {} << 421 << 422 //....oooOO0OOooo........oooOO0OOooo........oo << 423 << 424 void G4VEmModel::ModelDescription(std::ostrea << 425 { << 426 outFile << "The description for this model h << 427 } 431 } 428 432 429 //....oooOO0OOooo........oooOO0OOooo........oo 433 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 430 434