Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4XPDGTotal Class Reference

#include <G4XPDGTotal.hh>

Inheritance diagram for G4XPDGTotal:
Collaboration diagram for G4XPDGTotal:

Public Member Functions

 G4XPDGTotal ()
 
virtual ~G4XPDGTotal ()
 
G4bool operator== (const G4XPDGTotal &right) const
 
G4bool operator!= (const G4XPDGTotal &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const
G4CrossSectionVector
GetComponents () const
 
virtual G4String Name () const
 
virtual G4bool IsValid (G4double e) const
 
virtual G4double LowLimit () const
 
- Public Member Functions inherited from G4VCrossSectionSource
 G4VCrossSectionSource ()
 
virtual ~G4VCrossSectionSource ()
 
G4bool operator== (const G4VCrossSectionSource &right) const
 
G4bool operator!= (const G4VCrossSectionSource &right) const
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4double HighLimit () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionSource
G4bool InLimits (G4double e, G4double eLow, G4double eHigh) const
 
const G4ParticleDefinitionFindLightParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4double FcrossX (G4double e, G4double e0, G4double sigma, G4double eParam, G4double power) const
 
const G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 

Detailed Description

Definition at line 55 of file G4XPDGTotal.hh.

Constructor & Destructor Documentation

G4XPDGTotal::G4XPDGTotal ( )

Definition at line 70 of file G4XPDGTotal.cc.

71 {
72  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> pp(G4Proton::ProtonDefinition(),
74  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> pn(G4Proton::ProtonDefinition(),
76  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> piPlusp(G4PionPlus::PionPlusDefinition(),
78  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> piMinusp(G4PionMinus::PionMinusDefinition(),
80  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> KPlusp(G4KaonPlus::KaonPlusDefinition(),
82  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> KPlusn(G4KaonPlus::KaonPlusDefinition(),
84  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> KMinusp(G4KaonMinus::KaonMinusDefinition(),
86  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> KMinusn(G4KaonMinus::KaonMinusDefinition(),
88  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> gp(G4Gamma::GammaDefinition(),
90  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> gg(G4Gamma::GammaDefinition(),
92  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> nn(G4Neutron::NeutronDefinition(),
94 
95  std::vector<G4double> nnData;
96  std::vector<G4double> ppData;
97  std::vector<G4double> pnData;
98  std::vector<G4double> pipData;
99  std::vector<G4double> KpData;
100  std::vector<G4double> KnData;
101  std::vector<G4double> gpData;
102  std::vector<G4double> ggData;
103 
104  G4int i;
105  for (i=0; i<2; i++)
106  {
107  nnData.push_back(ppPDGFit[i] * GeV);
108  ppData.push_back(ppPDGFit[i] * GeV);
109  pnData.push_back(npPDGFit[i] * GeV);
110  pipData.push_back(pipPDGFit[i] * GeV);
111  KpData.push_back(KpPDGFit[i] * GeV);
112  KnData.push_back(KnPDGFit[i] * GeV);
113  gpData.push_back(gammapPDGFit[i] * GeV);
114  ggData.push_back(gammagammaPDGFit[i] * GeV);
115  }
116  for (i=2; i<nFit; i++)
117  {
118  nnData.push_back(ppPDGFit[i]);
119  ppData.push_back(ppPDGFit[i]);
120  pnData.push_back(npPDGFit[i]);
121  pipData.push_back(pipPDGFit[i]);
122  KpData.push_back(KpPDGFit[i]);
123  KnData.push_back(KnPDGFit[i]);
124  gpData.push_back(gammapPDGFit[i]);
125  ggData.push_back(gammagammaPDGFit[i]);
126  }
127 
128  xMap[pp] = ppData;
129  xMap[pn] = pnData;
130  xMap[piPlusp] = pipData;
131  xMap[piMinusp] = pipData;
132  xMap[KPlusp] = KpData;
133  xMap[KPlusn] = KnData;
134  xMap[KMinusp] = KpData;
135  xMap[KMinusn] = KnData;
136  xMap[gp] = gpData;
137  xMap[gg] = ggData;
138  xMap[nn] = nnData;
139 }
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
int G4int
Definition: G4Types.hh:78
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
static constexpr double GeV
Definition: G4SIunits.hh:217
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81

Here is the call graph for this function:

G4XPDGTotal::~G4XPDGTotal ( )
virtual

Definition at line 142 of file G4XPDGTotal.cc.

143 { }

Member Function Documentation

G4double G4XPDGTotal::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtual

Implements G4VCrossSectionSource.

Definition at line 158 of file G4XPDGTotal.cc.

160 {
161  G4double sigma = 0.;
162 
163  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
164 
165  const G4ParticleDefinition* def1 = trk1.GetDefinition();
166  const G4ParticleDefinition* def2 = trk2.GetDefinition();
167 
168  G4double enc1 = def1->GetPDGEncoding();
169  G4double enc2 = def2->GetPDGEncoding();
170  G4double coeff = -1.;
171  if ( (enc1 < 0 && enc2 >0) || (enc2 < 0 && enc1 >0) ) coeff = 1.;
172 
173  // Order the pair: first is the lower mass particle, second is the higher mass one
174  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> trkPair(def1,def2);
175 
176  if (def1->GetPDGMass() > def2->GetPDGMass())
177  trkPair = std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *>(def2,def1);
178 
179  std::vector<G4double> data;
180 
181  if (xMap.find(trkPair) != xMap.end())
182  {
183 
184  PairDoubleMap::const_iterator iter;
185  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
186  {
187  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> thePair = (*iter).first;
188  if (thePair == trkPair)
189  {
190  data = (*iter).second;
191 
192  G4double eMinFit = data[0];
193  G4double eMaxFit = data[1];
194  G4double xFit = data[2];
195  G4double y1Fit = data[3];
196  G4double y2Fit = data[4];
197 
198  // Total Cross-section fit, 1998 Review of Particle Properties, European Phys. J. 3(1998), 1
199 
200  // Parameters from the PDG fit
201  static const G4double epsilon = 0.095;
202  static const G4double eta1 = -0.34;
203  static const G4double eta2 = -0.55;
204 
205  if (sqrtS < eMinFit || sqrtS > eMaxFit)
206  {
207  G4cout << "WARNING! G4XPDGTotal::PDGTotal extrapolating cross section at "
208  << sqrtS / GeV
209  << " GeV outside the PDG fit range "
210  << eMinFit / GeV << " - " << eMaxFit / GeV << " GeV " << G4endl;
211  }
212 
213  G4double S = (sqrtS * sqrtS) / (GeV*GeV);
214 
215  sigma = ( (xFit * G4Pow::GetInstance()->powA(S,epsilon)) +
216  (y1Fit * G4Pow::GetInstance()->powA(S,eta1)) +
217  (coeff * y2Fit * G4Pow::GetInstance()->powA(S,eta2)) ) * millibarn;
218 
219  if (sigma < 0.)
220  {
221  G4String name1 = def1->GetParticleName();
222  G4String name2 = def2->GetParticleName();
223  G4cout << "WARNING! G4XPDGTotal::PDGTotal "
224  << name1 << "-" << name2
225  << " total cross section: Ecm "
226  << sqrtS / GeV << " GeV, negative cross section "
227  << sigma / millibarn << " mb set to 0" << G4endl;
228  sigma = 0.;
229  }
230  }
231  }
232  }
233  return sigma;
234 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double S(double temp)
const G4String & GetParticleName() const
const XML_Char const XML_Char * data
Definition: expat.h:268
G4GLOB_DLL std::ostream G4cout
G4double GetPDGMass() const
static constexpr double GeV
Definition: G4SIunits.hh:217
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
const G4ParticleDefinition * GetDefinition() const
double epsilon(double density, double temperature)
static constexpr double millibarn
Definition: G4SIunits.hh:106

Here is the call graph for this function:

Here is the caller graph for this function:

virtual const G4CrossSectionVector* G4XPDGTotal::GetComponents ( ) const
inlinevirtual

Implements G4VCrossSectionSource.

Definition at line 69 of file G4XPDGTotal.hh.

69 { return 0; }
G4bool G4XPDGTotal::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 244 of file G4XPDGTotal.cc.

245 {
246  G4bool answer = InLimits(e,_lowLimit,_highLimit);
247 
248  return answer;
249 }
bool G4bool
Definition: G4Types.hh:79
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

Here is the call graph for this function:

virtual G4double G4XPDGTotal::LowLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 75 of file G4XPDGTotal.hh.

75 { return _lowLimit; }
G4String G4XPDGTotal::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 237 of file G4XPDGTotal.cc.

238 {
239  G4String name = "PDGTotal ";
240  return name;
241 }
const XML_Char * name
Definition: expat.h:151
G4bool G4XPDGTotal::operator!= ( const G4XPDGTotal right) const

Definition at line 152 of file G4XPDGTotal.cc.

153 {
154  return (this != (G4XPDGTotal *) &right);
155 }
G4bool G4XPDGTotal::operator== ( const G4XPDGTotal right) const

Definition at line 146 of file G4XPDGTotal.cc.

147 {
148  return (this == (G4XPDGTotal *) &right);
149 }

The documentation for this class was generated from the following files: