Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4XPDGElastic Class Reference

#include <G4XPDGElastic.hh>

+ Inheritance 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 G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual const G4CrossSectionVectorGetComponents () const =0
 
virtual G4String Name () const =0
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4bool IsValid (G4double e) const
 
virtual G4double HighLimit () const
 
virtual G4double LowLimit () 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
 
G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4double GetTransversePionMass () const
 
G4double GetMinStringMass () const
 

Detailed Description

Definition at line 55 of file G4XPDGElastic.hh.

Constructor & Destructor Documentation

◆ G4XPDGElastic()

G4XPDGElastic::G4XPDGElastic ( )

Definition at line 75 of file G4XPDGElastic.cc.

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

◆ ~G4XPDGElastic()

G4XPDGElastic::~G4XPDGElastic ( )
virtual

Definition at line 138 of file G4XPDGElastic.cc.

139{ }

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 154 of file G4XPDGElastic.cc.

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

Referenced by G4XMesonBaryonElastic::CrossSection().

◆ GetComponents()

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

Implements G4VCrossSectionSource.

Definition at line 69 of file G4XPDGElastic.hh.

69{ return 0; }

◆ IsValid()

G4bool G4XPDGElastic::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 259 of file G4XPDGElastic.cc.

260{
261 G4bool answer = InLimits(e,_lowLimit,_highLimit);
262
263 return answer;
264}
bool G4bool
Definition: G4Types.hh:67
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

◆ LowLimit()

virtual G4double G4XPDGElastic::LowLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 75 of file G4XPDGElastic.hh.

75{ return _lowLimit; }

◆ Name()

G4String G4XPDGElastic::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 252 of file G4XPDGElastic.cc.

253{
254 G4String name = "PDGElastic ";
255 return name;
256}

◆ operator!=()

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

Definition at line 148 of file G4XPDGElastic.cc.

149{
150 return (this != (G4XPDGElastic *) &right);
151}

◆ operator==()

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

Definition at line 142 of file G4XPDGElastic.cc.

143{
144 return (this == (G4XPDGElastic *) &right);
145}

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