Geant4-11
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4XNNElasticLowE Class Reference

#include <G4XNNElasticLowE.hh>

Inheritance diagram for G4XNNElasticLowE:
G4VCrossSectionSource

Public Member Functions

virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
 G4XNNElasticLowE ()
 
virtual const G4CrossSectionVectorGetComponents () const
 
virtual G4double HighLimit () const
 
virtual G4bool IsValid (G4double e) const
 
virtual G4double LowLimit () const
 
virtual G4String Name () const
 
G4bool operator!= (const G4VCrossSectionSource &right) const
 
G4bool operator!= (const G4XNNElasticLowE &right) const
 
G4bool operator== (const G4VCrossSectionSource &right) const
 
G4bool operator== (const G4XNNElasticLowE &right) const
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual ~G4XNNElasticLowE ()
 

Protected Member Functions

G4double FcrossX (G4double e, G4double e0, G4double sigma, G4double eParam, G4double power) const
 
const G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
const G4ParticleDefinitionFindLightParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4bool InLimits (G4double e, G4double eLow, G4double eHigh) const
 

Private Member Functions

 G4XNNElasticLowE (const G4XNNElasticLowE &right)
 
const G4XNNElasticLowEoperator= (const G4XNNElasticLowE &right)
 

Private Attributes

G4double _eMax
 
G4double _eMin
 
std::map< const G4ParticleDefinition *, G4PhysicsVector *, std::less< const G4ParticleDefinition * > > xMap
 

Static Private Attributes

static const G4double _eMinTable = 1.8964808
 
static const G4double _eStepLog = 0.01
 
static const G4double _highLimit = 3.*GeV
 
static const G4double _lowLimit = 0.
 
static const G4double npTable [101]
 
static const G4double ppTable [101]
 
static const G4int tableSize = 101
 

Detailed Description

Definition at line 39 of file G4XNNElasticLowE.hh.

Constructor & Destructor Documentation

◆ G4XNNElasticLowE() [1/2]

G4XNNElasticLowE::G4XNNElasticLowE ( )

Definition at line 89 of file G4XNNElasticLowE.cc.

90{
91 // Cross-sections are available in the range (_eMin,_eMax)
92
95 if (_eMin < _lowLimit)
96 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
97 if (_highLimit > _eMax)
98 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - High energy limit not valid");
100
102 if (_eMin < _lowLimit)
103 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
105
106 G4int i;
107 for (i=0; i<tableSize; i++)
108 {
109 G4double value = ppTable[i] * millibarn;
110 pp->PutValue(i,value);
111 value = npTable[i] * millibarn;
112 np->PutValue(i,value);
113 }
116}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
G4double G4Log(G4double x)
Definition: G4Log.hh:226
static constexpr double millibarn
Definition: G4SIunits.hh:86
static constexpr double GeV
Definition: G4SIunits.hh:203
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:98
void PutValue(const std::size_t index, const G4double value)
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:87
static const G4double _lowLimit
static const G4double _eStepLog
std::map< const G4ParticleDefinition *, G4PhysicsVector *, std::less< const G4ParticleDefinition * > > xMap
static const G4double ppTable[101]
static const G4double _highLimit
static const G4double _eMinTable
static const G4double npTable[101]
static const G4int tableSize

References _eMax, _eMin, _eMinTable, _eStepLog, _highLimit, _lowLimit, G4Exp(), G4Log(), GeV, millibarn, G4Neutron::NeutronDefinition(), npTable, G4InuclParticleNames::pp, ppTable, G4Proton::ProtonDefinition(), G4PhysicsVector::PutValue(), tableSize, and xMap.

◆ ~G4XNNElasticLowE()

G4XNNElasticLowE::~G4XNNElasticLowE ( )
virtual

◆ G4XNNElasticLowE() [2/2]

G4XNNElasticLowE::G4XNNElasticLowE ( const G4XNNElasticLowE right)
private

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 139 of file G4XNNElasticLowE.cc.

