#include <G4XnpTotalLowE.hh>
Inheritance diagram for G4XnpTotalLowE:
Public Member Functions | |
G4XnpTotalLowE () | |
virtual | ~G4XnpTotalLowE () |
G4bool | operator== (const G4XnpTotalLowE &right) const |
G4bool | operator!= (const G4XnpTotalLowE &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 G4XnpTotalLowE.hh.
G4XnpTotalLowE::G4XnpTotalLowE | ( | ) |
Definition at line 87 of file G4XnpTotalLowE.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 // @@GF this ought to be _lowLimit < _eMin 00097 if (_eMin < _lowLimit) 00098 throw G4HadronicException(__FILE__, __LINE__, "G4XnpTotalLowE::G4XnpTotalLowE - Low energy limit not valid"); 00099 00100 if (_highLimit > _eMax) 00101 throw G4HadronicException(__FILE__, __LINE__, "G4XnpTotalLowE::G4XnpTotalLowE - 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 }
G4XnpTotalLowE::~G4XnpTotalLowE | ( | ) | [virtual] |
G4double G4XnpTotalLowE::CrossSection | ( | const G4KineticTrack & | trk1, | |
const G4KineticTrack & | trk2 | |||
) | const [virtual] |
Implements G4VCrossSectionSource.
Definition at line 131 of file G4XnpTotalLowE.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* G4XnpTotalLowE::GetComponents | ( | ) | const [inline, virtual] |
virtual G4double G4XnpTotalLowE::HighLimit | ( | ) | const [inline, virtual] |
Reimplemented from G4VCrossSectionSource.
Definition at line 183 of file G4XnpTotalLowE.cc.
References G4VCrossSectionSource::InLimits().
G4String G4XnpTotalLowE::Name | ( | ) | const [virtual] |
Implements G4VCrossSectionSource.
Definition at line 176 of file G4XnpTotalLowE.cc.
Referenced by Print().
00177 { 00178 G4String name("NNTotalLowE"); 00179 return name; 00180 }
G4bool G4XnpTotalLowE::operator!= | ( | const G4XnpTotalLowE & | right | ) | const |
Definition at line 125 of file G4XnpTotalLowE.cc.
00126 { 00127 return (this != (G4XnpTotalLowE *) &right); 00128 }
G4bool G4XnpTotalLowE::operator== | ( | const G4XnpTotalLowE & | right | ) | const |
Definition at line 119 of file G4XnpTotalLowE.cc.
00120 { 00121 return (this == (G4XnpTotalLowE *) &right); 00122 }
void G4XnpTotalLowE::Print | ( | ) | const [virtual] |
Reimplemented from G4VCrossSectionSource.
Definition at line 157 of file G4XnpTotalLowE.cc.
References G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), Name(), and G4VCrossSectionSource::Print().
00158 { 00159 // Dump the cross-section table 00160 00161 G4cout << Name() << "Cross-section table: " << G4endl; 00162 G4bool dummy = false; 00163 G4int i; 00164 00165 for (i=0; i<_tableSize; i++) 00166 { 00167 G4double e = _sigma->GetLowEdgeEnergy(i) / GeV; 00168 G4double sigma = _sigma->GetValue(e,dummy) / millibarn; 00169 G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl; 00170 } 00171 00172 G4VCrossSectionSource::Print(); 00173 }