Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4GeneralSpaceNNCrossSection Class Reference

#include <G4GeneralSpaceNNCrossSection.hh>

Inheritance diagram for G4GeneralSpaceNNCrossSection:
G4VCrossSectionDataSet

Public Member Functions

 G4GeneralSpaceNNCrossSection ()
 
 ~G4GeneralSpaceNNCrossSection ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *theProjectile, G4int Z, const G4Material *)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *theProjectile, G4int Z, const G4Material *)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4Isotope * SelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4String & GetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 87 of file G4GeneralSpaceNNCrossSection.hh.

Constructor & Destructor Documentation

G4GeneralSpaceNNCrossSection::G4GeneralSpaceNNCrossSection ( )

Definition at line 78 of file G4GeneralSpaceNNCrossSection.cc.

References G4Proton::Proton().

79  : G4VCrossSectionDataSet("General Space NN")
80 {
81  protonInelastic = new G4ProtonInelasticCrossSection();
82  ionProton = new G4IonProtonCrossSection();
83  TripathiGeneral = new G4TripathiCrossSection();
84  TripathiLight = new G4TripathiLightCrossSection();
85  Shen = new G4IonsShenCrossSection();
86  theProton = G4Proton::Proton();
87 }
G4VCrossSectionDataSet(const G4String &nam="")
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4GeneralSpaceNNCrossSection::~G4GeneralSpaceNNCrossSection ( )

Definition at line 89 of file G4GeneralSpaceNNCrossSection.cc.

90 {
91  delete protonInelastic;
92  delete ionProton;
93  delete TripathiGeneral;
94  delete TripathiLight;
95  delete Shen;
96 }

Member Function Documentation

G4double G4GeneralSpaceNNCrossSection::GetElementCrossSection ( const G4DynamicParticle *  theProjectile,
G4int  Z,
const G4Material *  mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 111 of file G4GeneralSpaceNNCrossSection.cc.

References python.hepunit::eplus, G4cout, G4endl, G4lrint(), G4ParticleDefinition::GetBaryonNumber(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4ParticleDefinition::GetPDGCharge(), and python.hepunit::millibarn.

112 {
113  G4double result = 0.0;
114  G4int ZP = G4lrint(theProjectile->GetDefinition()->GetPDGCharge()/eplus);
115 
116  if (verboseLevel >= 2)
117  {
118  G4int AP = theProjectile->GetDefinition()->GetBaryonNumber();
119  G4cout <<"In G4GeneralSpaceNNCrossSection::GetCrossSection" <<G4endl;
120  G4cout <<"Projectile A = " <<std::setw(8) <<AP
121  <<" Z = " <<std::setw(8) <<ZP
122  <<" Energy = " <<theProjectile->GetKineticEnergy()/AP
123  <<" MeV/nuc" <<G4endl;
124  G4cout <<"Target Z = " <<std::setw(8) <<ZT
125  <<G4endl;
126  }
127  if (theProjectile->GetDefinition()==theProton)
128  {
129  if (ZT>5)
130  {
131  result = protonInelastic->
132  GetElementCrossSection(theProjectile, ZT, mat);
133  if (verboseLevel >= 2)
134  G4cout <<"Selecting G4ProtonInelasticCrossSection" <<G4endl;
135  }
136  else
137  {
138  result = TripathiLight->
139  GetElementCrossSection(theProjectile, ZT, mat);
140  if (verboseLevel >= 2)
141  G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
142  }
143  }
144  else if (ZT==1)
145  {
146  if (ZP>5)
147  {
148  result = ionProton->
149  GetElementCrossSection(theProjectile, ZT, mat);
150  if (verboseLevel >= 2)
151  G4cout <<"Selecting G4IonProtonCrossSection" <<G4endl;
152  }
153  else
154  {
155  result = TripathiLight->
156  GetElementCrossSection(theProjectile, ZT, mat);
157  if (verboseLevel >= 2)
158  G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
159  }
160  }
161  else
162  {
163  if (TripathiLight->IsElementApplicable(theProjectile, ZT, mat))
164  {
165  result = TripathiLight->
166  GetElementCrossSection(theProjectile, ZT, mat);
167  if (verboseLevel >= 2)
168  G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
169  }
170  else if (TripathiGeneral->IsElementApplicable(theProjectile, ZT, mat))
171  {
172  result = TripathiGeneral->
173  GetElementCrossSection(theProjectile, ZT, mat);
174  if (verboseLevel >= 2)
175  G4cout <<"Selecting G4TripathiCrossSection" <<G4endl;
176  }
177  else if (Shen->IsElementApplicable(theProjectile, ZT, mat))
178  {
179  result = Shen->
180  GetElementCrossSection(theProjectile, ZT, mat);
181  if (verboseLevel >= 2)
182  G4cout <<"Selecting G4IonsShenCrossSection" <<G4endl;
183  }
184  }
185  if (verboseLevel >= 2)
186  {
187  G4cout <<"Cross-section = " <<result/millibarn <<" mbarn" <<G4endl;
188  G4cout <<G4endl;
189  }
190 
191  return result;
192 }
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
int millibarn
Definition: hepunit.py:40
G4GLOB_DLL std::ostream G4cout
virtual G4bool IsElementApplicable(const G4DynamicParticle *theProjectile, G4int Z, const G4Material *)
virtual G4double GetElementCrossSection(const G4DynamicParticle *theProjectile, G4int Z, const G4Material *)
int G4lrint(double ad)
Definition: templates.hh:163
virtual G4bool IsElementApplicable(const G4DynamicParticle *aDP, G4int Z, const G4Material *)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
virtual G4bool IsElementApplicable(const G4DynamicParticle *aPart, G4int Z, const G4Material *)
G4bool G4GeneralSpaceNNCrossSection::IsElementApplicable ( const G4DynamicParticle *  theProjectile,
G4int  Z,
const G4Material *   
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 102 of file G4GeneralSpaceNNCrossSection.cc.

References G4ParticleDefinition::GetBaryonNumber(), and G4DynamicParticle::GetDefinition().

103 {
104  return (1 <= theProjectile->GetDefinition()->GetBaryonNumber());
105 }
G4ParticleDefinition * GetDefinition() const

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