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 // GEANT4 Class file 28 // GEANT4 Class file 29 // 29 // 30 // 30 // 31 // File name: G4BGGPionInelasticXS 31 // File name: G4BGGPionInelasticXS 32 // 32 // 33 // Author: Vladimir Ivanchenko 33 // Author: Vladimir Ivanchenko 34 // 34 // 35 // Creation date: 01.10.2003 35 // Creation date: 01.10.2003 36 // Modifications: 36 // Modifications: 37 // 37 // 38 // ------------------------------------------- 38 // ------------------------------------------------------------------- 39 // 39 // 40 40 41 #include "G4BGGPionInelasticXS.hh" 41 #include "G4BGGPionInelasticXS.hh" 42 #include "G4SystemOfUnits.hh" 42 #include "G4SystemOfUnits.hh" 43 #include "G4ComponentGGHadronNucleusXsc.hh" 43 #include "G4ComponentGGHadronNucleusXsc.hh" 44 #include "G4UPiNuclearCrossSection.hh" 44 #include "G4UPiNuclearCrossSection.hh" 45 #include "G4HadronNucleonXsc.hh" 45 #include "G4HadronNucleonXsc.hh" 46 #include "G4NuclearRadii.hh" 46 #include "G4NuclearRadii.hh" 47 47 48 #include "G4Proton.hh" 48 #include "G4Proton.hh" 49 #include "G4PionPlus.hh" 49 #include "G4PionPlus.hh" 50 #include "G4PionMinus.hh" 50 #include "G4PionMinus.hh" 51 #include "G4NistManager.hh" 51 #include "G4NistManager.hh" 52 #include "G4Pow.hh" 52 #include "G4Pow.hh" >> 53 53 #include "G4HadronicParameters.hh" 54 #include "G4HadronicParameters.hh" 54 55 55 G4double G4BGGPionInelasticXS::theGlauberFacPi 56 G4double G4BGGPionInelasticXS::theGlauberFacPiPlus[93] = {0.0}; 56 G4double G4BGGPionInelasticXS::theGlauberFacPi 57 G4double G4BGGPionInelasticXS::theGlauberFacPiMinus[93] = {0.0}; 57 G4double G4BGGPionInelasticXS::theLowEPiPlus[9 58 G4double G4BGGPionInelasticXS::theLowEPiPlus[93] = {0.0}; 58 G4double G4BGGPionInelasticXS::theLowEPiMinus[ 59 G4double G4BGGPionInelasticXS::theLowEPiMinus[93] = {0.0}; 59 G4int G4BGGPionInelasticXS::theA[93] = {0}; 60 G4int G4BGGPionInelasticXS::theA[93] = {0}; 60 61 >> 62 #ifdef G4MULTITHREADED >> 63 G4Mutex G4BGGPionInelasticXS::pionInelasticXSMutex = G4MUTEX_INITIALIZER; >> 64 #endif >> 65 61 G4BGGPionInelasticXS::G4BGGPionInelasticXS(con 66 G4BGGPionInelasticXS::G4BGGPionInelasticXS(const G4ParticleDefinition* p) 62 : G4VCrossSectionDataSet("BarashenkovGlauberG 67 : G4VCrossSectionDataSet("BarashenkovGlauberGribov") 63 { 68 { 64 verboseLevel = 0; 69 verboseLevel = 0; 65 fGlauberEnergy = 91.*CLHEP::GeV; << 70 fGlauberEnergy = 91.*CLHEP::GeV; 66 fLowEnergy = 20.*CLHEP::MeV; << 71 fLowEnergy = 20.*CLHEP::MeV; 67 fLowestEnergy = 1.*CLHEP::MeV; << 72 fLowestEnergy = 1.*CLHEP::MeV; 68 SetMinKinEnergy(0.0); 73 SetMinKinEnergy(0.0); 69 SetMaxKinEnergy( G4HadronicParameters::Insta 74 SetMaxKinEnergy( G4HadronicParameters::Instance()->GetMaxEnergy() ); 70 75 71 fPion = new G4UPiNuclearCrossSection(); << 76 fPion = nullptr; 72 fGlauber = new G4ComponentGGHadronNucleusXsc << 77 fGlauber = nullptr; 73 fHadron = new G4HadronNucleonXsc(); << 78 fHadron = nullptr; 74 79 75 fG4pow = G4Pow::GetInstance(); 80 fG4pow = G4Pow::GetInstance(); 76 81 77 theProton = G4Proton::Proton(); 82 theProton = G4Proton::Proton(); 78 thePiPlus = G4PionPlus::PionPlus(); 83 thePiPlus = G4PionPlus::PionPlus(); 79 isPiplus = (p == thePiPlus); << 84 isPiplus = (p == thePiPlus); >> 85 isMaster = false; 80 SetForAllAtomsAndEnergies(true); 86 SetForAllAtomsAndEnergies(true); 81 << 82 if (0 == theA[0]) { Initialise(); } << 83 } 87 } 84 88 85 //....oooOO0OOooo........oooOO0OOooo........oo 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 86 90 87 G4BGGPionInelasticXS::~G4BGGPionInelasticXS() 91 G4BGGPionInelasticXS::~G4BGGPionInelasticXS() 88 { 92 { 89 delete fHadron; 93 delete fHadron; 90 } 94 } 91 95 92 //....oooOO0OOooo........oooOO0OOooo........oo 96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 93 97 94 G4bool 98 G4bool 95 G4BGGPionInelasticXS::IsElementApplicable(cons 99 G4BGGPionInelasticXS::IsElementApplicable(const G4DynamicParticle*, G4int, 96 cons 100 const G4Material*) 97 { 101 { 98 return true; 102 return true; 99 } 103 } 100 104 101 //....oooOO0OOooo........oooOO0OOooo........oo 105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 102 106 103 G4bool G4BGGPionInelasticXS::IsIsoApplicable(c 107 G4bool G4BGGPionInelasticXS::IsIsoApplicable(const G4DynamicParticle*, 104 G 108 G4int Z, G4int, 105 c 109 const G4Element*, 106 c 110 const G4Material*) 107 { 111 { 108 return (1 == Z); 112 return (1 == Z); 109 } 113 } 110 114 111 //....oooOO0OOooo........oooOO0OOooo........oo 115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 112 116 113 G4double 117 G4double 114 G4BGGPionInelasticXS::GetElementCrossSection(c 118 G4BGGPionInelasticXS::GetElementCrossSection(const G4DynamicParticle* dp, 115 G 119 G4int ZZ, const G4Material*) 116 { 120 { 117 // this method should be called only for Z > 121 // this method should be called only for Z > 1 118 122 119 G4double cross = 0.0; 123 G4double cross = 0.0; 120 G4double ekin = std::max(dp->GetKineticEnerg 124 G4double ekin = std::max(dp->GetKineticEnergy(), fLowestEnergy); 121 G4int Z = std::min(ZZ, 92); 125 G4int Z = std::min(ZZ, 92); 122 126 123 if(1 == Z) { 127 if(1 == Z) { 124 cross = 1.0115*GetIsoCrossSection(dp,1,1); 128 cross = 1.0115*GetIsoCrossSection(dp,1,1); 125 } else if(ekin < fLowEnergy) { 129 } else if(ekin < fLowEnergy) { 126 cross = (isPiplus) ? theLowEPiPlus[Z]*Coul 130 cross = (isPiplus) ? theLowEPiPlus[Z]*CoulombFactorPiPlus(ekin, Z) 127 : theLowEPiMinus[Z]*FactorPiMinus(ekin); 131 : theLowEPiMinus[Z]*FactorPiMinus(ekin); 128 } else if(ekin > fGlauberEnergy) { 132 } else if(ekin > fGlauberEnergy) { 129 cross = (isPiplus) ? theGlauberFacPiPlus[Z 133 cross = (isPiplus) ? theGlauberFacPiPlus[Z] : theGlauberFacPiMinus[Z]; 130 cross *= fGlauber->GetInelasticGlauberGrib 134 cross *= fGlauber->GetInelasticGlauberGribov(dp, Z, theA[Z]); 131 } else { 135 } else { 132 cross = fPion->GetInelasticCrossSection(dp 136 cross = fPion->GetInelasticCrossSection(dp, Z, theA[Z]); 133 } 137 } 134 #ifdef G4VERBOSE << 135 if(verboseLevel > 1) { 138 if(verboseLevel > 1) { 136 G4cout << "G4BGGPionInelasticXS::GetCrossS 139 G4cout << "G4BGGPionInelasticXS::GetCrossSection for " 137 << dp->GetDefinition()->GetParticle 140 << dp->GetDefinition()->GetParticleName() 138 << " Ekin(GeV)= " << dp->GetKineti 141 << " Ekin(GeV)= " << dp->GetKineticEnergy() 139 << " in nucleus Z= " << Z << " A= 142 << " in nucleus Z= " << Z << " A= " << theA[Z] 140 << " XS(b)= " << cross/barn 143 << " XS(b)= " << cross/barn 141 << G4endl; 144 << G4endl; 142 } 145 } 143 #endif << 144 return cross; 146 return cross; 145 } 147 } 146 148 147 //....oooOO0OOooo........oooOO0OOooo........oo 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 148 150 149 G4double 151 G4double 150 G4BGGPionInelasticXS::GetIsoCrossSection(const 152 G4BGGPionInelasticXS::GetIsoCrossSection(const G4DynamicParticle* dp, 151 G4int << 153 G4int Z, G4int A, 152 const 154 const G4Isotope*, 153 const 155 const G4Element*, 154 const 156 const G4Material*) 155 { 157 { 156 // this method should be called only for Z = 158 // this method should be called only for Z = 1 157 fHadron->HadronNucleonXscNS(dp->GetDefinitio 159 fHadron->HadronNucleonXscNS(dp->GetDefinition(), theProton, 158 dp->GetKineticEn 160 dp->GetKineticEnergy()); 159 G4double cross = A*fHadron->GetInelasticHadr 161 G4double cross = A*fHadron->GetInelasticHadronNucleonXsc(); 160 162 161 #ifdef G4VERBOSE << 162 if(verboseLevel > 1) { 163 if(verboseLevel > 1) { 163 G4cout << "G4BGGPionInelasticXS::GetCrossS 164 G4cout << "G4BGGPionInelasticXS::GetCrossSection for " 164 << dp->GetDefinition()->GetParticle 165 << dp->GetDefinition()->GetParticleName() 165 << " Ekin(GeV)= " << dp->GetKineti 166 << " Ekin(GeV)= " << dp->GetKineticEnergy() 166 << " in nucleus Z=1 A=" << A << 167 << " in nucleus Z= " << Z << " A= " << A 167 << " XS(b)= " << cross/barn 168 << " XS(b)= " << cross/barn 168 << G4endl; 169 << G4endl; 169 } 170 } 170 #endif << 171 return cross; 171 return cross; 172 } 172 } 173 173 174 //....oooOO0OOooo........oooOO0OOooo........oo 174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 175 175 176 void G4BGGPionInelasticXS::BuildPhysicsTable(c 176 void G4BGGPionInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p) 177 { 177 { >> 178 if(fPion) { return; } 178 if(verboseLevel > 1) { 179 if(verboseLevel > 1) { 179 G4cout << "G4BGGPionInelasticXS::BuildPhys 180 G4cout << "G4BGGPionInelasticXS::BuildPhysicsTable for " 180 << p.GetParticleName() << G4endl; 181 << p.GetParticleName() << G4endl; 181 } 182 } 182 if(&p == G4PionPlus::PionPlus() || &p == G4P 183 if(&p == G4PionPlus::PionPlus() || &p == G4PionMinus::PionMinus()) { 183 isPiplus = (&p == G4PionPlus::PionPlus()); 184 isPiplus = (&p == G4PionPlus::PionPlus()); 184 } else { 185 } else { 185 G4ExceptionDescription ed; 186 G4ExceptionDescription ed; 186 ed << "This BGG cross section is applicabl 187 ed << "This BGG cross section is applicable only to pions and not to " 187 << p.GetParticleName() << G4endl; 188 << p.GetParticleName() << G4endl; 188 G4Exception("G4BGGPionInelasticXS::BuildPh 189 G4Exception("G4BGGPionInelasticXS::BuildPhysicsTable", "had001", 189 FatalException, ed); 190 FatalException, ed); >> 191 return; 190 } 192 } 191 } << 192 193 193 //....oooOO0OOooo........oooOO0OOooo........oo << 194 fPion = new G4UPiNuclearCrossSection(); >> 195 fGlauber = new G4ComponentGGHadronNucleusXsc(); >> 196 fHadron = new G4HadronNucleonXsc(); 194 197 195 void G4BGGPionInelasticXS::Initialise() << 198 fPion->BuildPhysicsTable(p); 196 { << 197 theA[0] = theA[1] = 1; << 198 G4ThreeVector mom(0.0,0.0,1.0); << 199 G4DynamicParticle dp(thePiPlus, mom, fGlaube << 200 << 201 G4NistManager* nist = G4NistManager::Instanc << 202 G4double csup, csdn; << 203 << 204 for (G4int iz=2; iz<93; ++iz) { << 205 G4int A = G4lrint(nist->GetAtomicMassAmu(i << 206 theA[iz] = A; << 207 << 208 csup = fGlauber->GetInelasticGlauberGribov << 209 csdn = fPion->GetInelasticCrossSection(&dp << 210 theGlauberFacPiPlus[iz] = csdn/csup; << 211 } << 212 199 213 dp.SetDefinition(G4PionMinus::PionMinus()); << 200 if(0 == theA[0]) { 214 for (G4int iz=2; iz<93; ++iz) { << 201 #ifdef G4MULTITHREADED 215 csup = fGlauber->GetInelasticGlauberGribov << 202 G4MUTEXLOCK(&pionInelasticXSMutex); 216 csdn = fPion->GetInelasticCrossSection(&dp << 203 if(0 == theA[0]) { 217 theGlauberFacPiMinus[iz] = csdn/csup; << 204 #endif 218 << 205 isMaster = true; 219 if(verboseLevel > 1) { << 206 #ifdef G4MULTITHREADED 220 G4cout << "Z= " << iz << " A= " << the << 221 << " factorPiPlus= " << theGlauberFacPi << 222 << " factorPiMinus= " << theGlauberFacP << 223 << G4endl; << 224 } 207 } >> 208 G4MUTEXUNLOCK(&pionInelasticXSMutex); >> 209 #endif >> 210 } else { >> 211 return; 225 } 212 } 226 213 227 theLowEPiPlus[1] = theLowEPiMinus[1]= 1.0; << 214 if(isMaster && 0 == theA[0]) { 228 dp.SetDefinition(thePiPlus); << 215 229 dp.SetKineticEnergy(fLowEnergy); << 216 theA[0] = theA[1] = 1; 230 for (G4int iz=2; iz<93; ++iz) { << 217 G4ThreeVector mom(0.0,0.0,1.0); 231 theLowEPiPlus[iz] = fPion->GetInelasticCro << 218 G4DynamicParticle dp(thePiPlus, mom, fGlauberEnergy); 232 /CoulombFactorPiPlus(fLowEnergy, iz); << 219 233 } << 220 G4NistManager* nist = G4NistManager::Instance(); >> 221 G4double csup, csdn; >> 222 >> 223 if(verboseLevel > 0) { >> 224 G4cout << "### G4BGGPionInelasticXS::Initialise for " >> 225 << p.GetParticleName() >> 226 << " isPiplus: " << isPiplus >> 227 << G4endl; >> 228 } >> 229 for(G4int iz=2; iz<93; ++iz) { >> 230 G4int A = G4lrint(nist->GetAtomicMassAmu(iz)); >> 231 theA[iz] = A; >> 232 >> 233 csup = fGlauber->GetInelasticGlauberGribov(&dp, iz, A); >> 234 csdn = fPion->GetInelasticCrossSection(&dp, iz, A); >> 235 theGlauberFacPiPlus[iz] = csdn/csup; >> 236 } >> 237 >> 238 dp.SetDefinition(G4PionMinus::PionMinus()); >> 239 for(G4int iz=2; iz<93; ++iz) { >> 240 csup = fGlauber->GetInelasticGlauberGribov(&dp, iz, theA[iz]); >> 241 csdn = fPion->GetInelasticCrossSection(&dp, iz, theA[iz]); >> 242 theGlauberFacPiMinus[iz] = csdn/csup; >> 243 >> 244 if(verboseLevel > 0) { >> 245 G4cout << "Z= " << iz << " A= " << theA[iz] >> 246 << " factorPiPlus= " << theGlauberFacPiPlus[iz] >> 247 << " factorPiMinus= " << theGlauberFacPiMinus[iz] >> 248 << G4endl; >> 249 } >> 250 } >> 251 >> 252 theLowEPiPlus[1] = theLowEPiMinus[1]= 1.0; >> 253 dp.SetDefinition(thePiPlus); >> 254 dp.SetKineticEnergy(fLowEnergy); >> 255 for(G4int iz=2; iz<93; ++iz) { >> 256 theLowEPiPlus[iz] = fPion->GetInelasticCrossSection(&dp, iz, theA[iz]) >> 257 /CoulombFactorPiPlus(fLowEnergy, iz); >> 258 } 234 259 235 dp.SetDefinition(G4PionMinus::PionMinus()); << 260 dp.SetDefinition(G4PionMinus::PionMinus()); 236 for (G4int iz=2; iz<93; ++iz) { << 261 for(G4int iz=2; iz<93; ++iz) { 237 theLowEPiMinus[iz] = fPion->GetInelasticCr << 262 theLowEPiMinus[iz] = fPion->GetInelasticCrossSection(&dp, iz, theA[iz]) 238 /FactorPiMinus(fLowEnergy); << 263 /FactorPiMinus(fLowEnergy); 239 264 240 if (verboseLevel > 1) { << 265 if(verboseLevel > 0) { 241 G4cout << "Z= " << iz << " A= " << the << 266 G4cout << "Z= " << iz << " A= " << theA[iz] 242 << " LowEtorPiPlus= " << theLowEPiPlus[ << 267 << " LowEtorPiPlus= " << theLowEPiPlus[iz] 243 << " LowEtorPiMinus= " << theLowEPiMinu << 268 << " LowEtorPiMinus= " << theLowEPiMinus[iz] 244 << G4endl; << 269 << G4endl; >> 270 } 245 } 271 } 246 } 272 } 247 } 273 } 248 274 249 //....oooOO0OOooo........oooOO0OOooo........oo 275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 250 276 251 G4double G4BGGPionInelasticXS::CoulombFactorPi 277 G4double G4BGGPionInelasticXS::CoulombFactorPiPlus(G4double kinEnergy, G4int Z) 252 { 278 { 253 return (kinEnergy > 0.0) ? 279 return (kinEnergy > 0.0) ? 254 G4NuclearRadii::CoulombFactor(Z, theA[Z], 280 G4NuclearRadii::CoulombFactor(Z, theA[Z], thePiPlus, kinEnergy) : 0.0; 255 } 281 } 256 282 257 //....oooOO0OOooo........oooOO0OOooo........oo 283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 258 284 259 G4double G4BGGPionInelasticXS::FactorPiMinus(G 285 G4double G4BGGPionInelasticXS::FactorPiMinus(G4double kinEnergy) 260 { 286 { 261 return 1.0/std::sqrt(kinEnergy); 287 return 1.0/std::sqrt(kinEnergy); 262 } 288 } 263 289 264 //....oooOO0OOooo........oooOO0OOooo........oo 290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 265 291 266 void 292 void 267 G4BGGPionInelasticXS::CrossSectionDescription( 293 G4BGGPionInelasticXS::CrossSectionDescription(std::ostream& outFile) const 268 { 294 { 269 outFile << "The Barashenkov-Glauber-Gribov c 295 outFile << "The Barashenkov-Glauber-Gribov cross section handles inelastic\n" 270 << "pion scattering from nuclei at a 296 << "pion scattering from nuclei at all energies. The Barashenkov\n" 271 << "parameterization is used below 9 297 << "parameterization is used below 91 GeV and the Glauber-Gribov\n" 272 << "parameterization is used above 9 298 << "parameterization is used above 91 GeV.\n"; 273 } 299 } 274 300 275 //....oooOO0OOooo........oooOO0OOooo........oo 301 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 276 302