140{
141 G4double sigma = 0.;
142 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
143 G4bool dummy = false;
144
145 const G4ParticleDefinition * key = FindKeyParticle(trk1,trk2);
146
147 typedef std::map <const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > StringPhysMap;
148
149 if (xMap.find(key)!= xMap.end())
150 {
151
152 StringPhysMap::const_iterator iter;
153 for (iter = xMap.begin(); iter != xMap.end(); ++iter)
154 {
155 const G4ParticleDefinition * str = (*iter).first;
156 if (str == key)
157 {
158 G4PhysicsVector* physVector = (*iter).second;
159 // G4PhysicsVector* physVector = xMap[key];
160 if (sqrtS >= _eMin && sqrtS <= _eMax)
161 {
162 sigma = physVector->GetValue(sqrtS,dummy);
163 } else if ( sqrtS < _eMin )
164 {
165 sigma = physVector->GetValue(_eMin,dummy);
166 }
167 //G4cout << " sqrtS / sigma " << sqrtS/GeV << " / " <<
168 // sigma/millibarn << G4endl;
169 }
170 }
171 }
172 return sigma;
173}
bool G4bool
Definition: G4Types.hh:86
const G4LorentzVector & Get4Momentum() const
G4double GetValue(const G4double energy, G4bool &isOutRange) const
const G4ParticleDefinition * FindKeyParticle(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const

References _eMax, _eMin, G4VCrossSectionSource::FindKeyParticle(), G4KineticTrack::Get4Momentum(), G4PhysicsVector::GetValue(), and xMap.

◆ FcrossX()

G4double G4VCrossSectionSource::FcrossX ( G4double  e,
G4double  e0,
G4double  sigma,
G4double  eParam,
G4double  power 
) const
protectedinherited

Definition at line 174 of file G4VCrossSectionSource.cc.

176{
177 G4double result = 0.;
178
179 G4double denom = eParam*eParam + (e-e0)*(e-e0);
180 if (denom > 0.)
181 {
182 G4double value = (2.* eParam * sigma * (e-e0) / denom) * G4Pow::GetInstance()->powA(((e0 + eParam) / e), power);
183 result = std::max(0., value);
184 }
185 return result;
186}
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References G4Pow::GetInstance(), G4INCL::Math::max(), and G4Pow::powA().

◆ FindKeyParticle()

const G4ParticleDefinition * G4VCrossSectionSource::FindKeyParticle ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
protectedinherited

Definition at line 49 of file G4VCrossSectionSource.cc.

51{
52 const G4ParticleDefinition * result;
53
54 const G4ParticleDefinition * p1 = trk1.GetDefinition();
55 const G4ParticleDefinition * p2 = trk2.GetDefinition();
56
57 if( (p1==G4Proton::Proton() && p2==G4Proton::Proton() ) ||
58 (p1==G4Neutron::Neutron() && p2==G4Neutron::Neutron()) )
59 {
60 result = G4Proton::Proton();
61 }
62 else if( (p1==G4Neutron::Neutron() && p2==G4Proton::Proton()) ||
63 (p2==G4Neutron::Neutron() && p1==G4Proton::Proton()) )
64 {
65 result = G4Neutron::Neutron();
66 }
67 else
68 {
69 throw G4HadronicException(__FILE__, __LINE__, "G4VCrossSectionSource: unklnown particles in FindKeyParticle");
70 }
71 return result;
72}
const G4ParticleDefinition * GetDefinition() const
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4Proton * Proton()
Definition: G4Proton.cc:92

References G4KineticTrack::GetDefinition(), G4Neutron::Neutron(), and G4Proton::Proton().

Referenced by CrossSection(), and G4XNNTotalLowE::CrossSection().

◆ FindLightParticle()

const G4ParticleDefinition * G4VCrossSectionSource::FindLightParticle ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
protectedinherited

Definition at line 158 of file G4VCrossSectionSource.cc.

160{
161 G4double mass1 = trk1.GetDefinition()->GetPDGMass();
162 G4double mass2 = trk2.GetDefinition()->GetPDGMass();
163 if (mass1 < mass2)
164 {
165 return trk1.GetDefinition();
166 }
167 else
168 {
169 return trk2.GetDefinition();
170 }
171}

References G4KineticTrack::GetDefinition(), and G4ParticleDefinition::GetPDGMass().

Referenced by G4XMesonBaryonElastic::CrossSection().

◆ GetComponents()

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

Implements G4VCrossSectionSource.

Definition at line 53 of file G4XNNElasticLowE.hh.

53{ return 0; }

◆ HighLimit()

virtual G4double G4XNNElasticLowE::HighLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 61 of file G4XNNElasticLowE.hh.

61{ return _highLimit; }

References _highLimit.

◆ InLimits()

G4bool G4VCrossSectionSource::InLimits ( G4double  e,
G4double  eLow,
G4double  eHigh 
) const
protectedinherited

◆ IsValid()

G4bool G4XNNElasticLowE::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 247 of file G4XNNElasticLowE.cc.

248{
250
251 return answer;
252}
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

References _highLimit, _lowLimit, and G4VCrossSectionSource::InLimits().

◆ LowLimit()

G4double G4VCrossSectionSource::LowLimit ( ) const
virtualinherited

Reimplemented in G4XPDGElastic, and G4XPDGTotal.

Definition at line 140 of file G4VCrossSectionSource.cc.

141{
142 return 0.;
143}

Referenced by G4CrossSectionPatch::CrossSection(), G4VCrossSectionSource::IsValid(), and G4CrossSectionPatch::Transition().

◆ Name()

G4String G4XNNElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 239 of file G4XNNElasticLowE.cc.

240{
241 G4String name("NNElasticLowE");
242 return name;
243}
const char * name(G4int ptype)

References G4InuclParticleNames::name().

Referenced by Print().

◆ operator!=() [1/2]

G4bool G4VCrossSectionSource::operator!= ( const G4VCrossSectionSource right) const
inherited

Definition at line 80 of file G4VCrossSectionSource.cc.

81{
82 return (this != (G4VCrossSectionSource *) &right);
83}

◆ operator!=() [2/2]

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

Definition at line 132 of file G4XNNElasticLowE.cc.

133{
134
135 return (this != (G4XNNElasticLowE *) &right);
136}

◆ operator=()

const G4XNNElasticLowE & G4XNNElasticLowE::operator= ( const G4XNNElasticLowE right)
private

◆ operator==() [1/2]

G4bool G4VCrossSectionSource::operator== ( const G4VCrossSectionSource right) const
inherited

Definition at line 74 of file G4VCrossSectionSource.cc.

75{
76 return (this == (G4VCrossSectionSource *) &right);
77}

◆ operator==() [2/2]

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

Definition at line 126 of file G4XNNElasticLowE.cc.

127{
128 return (this == (G4XNNElasticLowE *) &right);
129}

◆ Print()

void G4XNNElasticLowE::Print ( ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 176 of file G4XNNElasticLowE.cc.

177{
178 // Dump the pp cross-section table
179
180 G4cout << Name() << ", pp cross-section: " << G4endl;
181
182 G4bool dummy = false;
183 G4int i;
185 G4PhysicsVector* pp = 0;
186
187 typedef std::map <const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > StringPhysMap;
188 StringPhysMap::const_iterator iter;
189
190 for (iter = xMap.begin(); iter != xMap.end(); ++iter)
191 {
192 const G4ParticleDefinition * str = (*iter).first;
193 if (str == key)
194 {
195 pp = (*iter).second;
196 }
197 }
198
199 if (pp != 0)
200 {
201 for (i=0; i<tableSize; i++)
202 {
203 G4double e = pp->GetLowEdgeEnergy(i);
204 G4double sigma = pp->GetValue(e,dummy) / millibarn;
205 G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
206 }
207 }
208
209 // Dump the np cross-section table
210
211 G4cout << Name() << ", np cross-section: " << G4endl;
212
214 G4PhysicsVector* np = 0;
215 for (iter = xMap.begin(); iter != xMap.end(); ++iter)
216 {
217 const G4ParticleDefinition * str = (*iter).first;
218 if (str == key)
219 {
220 np = (*iter).second;
221 }
222 }
223
224 // G4PhysicsVector* np = xMap[G4Neutron::NeutronDefinition()->GetParticleName()];
225
226 if (np != 0)
227 {
228 for (i=0; i<tableSize; i++)
229 {
230 G4double e = np->GetLowEdgeEnergy(i);
231 G4double sigma = np->GetValue(e,dummy) / millibarn;
232 G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
233 }
234 }
236}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetLowEdgeEnergy(const std::size_t index) const
virtual void Print() const
virtual G4String Name() const

References G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), GeV, millibarn, Name(), G4Neutron::NeutronDefinition(), G4InuclParticleNames::pp, G4VCrossSectionSource::Print(), G4Proton::ProtonDefinition(), tableSize, and xMap.

◆ PrintAll()

void G4VCrossSectionSource::PrintAll ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtualinherited

Definition at line 107 of file G4VCrossSectionSource.cc.

108{
109 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
110 G4double sigma = CrossSection(trk1,trk2) / millibarn;
111 G4cout << "---- " << Name() << ": "
112 << "Ecm = " << sqrtS / GeV << " GeV - "
113 << " Cross section = " << sigma << " mb "
114 << G4endl;
115
116 G4int nComponents = 0;
117 const G4CrossSectionVector* components = GetComponents();
118 if (components != 0)
119 {
120 nComponents = components->size();
121 }
122 G4int i;
123 for (i=0; i<nComponents; i++)
124 {
125 G4cout << "* Component " << i << ": ";
126 G4CrossSectionSourcePtr componentPtr = (*components)[i];
127 G4VCrossSectionSource* component = componentPtr();
128 component->PrintAll(trk1,trk2);
129 }
130}
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
virtual const G4CrossSectionVector * GetComponents() const =0
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
virtual void PrintAll(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
virtual G4String Name() const =0

References G4VCrossSectionSource::CrossSection(), G4cout, G4endl, G4KineticTrack::Get4Momentum(), G4VCrossSectionSource::GetComponents(), GeV, millibarn, G4VCrossSectionSource::Name(), and G4VCrossSectionSource::PrintAll().

Referenced by G4VCrossSectionSource::PrintAll().

Field Documentation

◆ _eMax

G4double G4XNNElasticLowE::_eMax
private

Definition at line 83 of file G4XNNElasticLowE.hh.

Referenced by CrossSection(), and G4XNNElasticLowE().

◆ _eMin

G4double G4XNNElasticLowE::_eMin
private

Definition at line 82 of file G4XNNElasticLowE.hh.

Referenced by CrossSection(), and G4XNNElasticLowE().

◆ _eMinTable

const G4double G4XNNElasticLowE::_eMinTable = 1.8964808
staticprivate

Definition at line 77 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE().

◆ _eStepLog

const G4double G4XNNElasticLowE::_eStepLog = 0.01
staticprivate

Definition at line 78 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE().

◆ _highLimit

const G4double G4XNNElasticLowE::_highLimit = 3.*GeV
staticprivate

Definition at line 73 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE(), HighLimit(), and IsValid().

◆ _lowLimit

const G4double G4XNNElasticLowE::_lowLimit = 0.
staticprivate

Definition at line 72 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE(), and IsValid().

◆ npTable

const G4double G4XNNElasticLowE::npTable
staticprivate
Initial value:
=
{
1500.00,
248.20, 93.38, 55.26, 44.50, 41.33, 38.48, 37.20, 35.98,
35.02, 34.47, 32.48, 30.76, 29.46, 28.53, 27.84, 27.20,
26.53, 25.95, 25.59, 25.46, 25.00, 24.49, 24.08, 23.86,
23.17, 22.70, 21.88, 21.48, 20.22, 19.75, 18.97, 18.39,
17.98, 17.63, 17.21, 16.72, 16.68, 16.58, 16.42, 16.22,
15.98, 15.71, 15.42, 15.14, 14.87, 14.65, 14.44, 14.26,
14.10, 13.95, 13.80, 13.64, 13.47, 13.29, 13.09, 12.89,
12.68, 12.47, 12.27, 12.06, 11.84, 11.76, 11.69, 11.60,
11.50, 11.41, 11.29, 11.17, 11.06, 10.93, 10.81, 10.68,
10.56, 10.44, 10.33, 10.21, 10.12, 10.03, 9.96, 9.89,
9.83, 9.80, 9.77, 9.75, 9.74, 9.74, 9.74, 9.76,
9.73, 9.70, 9.68, 9.65, 9.63, 9.60, 9.57, 9.55,
9.52, 9.49, 9.46, 9.43
}

Definition at line 75 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE().

◆ ppTable

const G4double G4XNNElasticLowE::ppTable
staticprivate
Initial value:
=
{
60.00,
33.48, 26.76, 25.26, 24.55, 23.94, 23.77, 23.72, 23.98,
25.48, 27.52, 27.72, 27.21, 25.80, 26.00, 24.32, 23.81,
24.37, 24.36, 23.13, 22.43, 21.71, 21.01, 20.83, 20.74,
20.25, 20.10, 20.59, 20.04, 20.83, 20.84, 21.07, 20.83,
20.79, 21.88, 21.15, 20.92, 19.00, 18.60, 17.30, 17.00,
16.70, 16.50, 16.20, 15.80, 15.57, 15.20, 15.00, 14.60,
14.20, 14.00, 13.80, 13.60, 13.40, 13.20, 13.00, 12.85,
12.70, 12.60, 12.50, 12.40, 12.30, 12.20, 12.10, 12.00,
11.90, 11.80, 11.75, 11.70, 11.64, 11.53, 11.41, 11.31,
11.22, 11.13, 11.05, 10.97, 10.89, 10.82, 10.75, 10.68,
10.61, 10.54, 10.48, 10.41, 10.35, 10.28, 10.22, 10.16,
10.13, 10.10, 10.08, 10.05, 10.02, 9.99, 9.96, 9.93,
9.90, 9.87, 9.84, 9.80
}

Definition at line 74 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE().

◆ tableSize

const G4int G4XNNElasticLowE::tableSize = 101
staticprivate

Definition at line 76 of file G4XNNElasticLowE.hh.

Referenced by G4XNNElasticLowE(), and Print().

◆ xMap

std::map<const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > G4XNNElasticLowE::xMap
private

Definition at line 80 of file G4XNNElasticLowE.hh.

Referenced by CrossSection(), G4XNNElasticLowE(), Print(), and ~G4XNNElasticLowE().


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