Geant4  10.02.p03
G4VCrossSectionSource Class Referenceabstract

#include <G4VCrossSectionSource.hh>

Inheritance diagram for G4VCrossSectionSource:
Collaboration 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
 

Private Member Functions

 G4VCrossSectionSource (const G4VCrossSectionSource &right)
 
G4VCrossSectionSourceoperator= (const G4VCrossSectionSource &right)
 

Detailed Description

Definition at line 38 of file G4VCrossSectionSource.hh.

Constructor & Destructor Documentation

◆ G4VCrossSectionSource() [1/2]

G4VCrossSectionSource::G4VCrossSectionSource ( )

Definition at line 42 of file G4VCrossSectionSource.cc.

43 { }

◆ ~G4VCrossSectionSource()

G4VCrossSectionSource::~G4VCrossSectionSource ( )
virtual

Definition at line 46 of file G4VCrossSectionSource.cc.

47 { }
Here is the call graph for this function:

◆ G4VCrossSectionSource() [2/2]

G4VCrossSectionSource::G4VCrossSectionSource ( const G4VCrossSectionSource right)
private

Member Function Documentation

◆ CrossSection()

virtual G4double G4VCrossSectionSource::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
pure virtual

Implemented in G4XPDGElastic, G4XPDGTotal, G4CrossSectionComposite, G4XnpElasticLowE, G4XnpTotalLowE, G4CrossSectionPatch, G4XAnnihilationChannel, G4XAqmElastic, G4XMesonBaryonElastic, G4XResonance, G4XNNElasticLowE, G4XAqmTotal, G4XNNTotalLowE, G4XpimNTotal, and G4XpipNTotal.

Here is the caller graph for this function:

◆ FcrossX()

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

Definition at line 175 of file G4VCrossSectionSource.cc.

