Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4XPDGTotal.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // PDG fits, 1998 Review of Particle Properties, European Phys. J. 3(1998), 1
28 // -------------------------------------------------------------------
29 
30 #include "globals.hh"
31 #include "G4ios.hh"
32 #include "G4SystemOfUnits.hh"
33 #include "G4XPDGTotal.hh"
34 #include "G4KineticTrack.hh"
35 #include "G4ParticleDefinition.hh"
36 #include "G4DataVector.hh"
37 #include "G4AntiProton.hh"
38 #include "G4AntiNeutron.hh"
39 #include "G4Proton.hh"
40 #include "G4Neutron.hh"
41 #include "G4PionPlus.hh"
42 #include "G4PionMinus.hh"
43 #include "G4Gamma.hh"
44 #include "G4KaonMinus.hh"
45 #include "G4KaonPlus.hh"
46 
47 const G4double G4XPDGTotal::_lowLimit = 3. * GeV; // 2.99999 * GeV;
48 const G4double G4XPDGTotal::_highLimit = DBL_MAX;
49 
50 // Parameters of the PDG total cross-section fit (Rev. Particle Properties, 1998)
51 // Columns are: lower and higher fit range, X, Y1, Y2
52 const G4int G4XPDGTotal::nFit = 5;
53 // p p
54 const G4double G4XPDGTotal::ppPDGFit[5] = { 3., 40000., 18.256, 60.19, 33.43 };
55 // n p
56 const G4double G4XPDGTotal::npPDGFit[5] = { 3., 40., 18.256, 61.14, 29.80 };
57 // pi p
58 const G4double G4XPDGTotal::pipPDGFit[5] = { 3., 40., 11.568, 27.55, 5.62 };
59 // K p
60 const G4double G4XPDGTotal::KpPDGFit[5] = { 3., 40., 10.376, 15.57, 13.19 };
61 // K n
62 const G4double G4XPDGTotal::KnPDGFit[5] = { 3., 40., 10.376, 14.29, 7.38 };
63 // gamma p
64 const G4double G4XPDGTotal::gammapPDGFit[5] = { 3., 300., 0.0577, 0.1171, 0. };
65 //gamma gamma
66 const G4double G4XPDGTotal::gammagammaPDGFit[5] = { 3., 300., 0.000156, 0.00032, 0. };
67 
68 
70 {
71  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> pp(G4Proton::ProtonDefinition(),
73  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> pn(G4Proton::ProtonDefinition(),
75  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> piPlusp(G4PionPlus::PionPlusDefinition(),
77  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> piMinusp(G4PionMinus::PionMinusDefinition(),
79  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KPlusp(G4KaonPlus::KaonPlusDefinition(),
81  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KPlusn(G4KaonPlus::KaonPlusDefinition(),
83  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KMinusp(G4KaonMinus::KaonMinusDefinition(),
85  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KMinusn(G4KaonMinus::KaonMinusDefinition(),
87  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> gp(G4Gamma::GammaDefinition(),
89  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> gg(G4Gamma::GammaDefinition(),
91  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> nn(G4Neutron::NeutronDefinition(),
93 
94  std::vector<G4double> nnData;
95  std::vector<G4double> ppData;
96  std::vector<G4double> pnData;
97  std::vector<G4double> pipData;
98  std::vector<G4double> KpData;
99  std::vector<G4double> KnData;
100  std::vector<G4double> gpData;
101  std::vector<G4double> ggData;
102 
103  G4int i;
104  for (i=0; i<2; i++)
105  {
106  nnData.push_back(ppPDGFit[i] * GeV);
107  ppData.push_back(ppPDGFit[i] * GeV);
108  pnData.push_back(npPDGFit[i] * GeV);
109  pipData.push_back(pipPDGFit[i] * GeV);
110  KpData.push_back(KpPDGFit[i] * GeV);
111  KnData.push_back(KnPDGFit[i] * GeV);
112  gpData.push_back(gammapPDGFit[i] * GeV);
113  ggData.push_back(gammagammaPDGFit[i] * GeV);
114  }
115  for (i=2; i<nFit; i++)
116  {
117  nnData.push_back(ppPDGFit[i]);
118  ppData.push_back(ppPDGFit[i]);
119  pnData.push_back(npPDGFit[i]);
120  pipData.push_back(pipPDGFit[i]);
121  KpData.push_back(KpPDGFit[i]);
122  KnData.push_back(KnPDGFit[i]);
123  gpData.push_back(gammapPDGFit[i]);
124  ggData.push_back(gammagammaPDGFit[i]);
125  }
126 
127  xMap[pp] = ppData;
128  xMap[pn] = pnData;
129  xMap[piPlusp] = pipData;
130  xMap[piMinusp] = pipData;
131  xMap[KPlusp] = KpData;
132  xMap[KPlusn] = KnData;
133  xMap[KMinusp] = KpData;
134  xMap[KMinusn] = KnData;
135  xMap[gp] = gpData;
136  xMap[gg] = ggData;
137  xMap[nn] = nnData;
138 }
139 
140 
142 { }
143 
144 
146 {
147  return (this == (G4XPDGTotal *) &right);
148 }
149 
150 
152 {
153  return (this != (G4XPDGTotal *) &right);
154 }
155 
156 
158  const G4KineticTrack& trk2) const
159 {
160  G4double sigma = 0.;
161 
162  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
163 
164  G4ParticleDefinition* def1 = trk1.GetDefinition();
165  G4ParticleDefinition* def2 = trk2.GetDefinition();
166 
167  G4double enc1 = def1->GetPDGEncoding();
168  G4double enc2 = def2->GetPDGEncoding();
169  G4double coeff = -1.;
170  if ( (enc1 < 0 && enc2 >0) || (enc2 < 0 && enc1 >0) ) coeff = 1.;
171 
172  // Order the pair: first is the lower mass particle, second is the higher mass one
173  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> trkPair(def1,def2);
174 
175  if (def1->GetPDGMass() > def2->GetPDGMass())
176  trkPair = std::pair<G4ParticleDefinition *,G4ParticleDefinition *>(def2,def1);
177 
178  std::vector<G4double> data;
179 
180  if (xMap.find(trkPair) != xMap.end())
181  {
182 
183  PairDoubleMap::const_iterator iter;
184  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
185  {
186  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> thePair = (*iter).first;
187  if (thePair == trkPair)
188  {
189  data = (*iter).second;
190 
191  G4double eMinFit = data[0];
192  G4double eMaxFit = data[1];
193  G4double xFit = data[2];
194  G4double y1Fit = data[3];
195  G4double y2Fit = data[4];
196 
197  // Total Cross-section fit, 1998 Review of Particle Properties, European Phys. J. 3(1998), 1
198 
199  // Parameters from the PDG fit
200  const G4double epsilon = 0.095;
201  const G4double eta1 = -0.34;
202  const G4double eta2 = -0.55;
203 
204  if (sqrtS < eMinFit || sqrtS > eMaxFit)
205  {
206  G4cout << "WARNING! G4XPDGTotal::PDGTotal extrapolating cross section at "
207  << sqrtS / GeV
208  << " GeV outside the PDG fit range "
209  << eMinFit / GeV << " - " << eMaxFit / GeV << " GeV " << G4endl;
210  }
211 
212  G4double S = (sqrtS * sqrtS) / (GeV*GeV);
213 
214  sigma = ( (xFit * std::pow(S,epsilon)) +
215  (y1Fit * std::pow(S,eta1)) +
216  (coeff * y2Fit * std::pow(S,eta2)) ) * millibarn;
217 
218  if (sigma < 0.)
219  {
220  G4String name1 = def1->GetParticleName();
221  G4String name2 = def2->GetParticleName();
222  G4cout << "WARNING! G4XPDGTotal::PDGTotal "
223  << name1 << "-" << name2
224  << " total cross section: Ecm "
225  << sqrtS / GeV << " GeV, negative cross section "
226  << sigma / millibarn << " mb set to 0" << G4endl;
227  sigma = 0.;
228  }
229  }
230  }
231  }
232  return sigma;
233 }
234 
235 
237 {
238  G4String name = "PDGTotal ";
239  return name;
240 }
241 
242 
244 {
245  G4bool answer = InLimits(e,_lowLimit,_highLimit);
246 
247  return answer;
248 }
249 
250 
251 G4double G4XPDGTotal::PDGTotal(G4double ,G4double ) const
252 {
253  return 0.;
254 }
255 
256 
257 
258 
259 
260 
261 
262 
263 
264 
265 
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
const XML_Char * name
int G4int
Definition: G4Types.hh:78
int millibarn
Definition: hepunit.py:40
const G4String & GetParticleName() const
virtual G4bool IsValid(G4double e) const
Definition: G4XPDGTotal.cc:243
G4ParticleDefinition * GetDefinition() const
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
bool G4bool
Definition: G4Types.hh:79
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
G4bool operator==(const G4XPDGTotal &right) const
Definition: G4XPDGTotal.cc:145
virtual G4String Name() const
Definition: G4XPDGTotal.cc:236
G4double GetPDGMass() const
#define G4endl
Definition: G4ios.hh:61
virtual ~G4XPDGTotal()
Definition: G4XPDGTotal.cc:141
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
Definition: G4XPDGTotal.cc:157
#define DBL_MAX
Definition: templates.hh:83
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
const XML_Char const XML_Char * data
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
G4bool operator!=(const G4XPDGTotal &right) const
Definition: G4XPDGTotal.cc:151