Geant4  10.02.p03
G4XPDGElastic Class Reference

#include <G4XPDGElastic.hh>

Inheritance diagram for G4XPDGElastic:
Collaboration diagram for G4XPDGElastic:

Public Member Functions

 G4XPDGElastic ()
 
virtual ~G4XPDGElastic ()
 
G4bool operator== (const G4XPDGElastic &right) const
 
G4bool operator!= (const G4XPDGElastic &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const G4CrossSectionVectorGetComponents () 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
 

Private Types

typedef std::map< G4pDefPair, std::vector< G4double >, std::less< G4pDefPair > > PairDoubleMap
 

Private Member Functions

 G4XPDGElastic (const G4XPDGElastic &right)
 
const G4XPDGElasticoperator= (const G4XPDGElastic &right)
 

Private Attributes

std::map< G4pDefPair, std::vector< G4double >, std::less< G4pDefPair > > xMap
 

Static Private Attributes

static const G4double _lowLimit = 5. * GeV
 
static const G4double _highLimit = DBL_MAX
 
static const G4int nPar = 7
 
static const G4double pPiPlusPDGFit [7] = { 2., 200., 0., 11.4, -0.4, 0.079, 0. }
 
static const G4double pPiMinusPDGFit [7] = { 2., 360., 1.76, 11.2, -0.64, 0.043, 0. }
 
static const G4double pKPlusPDGFit [7] = { 2., 175., 5.0, 8.1, -1.8, 0.16, -1.3 }
 
static const G4double pKMinusPDGFit [7] = { 2., 175., 7.3, 0., 0., 0.29, -2.40 }
 
static const G4double ppPDGFit [7] = { 2., 2100., 11.9, 26.9, -1.21, 0.169, -1.85 }
 
static const G4double ppbarPDGFit [7] = { 5., 1730000., 10.2, 52.7, -1.16, 0.125, -1.28 }
 
static const G4double npbarPDGFit [7] = { 1.1, 5.55, 36.5, 0., 0., 0., -11.9 }
 

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 G4XPDGElastic.hh.

Member Typedef Documentation

◆ PairDoubleMap

typedef std::map<G4pDefPair, std::vector<G4double>, std::less<G4pDefPair> > G4XPDGElastic::PairDoubleMap
private

Definition at line 100 of file G4XPDGElastic.hh.

Constructor & Destructor Documentation

◆ G4XPDGElastic() [1/2]

G4XPDGElastic::G4XPDGElastic ( )

Definition at line 77 of file G4XPDGElastic.cc.

78 {
86 
87  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> pp(proton,proton);
88  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> pn(proton,neutron);
89  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> piPlusp(piPlus,proton);
90  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> piMinusp(piMinus,proton);
91  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> KPlusp(KPlus,proton);
92  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> KMinusp(KMinus,proton);
93  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> nn(neutron,neutron);
94  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> ppbar(proton,antiproton);
95  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> npbar(antiproton,neutron);
96 
97  std::vector<G4double> ppData;
98  std::vector<G4double> pPiPlusData;
99  std::vector<G4double> pPiMinusData;
100  std::vector<G4double> pKPlusData;
101  std::vector<G4double> pKMinusData;
102  std::vector<G4double> ppbarData;
103  std::vector<G4double> npbarData;
104 
105  G4int i;
106  for (i=0; i<2; i++)
107  {
108  ppData.push_back(ppPDGFit[i] * GeV);
109  pPiPlusData.push_back(pPiPlusPDGFit[i] * GeV);
110  pPiMinusData.push_back(pPiMinusPDGFit[i] * GeV);
111  pKPlusData.push_back(pKPlusPDGFit[i] * GeV);
112  pKMinusData.push_back(pKMinusPDGFit[i] * GeV);
113  ppbarData.push_back(ppbarPDGFit[i] * GeV);
114  npbarData.push_back(npbarPDGFit[i] * GeV);
115  }
116 
117  for (i=2; i<nPar; i++)
118  {
119  ppData.push_back(ppPDGFit[i]);
120  pPiPlusData.push_back(pPiPlusPDGFit[i]);
121  pPiMinusData.push_back(pPiMinusPDGFit[i]);
122  pKPlusData.push_back(pKPlusPDGFit[i]);
123  pKMinusData.push_back(pKMinusPDGFit[i]);
124  ppbarData.push_back(ppbarPDGFit[i]);
125  npbarData.push_back(npbarPDGFit[i]);
126  }
127 
128  xMap[nn] = ppData;
129  xMap[pp] = ppData;
130  xMap[pn] = ppData;
131  xMap[piPlusp] = pPiPlusData;
132  xMap[piMinusp] = pPiMinusData;
133  xMap[KPlusp] = pKPlusData;
134  xMap[KMinusp] = pKMinusData;
135  xMap[ppbar] = ppbarData;
136  xMap[npbar] = npbarData;
137 }
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static const G4double ppbarPDGFit[7]
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
static const G4double pKPlusPDGFit[7]
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
int G4int
Definition: G4Types.hh:78
std::map< G4pDefPair, std::vector< G4double >, std::less< G4pDefPair > > xMap
static const G4double pPiMinusPDGFit[7]
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
static const double GeV
Definition: G4SIunits.hh:214
static const G4double ppPDGFit[7]
static const G4double pPiPlusPDGFit[7]
static const G4double pKMinusPDGFit[7]
static const G4double npbarPDGFit[7]
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
static const G4int nPar
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~G4XPDGElastic()

G4XPDGElastic::~G4XPDGElastic ( )
virtual

Definition at line 140 of file G4XPDGElastic.cc.

141 { }

◆ G4XPDGElastic() [2/2]

G4XPDGElastic::G4XPDGElastic ( const G4XPDGElastic right)
private

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 156 of file G4XPDGElastic.cc.

157 {
158  // Elastic Cross-section fit, 1994 Review of Particle Properties, (1994), 1
159 
160  G4double sigma = 0.;
161 
162  const G4ParticleDefinition* def1 = trk1.GetDefinition();
163  const G4ParticleDefinition* def2 = trk2.GetDefinition();
164 
165  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
166  G4double m_1 = def1->GetPDGMass();
167  G4double m_2 = def2->GetPDGMass();
168  G4double m_max = std::max(m_1,m_2);
169  // if (m1 > m) m = m1;
170 
171  G4double pLab = 0.;
172 
173  if (m_max > 0. && sqrtS > (m_1 + m_2))
174  {
175  pLab = std::sqrt( (sqrtS*sqrtS - (m_1+m_2)*(m_1+m_2) ) * (sqrtS*sqrtS - (m_1-m_2)*(m_1-m_2)) ) / (2*m_max);
176 
177  // The PDG fit formula requires p in GeV/c
178 
179  // Order the pair: first is the lower mass particle, second is the higher mass one
180  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> trkPair(def1,def2);
181  if (def1->GetPDGMass() > def2->GetPDGMass())
182  trkPair = std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *>(def2,def1);
183 
184  std::vector<G4double> data;
185  G4double pMinFit = 0.;
186  G4double pMaxFit = 0.;
187  G4double aFit = 0.;
188  G4double bFit = 0.;
189  G4double cFit = 0.;
190  G4double dFit = 0.;
191  G4double nFit = 0.;
192 
193  // Debug
194 // G4cout << "Map has " << xMap.size() << " elements" << G4endl;
195  // Debug end
196 
197  if (xMap.find(trkPair) != xMap.end())
198  {
199  PairDoubleMap::const_iterator iter;
200  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
201  {
202  std::pair<const G4ParticleDefinition *,const G4ParticleDefinition *> thePair = (*iter).first;
203  if (thePair == trkPair)
204  {
205  data = (*iter).second;
206  pMinFit = data[0];
207  pMaxFit = data[1];
208  aFit = data[2];
209  bFit = data[3];
210  cFit = data[5];
211  dFit = data[6];
212  nFit = data[4];
213 
214  if (pLab < pMinFit) return 0.0;
215  if (pLab > pMaxFit )
216  G4cout << "WARNING! G4XPDGElastic::PDGElastic "
217  << trk1.GetDefinition()->GetParticleName() << "-"
218  << trk2.GetDefinition()->GetParticleName()
219  << " elastic cross section: momentum "
220  << pLab / GeV << " GeV outside valid fit range "
221  << pMinFit /GeV << "-" << pMaxFit / GeV
222  << G4endl;
223 
224  pLab /= GeV;
225  if (pLab > 0.)
226  {
227  G4double logP = G4Log(pLab);
228  sigma = aFit + bFit * G4Pow::GetInstance()->powA(pLab, nFit) + cFit * logP*logP + dFit * logP;
229  sigma = sigma * millibarn;
230  }
231  }
232  }
233  }
234  else
235  {
236  G4cout << "G4XPDGElastic::CrossSection - Data not found in Map" << G4endl;
237  }
238  }
239 
240  if (sigma < 0.)
241  {
242  G4cout << "WARNING! G4XPDGElastic::PDGElastic "
243  << def1->GetParticleName() << "-" << def2->GetParticleName()
244  << " elastic cross section: momentum "
245  << pLab << " GeV, negative cross section "
246  << sigma / millibarn << " mb set to 0" << G4endl;
247  sigma = 0.;
248  }
249 
250  return sigma;
251 }
const G4ParticleDefinition * GetDefinition() const
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
std::map< G4pDefPair, std::vector< G4double >, std::less< G4pDefPair > > xMap
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static const double GeV
Definition: G4SIunits.hh:214
G4double G4Log(G4double x)
Definition: G4Log.hh:230
static const double millibarn
Definition: G4SIunits.hh:105
#define G4endl
Definition: G4ios.hh:61
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetComponents()

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

Implements G4VCrossSectionSource.

Definition at line 69 of file G4XPDGElastic.hh.

69 { return 0; }
Here is the call graph for this function:

◆ IsValid()

G4bool G4XPDGElastic::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 261 of file G4XPDGElastic.cc.

262 {
264 
265  return answer;
266 }
bool G4bool
Definition: G4Types.hh:79
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const
static const G4double _lowLimit
static const G4double _highLimit
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LowLimit()

virtual G4double G4XPDGElastic::LowLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 75 of file G4XPDGElastic.hh.

75 { return _lowLimit; }
static const G4double _lowLimit
Here is the call graph for this function:

◆ Name()

G4String G4XPDGElastic::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 254 of file G4XPDGElastic.cc.

255 {
256  G4String name = "PDGElastic ";
257  return name;
258 }
G4String name
Definition: TRTMaterials.hh:40
Here is the caller graph for this function:

◆ operator!=()

G4bool G4XPDGElastic::operator!= ( const G4XPDGElastic right) const

Definition at line 150 of file G4XPDGElastic.cc.

151 {
152  return (this != (G4XPDGElastic *) &right);
153 }

◆ operator=()

const G4XPDGElastic& G4XPDGElastic::operator= ( const G4XPDGElastic right)
private
Here is the caller graph for this function:

◆ operator==()

G4bool G4XPDGElastic::operator== ( const G4XPDGElastic right) const

Definition at line 144 of file G4XPDGElastic.cc.

145 {
146  return (this == (G4XPDGElastic *) &right);
147 }

Member Data Documentation

◆ _highLimit

const G4double G4XPDGElastic::_highLimit = DBL_MAX
staticprivate

Definition at line 87 of file G4XPDGElastic.hh.

◆ _lowLimit

const G4double G4XPDGElastic::_lowLimit = 5. * GeV
staticprivate

Definition at line 86 of file G4XPDGElastic.hh.

◆ nPar

const G4int G4XPDGElastic::nPar = 7
staticprivate

Definition at line 89 of file G4XPDGElastic.hh.

◆ npbarPDGFit

const G4double G4XPDGElastic::npbarPDGFit = { 1.1, 5.55, 36.5, 0., 0., 0., -11.9 }
staticprivate

Definition at line 96 of file G4XPDGElastic.hh.

◆ pKMinusPDGFit

const G4double G4XPDGElastic::pKMinusPDGFit = { 2., 175., 7.3, 0., 0., 0.29, -2.40 }
staticprivate

Definition at line 93 of file G4XPDGElastic.hh.

◆ pKPlusPDGFit

const G4double G4XPDGElastic::pKPlusPDGFit = { 2., 175., 5.0, 8.1, -1.8, 0.16, -1.3 }
staticprivate

Definition at line 92 of file G4XPDGElastic.hh.

◆ ppbarPDGFit

const G4double G4XPDGElastic::ppbarPDGFit = { 5., 1730000., 10.2, 52.7, -1.16, 0.125, -1.28 }
staticprivate

Definition at line 95 of file G4XPDGElastic.hh.

◆ pPiMinusPDGFit

const G4double G4XPDGElastic::pPiMinusPDGFit = { 2., 360., 1.76, 11.2, -0.64, 0.043, 0. }
staticprivate

Definition at line 91 of file G4XPDGElastic.hh.

◆ pPiPlusPDGFit

const G4double G4XPDGElastic::pPiPlusPDGFit = { 2., 200., 0., 11.4, -0.4, 0.079, 0. }
staticprivate

Definition at line 90 of file G4XPDGElastic.hh.

◆ ppPDGFit

const G4double G4XPDGElastic::ppPDGFit = { 2., 2100., 11.9, 26.9, -1.21, 0.169, -1.85 }
staticprivate

Definition at line 94 of file G4XPDGElastic.hh.

◆ xMap

std::map<G4pDefPair, std::vector<G4double>, std::less<G4pDefPair> > G4XPDGElastic::xMap
private

Definition at line 98 of file G4XPDGElastic.hh.


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