Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VCrossSectionSource Class Referenceabstract

#include <G4VCrossSectionSource.hh>

+ Inheritance diagram for G4VCrossSectionSource:

Public Member Functions

 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
 

Protected Member Functions

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 38 of file G4VCrossSectionSource.hh.

Constructor & Destructor Documentation

◆ G4VCrossSectionSource()

G4VCrossSectionSource::G4VCrossSectionSource ( )

Definition at line 41 of file G4VCrossSectionSource.cc.

42{ }

◆ ~G4VCrossSectionSource()

G4VCrossSectionSource::~G4VCrossSectionSource ( )
virtual

Definition at line 45 of file G4VCrossSectionSource.cc.

46{ }

Member Function Documentation

◆ CrossSection()

◆ FcrossX()

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

Definition at line 172 of file G4VCrossSectionSource.cc.

174{
175 G4double result = 0.;
176
177 G4double denom = eParam*eParam + (e-e0)*(e-e0);
178 if (denom > 0.)
179 {
180 G4double value = (2.* eParam * sigma * (e-e0) / denom) * G4Pow::GetInstance()->powA(((e0 + eParam) / e), power);
181 result = std::max(0., value);
182 }
183 return result;
184}
double G4double
Definition G4Types.hh:83
static G4Pow * GetInstance()
Definition G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition G4Pow.hh:230

◆ FindKeyParticle()

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

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:101
static G4Proton * Proton()
Definition G4Proton.cc:90

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

◆ FindLightParticle()

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

Definition at line 156 of file G4VCrossSectionSource.cc.

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

Referenced by G4XMesonBaryonElastic::CrossSection().

◆ GetComponents()

◆ HighLimit()

G4double G4VCrossSectionSource::HighLimit ( ) const
virtual

Reimplemented in G4XNNElasticLowE, G4XNNTotalLowE, G4XnpElasticLowE, and G4XnpTotalLowE.

Definition at line 144 of file G4VCrossSectionSource.cc.

145{
146 return DBL_MAX;
147}
#define DBL_MAX
Definition templates.hh:62

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

◆ InLimits()

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

◆ IsValid()

◆ LowLimit()

G4double G4VCrossSectionSource::LowLimit ( ) const
virtual

Reimplemented in G4XPDGElastic, and G4XPDGTotal.

Definition at line 138 of file G4VCrossSectionSource.cc.

139{
140 return 0.;
141}

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

◆ Name()

◆ operator!=()

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

Definition at line 80 of file G4VCrossSectionSource.cc.

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

◆ operator==()

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

Definition at line 74 of file G4VCrossSectionSource.cc.

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

◆ Print()

void G4VCrossSectionSource::Print ( ) const
virtual

Reimplemented in G4XNNElasticLowE, G4XnpElasticLowE, and G4XnpTotalLowE.

Definition at line 86 of file G4VCrossSectionSource.cc.

87{
88 std::size_t nComponents = 0;
89 const G4CrossSectionVector* components = GetComponents();
90 if (components)
91 {
92 nComponents = components->size();
93 }
94 G4cout << "---- " << this->Name() << " ---- has " << nComponents << " components" <<G4endl;
95 for (std::size_t i=0; i<nComponents; ++i)
96 {
97 G4cout << "-" << this->Name() << " - Component " << i << ": " <<G4endl;
98
99 G4CrossSectionSourcePtr componentPtr = (*components)[i];
100 G4VCrossSectionSource* component = componentPtr();
101 component->Print();
102 }
103}
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
virtual const G4CrossSectionVector * GetComponents() const =0
virtual void Print() const
virtual G4String Name() const =0

Referenced by G4VCollision::Print(), G4VCollision::Print(), Print(), G4XNNElasticLowE::Print(), G4XnpElasticLowE::Print(), and G4XnpTotalLowE::Print().

◆ PrintAll()

void G4VCrossSectionSource::PrintAll ( const G4KineticTrack & trk1,
const G4KineticTrack & trk2 ) const
virtual

Definition at line 106 of file G4VCrossSectionSource.cc.

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

Referenced by PrintAll().


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