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 // PDG fits, 1998 Review of Particle Propertie 27 // PDG fits, 1998 Review of Particle Properties, European Phys. J. 3(1998), 1 28 // ------------------------------------------- 28 // ------------------------------------------------------------------- 29 29 30 #include "globals.hh" 30 #include "globals.hh" 31 #include "G4ios.hh" 31 #include "G4ios.hh" 32 #include "G4Pow.hh" << 33 #include "G4SystemOfUnits.hh" << 34 #include "G4XPDGTotal.hh" 32 #include "G4XPDGTotal.hh" 35 #include "G4KineticTrack.hh" 33 #include "G4KineticTrack.hh" 36 #include "G4ParticleDefinition.hh" 34 #include "G4ParticleDefinition.hh" 37 #include "G4DataVector.hh" 35 #include "G4DataVector.hh" 38 #include "G4AntiProton.hh" 36 #include "G4AntiProton.hh" 39 #include "G4AntiNeutron.hh" 37 #include "G4AntiNeutron.hh" 40 #include "G4Proton.hh" 38 #include "G4Proton.hh" 41 #include "G4Neutron.hh" 39 #include "G4Neutron.hh" 42 #include "G4PionPlus.hh" 40 #include "G4PionPlus.hh" 43 #include "G4PionMinus.hh" 41 #include "G4PionMinus.hh" 44 #include "G4Gamma.hh" 42 #include "G4Gamma.hh" 45 #include "G4KaonMinus.hh" 43 #include "G4KaonMinus.hh" 46 #include "G4KaonPlus.hh" 44 #include "G4KaonPlus.hh" 47 45 48 const G4double G4XPDGTotal::_lowLimit = 3. * G 46 const G4double G4XPDGTotal::_lowLimit = 3. * GeV; // 2.99999 * GeV; 49 const G4double G4XPDGTotal::_highLimit = DBL_M 47 const G4double G4XPDGTotal::_highLimit = DBL_MAX; 50 48 51 // Parameters of the PDG total cross-section f 49 // Parameters of the PDG total cross-section fit (Rev. Particle Properties, 1998) 52 // Columns are: lower and higher fit range, X, 50 // Columns are: lower and higher fit range, X, Y1, Y2 53 const G4int G4XPDGTotal::nFit = 5; 51 const G4int G4XPDGTotal::nFit = 5; 54 // p p 52 // p p 55 const G4double G4XPDGTotal::ppPDGFit[5] = 53 const G4double G4XPDGTotal::ppPDGFit[5] = { 3., 40000., 18.256, 60.19, 33.43 }; 56 // n p 54 // n p 57 const G4double G4XPDGTotal::npPDGFit[5] = 55 const G4double G4XPDGTotal::npPDGFit[5] = { 3., 40., 18.256, 61.14, 29.80 }; 58 // pi p 56 // pi p 59 const G4double G4XPDGTotal::pipPDGFit[5] = 57 const G4double G4XPDGTotal::pipPDGFit[5] = { 3., 40., 11.568, 27.55, 5.62 }; 60 // K p 58 // K p 61 const G4double G4XPDGTotal::KpPDGFit[5] = 59 const G4double G4XPDGTotal::KpPDGFit[5] = { 3., 40., 10.376, 15.57, 13.19 }; 62 // K n 60 // K n 63 const G4double G4XPDGTotal::KnPDGFit[5] = 61 const G4double G4XPDGTotal::KnPDGFit[5] = { 3., 40., 10.376, 14.29, 7.38 }; 64 // gamma p 62 // gamma p 65 const G4double G4XPDGTotal::gammapPDGFit[5] = 63 const G4double G4XPDGTotal::gammapPDGFit[5] = { 3., 300., 0.0577, 0.1171, 0. }; 66 //gamma gamma 64 //gamma gamma 67 const G4double G4XPDGTotal::gammagammaPDGFit[5 65 const G4double G4XPDGTotal::gammagammaPDGFit[5] = { 3., 300., 0.000156, 0.00032, 0. }; 68 66 69 67 70 G4XPDGTotal::G4XPDGTotal() 68 G4XPDGTotal::G4XPDGTotal() 71 { 69 { 72 std::pair<const G4ParticleDefinition *,const << 70 std::pair<G4String,G4String> pp(G4Proton::ProtonDefinition()->GetParticleName(), 73 G4Proton::ProtonDefinition()); << 71 G4Proton::ProtonDefinition()->GetParticleName()); 74 std::pair<const G4ParticleDefinition *,const << 72 std::pair<G4String,G4String> pn(G4Proton::ProtonDefinition()->GetParticleName(), 75 G4Neutron::NeutronDefinition()); << 73 G4Neutron::NeutronDefinition()->GetParticleName()); 76 std::pair<const G4ParticleDefinition *,const << 74 std::pair<G4String,G4String> piPlusp(G4PionPlus::PionPlusDefinition()->GetParticleName(), 77 G4Proton::ProtonDefinition()); << 75 G4Proton::ProtonDefinition()->GetParticleName()); 78 std::pair<const G4ParticleDefinition *,const << 76 std::pair<G4String,G4String> piMinusp(G4PionMinus::PionMinusDefinition()->GetParticleName(), 79 G4Proton::ProtonDefinition()); << 77 G4Proton::ProtonDefinition()->GetParticleName()); 80 std::pair<const G4ParticleDefinition *,const << 78 std::pair<G4String,G4String> KPlusp(G4KaonPlus::KaonPlusDefinition()->GetParticleName(), 81 G4Proton::ProtonDefinition()); << 79 G4Proton::ProtonDefinition()->GetParticleName()); 82 std::pair<const G4ParticleDefinition *,const << 80 std::pair<G4String,G4String> KPlusn(G4KaonPlus::KaonPlusDefinition()->GetParticleName(), 83 G4Neutron::NeutronDefinition()); << 81 G4Neutron::NeutronDefinition()->GetParticleName()); 84 std::pair<const G4ParticleDefinition *,const << 82 std::pair<G4String,G4String> KMinusp(G4KaonMinus::KaonMinusDefinition()->GetParticleName(), 85 G4Proton::ProtonDefinition()); << 83 G4Proton::ProtonDefinition()->GetParticleName()); 86 std::pair<const G4ParticleDefinition *,const << 84 std::pair<G4String,G4String> KMinusn(G4KaonMinus::KaonMinusDefinition()->GetParticleName(), 87 G4Neutron::NeutronDefinition()); << 85 G4Neutron::NeutronDefinition()->GetParticleName()); 88 std::pair<const G4ParticleDefinition *,const << 86 std::pair<G4String,G4String> gp(G4Gamma::GammaDefinition()->GetParticleName(), 89 G4Proton::ProtonDefinition()); << 87 G4Proton::ProtonDefinition()->GetParticleName()); 90 std::pair<const G4ParticleDefinition *,const << 88 std::pair<G4String,G4String> gg(G4Gamma::GammaDefinition()->GetParticleName(), 91 G4Gamma::GammaDefinition()); << 89 G4Gamma::GammaDefinition()->GetParticleName()); 92 std::pair<const G4ParticleDefinition *,const << 90 std::pair<G4String,G4String> nn(G4Neutron::NeutronDefinition()->GetParticleName(), 93 G4Neutron::NeutronDefinition()); << 91 G4Neutron::NeutronDefinition()->GetParticleName()); 94 92 95 std::vector<G4double> nnData; 93 std::vector<G4double> nnData; 96 std::vector<G4double> ppData; 94 std::vector<G4double> ppData; 97 std::vector<G4double> pnData; 95 std::vector<G4double> pnData; 98 std::vector<G4double> pipData; 96 std::vector<G4double> pipData; 99 std::vector<G4double> KpData; 97 std::vector<G4double> KpData; 100 std::vector<G4double> KnData; 98 std::vector<G4double> KnData; 101 std::vector<G4double> gpData; 99 std::vector<G4double> gpData; 102 std::vector<G4double> ggData; 100 std::vector<G4double> ggData; 103 101 104 G4int i; 102 G4int i; 105 for (i=0; i<2; i++) 103 for (i=0; i<2; i++) 106 { 104 { 107 nnData.push_back(ppPDGFit[i] * GeV); 105 nnData.push_back(ppPDGFit[i] * GeV); 108 ppData.push_back(ppPDGFit[i] * GeV); 106 ppData.push_back(ppPDGFit[i] * GeV); 109 pnData.push_back(npPDGFit[i] * GeV); 107 pnData.push_back(npPDGFit[i] * GeV); 110 pipData.push_back(pipPDGFit[i] * GeV); 108 pipData.push_back(pipPDGFit[i] * GeV); 111 KpData.push_back(KpPDGFit[i] * GeV); 109 KpData.push_back(KpPDGFit[i] * GeV); 112 KnData.push_back(KnPDGFit[i] * GeV); 110 KnData.push_back(KnPDGFit[i] * GeV); 113 gpData.push_back(gammapPDGFit[i] * GeV); 111 gpData.push_back(gammapPDGFit[i] * GeV); 114 ggData.push_back(gammagammaPDGFit[i] * G 112 ggData.push_back(gammagammaPDGFit[i] * GeV); 115 } 113 } 116 for (i=2; i<nFit; i++) 114 for (i=2; i<nFit; i++) 117 { 115 { 118 nnData.push_back(ppPDGFit[i]); 116 nnData.push_back(ppPDGFit[i]); 119 ppData.push_back(ppPDGFit[i]); 117 ppData.push_back(ppPDGFit[i]); 120 pnData.push_back(npPDGFit[i]); 118 pnData.push_back(npPDGFit[i]); 121 pipData.push_back(pipPDGFit[i]); 119 pipData.push_back(pipPDGFit[i]); 122 KpData.push_back(KpPDGFit[i]); 120 KpData.push_back(KpPDGFit[i]); 123 KnData.push_back(KnPDGFit[i]); 121 KnData.push_back(KnPDGFit[i]); 124 gpData.push_back(gammapPDGFit[i]); 122 gpData.push_back(gammapPDGFit[i]); 125 ggData.push_back(gammagammaPDGFit[i]); 123 ggData.push_back(gammagammaPDGFit[i]); 126 } 124 } 127 125 128 xMap[pp] = std::move(ppData); << 126 xMap[pp] = ppData; 129 xMap[pn] = std::move(pnData); << 127 xMap[pn] = pnData; 130 xMap[piPlusp] = pipData; 128 xMap[piPlusp] = pipData; 131 xMap[piMinusp] = std::move(pipData); << 129 xMap[piMinusp] = pipData; 132 xMap[KPlusp] = KpData; 130 xMap[KPlusp] = KpData; 133 xMap[KPlusn] = KnData; 131 xMap[KPlusn] = KnData; 134 xMap[KMinusp] = std::move(KpData); << 132 xMap[KMinusp] = KpData; 135 xMap[KMinusn] = std::move(KnData); << 133 xMap[KMinusn] = KnData; 136 xMap[gp] = std::move(gpData); << 134 xMap[gp] = gpData; 137 xMap[gg] = std::move(ggData); << 135 xMap[gg] = ggData; 138 xMap[nn] = std::move(nnData); << 136 xMap[nn] = nnData; 139 } 137 } 140 138 141 139 142 G4XPDGTotal::~G4XPDGTotal() 140 G4XPDGTotal::~G4XPDGTotal() 143 { } 141 { } 144 142 145 143 146 G4bool G4XPDGTotal::operator==(const G4XPDGTot 144 G4bool G4XPDGTotal::operator==(const G4XPDGTotal &right) const 147 { 145 { 148 return (this == (G4XPDGTotal *) &right); 146 return (this == (G4XPDGTotal *) &right); 149 } 147 } 150 148 151 149 152 G4bool G4XPDGTotal::operator!=(const G4XPDGTot 150 G4bool G4XPDGTotal::operator!=(const G4XPDGTotal &right) const 153 { 151 { 154 return (this != (G4XPDGTotal *) &right); 152 return (this != (G4XPDGTotal *) &right); 155 } 153 } 156 154 157 155 158 G4double G4XPDGTotal::CrossSection(const G4Kin 156 G4double G4XPDGTotal::CrossSection(const G4KineticTrack& trk1, 159 const G4KineticTrack& trk2) const 157 const G4KineticTrack& trk2) const 160 { 158 { 161 G4double sigma = 0.; 159 G4double sigma = 0.; 162 160 163 G4double sqrtS = (trk1.Get4Momentum() + trk2 161 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag(); 164 162 165 const G4ParticleDefinition* def1 = trk1.GetD << 163 G4ParticleDefinition* def1 = trk1.GetDefinition(); 166 const G4ParticleDefinition* def2 = trk2.GetD << 164 G4ParticleDefinition* def2 = trk2.GetDefinition(); 167 165 168 G4double enc1 = def1->GetPDGEncoding(); 166 G4double enc1 = def1->GetPDGEncoding(); 169 G4double enc2 = def2->GetPDGEncoding(); 167 G4double enc2 = def2->GetPDGEncoding(); 170 G4double coeff = -1.; 168 G4double coeff = -1.; 171 if ( (enc1 < 0 && enc2 >0) || (enc2 < 0 && e 169 if ( (enc1 < 0 && enc2 >0) || (enc2 < 0 && enc1 >0) ) coeff = 1.; 172 170 173 // Order the pair: first is the lower mass p 171 // Order the pair: first is the lower mass particle, second is the higher mass one 174 std::pair<const G4ParticleDefinition *,const << 172 std::pair<G4String,G4String> trkPair(def1->GetParticleName(),def2->GetParticleName()); 175 173 176 if (def1->GetPDGMass() > def2->GetPDGMass()) 174 if (def1->GetPDGMass() > def2->GetPDGMass()) 177 trkPair = std::pair<const G4ParticleDefini << 175 trkPair = std::pair<G4String,G4String>(def2->GetParticleName(),def1->GetParticleName()); 178 176 179 std::vector<G4double> data; 177 std::vector<G4double> data; 180 178 181 if (xMap.find(trkPair) != xMap.end()) 179 if (xMap.find(trkPair) != xMap.end()) 182 { 180 { 183 181 184 PairDoubleMap::const_iterator iter; 182 PairDoubleMap::const_iterator iter; 185 for (iter = xMap.begin(); iter != xMap.e 183 for (iter = xMap.begin(); iter != xMap.end(); ++iter) 186 { 184 { 187 std::pair<const G4ParticleDefinition *,con << 185 std::pair<G4String,G4String> thePair = (*iter).first; 188 if (thePair == trkPair) 186 if (thePair == trkPair) 189 { 187 { 190 data = (*iter).second; 188 data = (*iter).second; 191 189 192 G4double eMinFit = data[0]; 190 G4double eMinFit = data[0]; 193 G4double eMaxFit = data[1]; 191 G4double eMaxFit = data[1]; 194 G4double xFit = data[2]; 192 G4double xFit = data[2]; 195 G4double y1Fit = data[3]; 193 G4double y1Fit = data[3]; 196 G4double y2Fit = data[4]; 194 G4double y2Fit = data[4]; 197 195 198 // Total Cross-section fit, 1998 Revie 196 // Total Cross-section fit, 1998 Review of Particle Properties, European Phys. J. 3(1998), 1 199 197 200 // Parameters from the PDG fit 198 // Parameters from the PDG fit 201 static const G4double epsilon = 0.095; << 199 const G4double epsilon = 0.095; 202 static const G4double eta1 = -0.34; << 200 const G4double eta1 = -0.34; 203 static const G4double eta2 = -0.55; << 201 const G4double eta2 = -0.55; 204 202 205 if (sqrtS < eMinFit || sqrtS > eMaxFit 203 if (sqrtS < eMinFit || sqrtS > eMaxFit) 206 { 204 { 207 G4cout << "WARNING! G4XPDGTotal::P 205 G4cout << "WARNING! G4XPDGTotal::PDGTotal extrapolating cross section at " 208 << sqrtS / GeV 206 << sqrtS / GeV 209 << " GeV outside the PDG fit range 207 << " GeV outside the PDG fit range " 210 << eMinFit / GeV << " - " << eMaxFi 208 << eMinFit / GeV << " - " << eMaxFit / GeV << " GeV " << G4endl; 211 } 209 } 212 210 213 G4double S = (sqrtS * sqrtS) / (GeV*Ge << 211 G4double s = (sqrtS * sqrtS) / (GeV*GeV); 214 212 215 sigma = ( (xFit * G4Pow::GetInstance() << 213 sigma = ( (xFit * std::pow(s,epsilon)) + 216 (y1Fit * G4Pow::GetInstance()->powA(S,et << 214 (y1Fit * std::pow(s,eta1)) + 217 (coeff * y2Fit * G4Pow::GetInstance()->p << 215 (coeff * y2Fit * std::pow(s,eta2)) ) * millibarn; 218 216 219 if (sigma < 0.) 217 if (sigma < 0.) 220 { 218 { 221 G4String name1 = def1->GetParticleName() 219 G4String name1 = def1->GetParticleName(); 222 G4String name2 = def2->GetParticleName() 220 G4String name2 = def2->GetParticleName(); 223 G4cout << "WARNING! G4XPDGTotal::PDGTota 221 G4cout << "WARNING! G4XPDGTotal::PDGTotal " 224 << name1 << "-" << name2 222 << name1 << "-" << name2 225 << " total cross section: Ecm " 223 << " total cross section: Ecm " 226 << sqrtS / GeV << " GeV, negative cross 224 << sqrtS / GeV << " GeV, negative cross section " 227 << sigma / millibarn << " mb set to 0" 225 << sigma / millibarn << " mb set to 0" << G4endl; 228 sigma = 0.; 226 sigma = 0.; 229 } 227 } 230 } 228 } 231 } 229 } 232 } 230 } 233 return sigma; 231 return sigma; 234 } 232 } 235 233 236 234 237 G4String G4XPDGTotal::Name() const 235 G4String G4XPDGTotal::Name() const 238 { 236 { 239 G4String name = "PDGTotal "; 237 G4String name = "PDGTotal "; 240 return name; 238 return name; 241 } 239 } 242 240 243 241 244 G4bool G4XPDGTotal::IsValid(G4double e) const 242 G4bool G4XPDGTotal::IsValid(G4double e) const 245 { 243 { 246 G4bool answer = InLimits(e,_lowLimit,_highLi 244 G4bool answer = InLimits(e,_lowLimit,_highLimit); 247 245 248 return answer; 246 return answer; 249 } 247 } 250 248 251 249 252 G4double G4XPDGTotal::PDGTotal(G4double ,G4dou 250 G4double G4XPDGTotal::PDGTotal(G4double ,G4double ) const 253 { 251 { 254 return 0.; 252 return 0.; 255 } 253 } 256 254 257 255 258 256 259 257 260 258 261 259 262 260 263 261 264 262 265 263 266 264 267 265