#include <G4XnpElasticLowE.hh>
Inheritance diagram for G4XnpElasticLowE:
Public Member Functions | |
G4XnpElasticLowE () | |
virtual | ~G4XnpElasticLowE () |
G4bool | operator== (const G4XnpElasticLowE &right) const |
G4bool | operator!= (const G4XnpElasticLowE &right) const |
virtual G4double | CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const |
virtual const G4CrossSectionVector * | GetComponents () const |
virtual G4bool | IsValid (G4double e) const |
virtual void | Print () const |
virtual G4String | Name () const |
virtual G4double | HighLimit () const |
Definition at line 51 of file G4XnpElasticLowE.hh.
G4XnpElasticLowE::G4XnpElasticLowE | ( | ) |
Definition at line 87 of file G4XnpElasticLowE.cc.
References G4PhysicsVector::PutValue().
00088 { 00089 // Cross-sections are available in the range (_eMin,_eMax) 00090 00091 _eMin = _eMinTable * GeV; 00092 _eMin = std::exp(std::log(_eMinTable)-_eStepLog)*GeV; 00093 _eMax = std::exp(std::log(_eMinTable) + _tableSize * _eStepLog) * GeV; 00094 00095 // Protections: validity limits must be compatible with available data 00096 00097 if (_eMin < _lowLimit) 00098 throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - Low energy limit not valid"); 00099 00100 if (_highLimit > _eMax) 00101 throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - High energy limit not valid"); 00102 00103 _sigma = new G4PhysicsLnVector(_eMin,_eMax,_tableSize); 00104 G4int i; 00105 for (i=0; i<_tableSize; i++) 00106 { 00107 G4double value = _sigmaTable[i] * millibarn; 00108 _sigma->PutValue(i,value); 00109 } 00110 }
G4XnpElasticLowE::~G4XnpElasticLowE | ( | ) | [virtual] |
G4double G4XnpElasticLowE::CrossSection | ( | const G4KineticTrack & | trk1, | |
const G4KineticTrack & | trk2 | |||
) | const [virtual] |
Implements G4VCrossSectionSource.
Definition at line 131 of file G4XnpElasticLowE.cc.
References G4KineticTrack::Get4Momentum(), G4KineticTrack::GetDefinition(), G4PhysicsVector::GetValue(), neutron, G4Neutron::NeutronDefinition(), G4InuclParticleNames::proton, and G4Proton::ProtonDefinition().
00132 { 00133 G4double sigma = 0.; 00134 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag(); 00135 G4bool dummy = false; 00136 00137 G4ParticleDefinition* proton = G4Proton::ProtonDefinition(); 00138 G4ParticleDefinition* neutron = G4Neutron::NeutronDefinition(); 00139 00140 G4ParticleDefinition* def1 = trk1.GetDefinition(); 00141 G4ParticleDefinition* def2 = trk2.GetDefinition(); 00142 if ( (def1 == proton && def2 == neutron) || 00143 (def1 == neutron && def2 == proton) ) 00144 { 00145 if (sqrtS >= _eMin && sqrtS <= _eMax) 00146 { 00147 sigma = _sigma->GetValue(sqrtS,dummy); 00148 } else if ( sqrtS < _eMin ) 00149 { 00150 sigma = _sigma->GetValue(_eMin,dummy); 00151 } 00152 } 00153 00154 return sigma; 00155 }
virtual const G4CrossSectionVector* G4XnpElasticLowE::GetComponents | ( | ) | const [inline, virtual] |
virtual G4double G4XnpElasticLowE::HighLimit | ( | ) | const [inline, virtual] |
Reimplemented from G4VCrossSectionSource.
Definition at line 182 of file G4XnpElasticLowE.cc.
References G4VCrossSectionSource::InLimits().
G4String G4XnpElasticLowE::Name | ( | ) | const [virtual] |
Implements G4VCrossSectionSource.
Definition at line 175 of file G4XnpElasticLowE.cc.
Referenced by Print().
00176 { 00177 G4String name("npElasticLowE"); 00178 return name; 00179 }
G4bool G4XnpElasticLowE::operator!= | ( | const G4XnpElasticLowE & | right | ) | const |
Definition at line 125 of file G4XnpElasticLowE.cc.
00126 { 00127 return (this != (G4XnpElasticLowE *) &right); 00128 }
G4bool G4XnpElasticLowE::operator== | ( | const G4XnpElasticLowE & | right | ) | const |
Definition at line 119 of file G4XnpElasticLowE.cc.
00120 { 00121 return (this == (G4XnpElasticLowE *) &right); 00122 }
void G4XnpElasticLowE::Print | ( | ) | const [virtual] |
Reimplemented from G4VCrossSectionSource.
Definition at line 157 of file G4XnpElasticLowE.cc.
References G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), Name(), and G4VCrossSectionSource::Print().
00158 { 00159 // Dump the cross-section table 00160 G4cout << Name() << "Cross-section table: " << G4endl; 00161 G4bool dummy = false; 00162 G4int i; 00163 00164 for (i=0; i<_tableSize; i++) 00165 { 00166 G4double e = _sigma->GetLowEdgeEnergy(i) / GeV; 00167 G4double sigma = _sigma->GetValue(e,dummy) / millibarn; 00168 G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl; 00169 } 00170 00171 G4VCrossSectionSource::Print(); 00172 }