177 {
178  G4double result = 0.;
179 
180  G4double denom = eParam*eParam + (e-e0)*(e-e0);
181  if (denom > 0.)
182  {
183  G4double value = (2.* eParam * sigma * (e-e0) / denom) * G4Pow::GetInstance()->powA(((e0 + eParam) / e), power);
184  result = std::max(0., value);
185  }
186  return result;
187 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ FindKeyParticle()

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

Definition at line 51 of file G4VCrossSectionSource.cc.

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

◆ FindLightParticle()

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

Definition at line 159 of file G4VCrossSectionSource.cc.

161 {
162  G4double mass1 = trk1.GetDefinition()->GetPDGMass();
163  G4double mass2 = trk2.GetDefinition()->GetPDGMass();
164  if (mass1 < mass2)
165  {
166  return trk1.GetDefinition();
167  }
168  else
169  {
170  return trk2.GetDefinition();
171  }
172 }
const G4ParticleDefinition * GetDefinition() const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetComponents()

virtual const G4CrossSectionVector* G4VCrossSectionSource::GetComponents ( ) const
pure virtual

Implemented in G4XPDGElastic, G4XPDGTotal, G4CrossSectionComposite, G4XnpElasticLowE, G4XnpTotalLowE, G4CrossSectionPatch, G4XAnnihilationChannel, G4XAqmElastic, G4XMesonBaryonElastic, G4XNNElastic, G4XnpElastic, G4XnpTotal, G4XResonance, G4XNNElasticLowE, G4XAqmTotal, G4XNNTotalLowE, G4XNNTotal, G4XpimNTotal, and G4XpipNTotal.

Here is the caller graph for this function:

◆ HighLimit()

G4double G4VCrossSectionSource::HighLimit ( ) const
virtual

Reimplemented in G4XnpElasticLowE, G4XnpTotalLowE, G4XNNElasticLowE, and G4XNNTotalLowE.

Definition at line 147 of file G4VCrossSectionSource.cc.

148 {
149  return DBL_MAX;
150 }
#define DBL_MAX
Definition: templates.hh:83
Here is the caller graph for this function:

◆ InLimits()

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

Definition at line 134 of file G4VCrossSectionSource.cc.

135 {
136  G4bool answer = false;
137  if (e >= eLow && e <= eHigh) answer = true;
138  return answer;
139 }
bool G4bool
Definition: G4Types.hh:79
Here is the caller graph for this function:

◆ IsValid()

G4bool G4VCrossSectionSource::IsValid ( G4double  e) const
virtual

Reimplemented in G4XPDGElastic, G4XPDGTotal, G4CrossSectionComposite, G4XnpElasticLowE, G4XnpTotalLowE, G4CrossSectionPatch, G4XAnnihilationChannel, G4XAqmElastic, G4XMesonBaryonElastic, G4XNNElasticLowE, G4XAqmTotal, and G4XNNTotalLowE.

Definition at line 152 of file G4VCrossSectionSource.cc.

153 {
154  G4bool answer = false;
155  if (e >= LowLimit() && e <= HighLimit()) answer = true;
156  return answer;
157 }
virtual G4double LowLimit() const
bool G4bool
Definition: G4Types.hh:79
virtual G4double HighLimit() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LowLimit()

G4double G4VCrossSectionSource::LowLimit ( ) const
virtual

Reimplemented in G4XPDGElastic, and G4XPDGTotal.

Definition at line 141 of file G4VCrossSectionSource.cc.

142 {
143  return 0.;
144 }
Here is the caller graph for this function:

◆ Name()

virtual G4String G4VCrossSectionSource::Name ( ) const
pure virtual

Implemented in G4XnpElasticLowE, G4XnpTotalLowE, G4XPDGElastic, G4XPDGTotal, G4XAnnihilationChannel, G4XAqmElastic, G4XMesonBaryonElastic, G4XNNElastic, G4XnpElastic, G4XnpTotal, G4XResonance, G4XNNElasticLowE, G4XAqmTotal, G4XNNTotalLowE, G4XNNTotal, G4XpimNTotal, and G4XpipNTotal.

Here is the caller graph for this function:

◆ operator!=()

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

Definition at line 81 of file G4VCrossSectionSource.cc.

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

◆ operator=()

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

◆ operator==()

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

Definition at line 75 of file G4VCrossSectionSource.cc.

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

◆ Print()

void G4VCrossSectionSource::Print ( void  ) const
virtual

Reimplemented in G4XnpElasticLowE, G4XnpTotalLowE, and G4XNNElasticLowE.

Definition at line 87 of file G4VCrossSectionSource.cc.

88 {
89  G4int nComponents = 0;
90  const G4CrossSectionVector* components = GetComponents();
91  if (components)
92  {
93  nComponents = components->size();
94  }
95  G4cout << "---- " << this->Name() << " ---- has " << nComponents << " components" <<G4endl;
96  G4int i;
97  for (i=0; i<nComponents; i++)
98  {
99  G4cout << "-" << this->Name() << " - Component " << i << ": " <<G4endl;
100 
101  G4CrossSectionSourcePtr componentPtr = (*components)[i];
102  G4VCrossSectionSource* component = componentPtr();
103  component->Print();
104  }
105 }
virtual void Print() const
virtual G4String Name() const =0
G4int nComponents
Definition: TRTMaterials.hh:41
int G4int
Definition: G4Types.hh:78
virtual const G4CrossSectionVector * GetComponents() const =0
G4GLOB_DLL std::ostream G4cout
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAll()

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

Definition at line 108 of file G4VCrossSectionSource.cc.

109 {
110  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
111  G4double sigma = CrossSection(trk1,trk2) / millibarn;
112  G4cout << "---- " << Name() << ": "
113  << "Ecm = " << sqrtS / GeV << " GeV - "
114  << " Cross section = " << sigma << " mb "
115  << G4endl;
116 
117  G4int nComponents = 0;
118  const G4CrossSectionVector* components = GetComponents();
119  if (components != 0)
120  {
121  nComponents = components->size();
122  }
123  G4int i;
124  for (i=0; i<nComponents; i++)
125  {
126  G4cout << "* Component " << i << ": ";
127  G4CrossSectionSourcePtr componentPtr = (*components)[i];
128  G4VCrossSectionSource* component = componentPtr();
129  component->PrintAll(trk1,trk2);
130  }
131 }
virtual G4String Name() const =0
G4int nComponents
Definition: TRTMaterials.hh:41
int G4int
Definition: G4Types.hh:78
virtual const G4CrossSectionVector * GetComponents() const =0
G4GLOB_DLL std::ostream G4cout
static const double GeV
Definition: G4SIunits.hh:214
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
virtual void PrintAll(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
static const double millibarn
Definition: G4SIunits.hh:105
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
const G4LorentzVector & Get4Momentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

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