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

#include <G4XPDGTotal.hh>

+ Inheritance 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 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 G4XPDGTotal.hh.

Constructor & Destructor Documentation

◆ G4XPDGTotal()

G4XPDGTotal::G4XPDGTotal ( )

Definition at line 69 of file G4XPDGTotal.cc.

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}
int G4int
Definition: G4Types.hh:66
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
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

◆ ~G4XPDGTotal()

G4XPDGTotal::~G4XPDGTotal ( )
virtual

Definition at line 141 of file G4XPDGTotal.cc.

142{ }

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 157 of file G4XPDGTotal.cc.

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}
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 G4XpimNTotal::CrossSection(), and G4XpipNTotal::CrossSection().

◆ GetComponents()

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

Implements G4VCrossSectionSource.

Definition at line 69 of file G4XPDGTotal.hh.

69{ return 0; }

◆ IsValid()

G4bool G4XPDGTotal::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 243 of file G4XPDGTotal.cc.

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

◆ LowLimit()

virtual G4double G4XPDGTotal::LowLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 75 of file G4XPDGTotal.hh.

75{ return _lowLimit; }

◆ Name()

G4String G4XPDGTotal::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 236 of file G4XPDGTotal.cc.

237{
238 G4String name = "PDGTotal ";
239 return name;
240}

◆ operator!=()

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

Definition at line 151 of file G4XPDGTotal.cc.

152{
153 return (this != (G4XPDGTotal *) &right);
154}

◆ operator==()

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

Definition at line 145 of file G4XPDGTotal.cc.

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

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