G4XNNElasticLowE Class Reference

#include <G4XNNElasticLowE.hh>

Inheritance diagram for G4XNNElasticLowE:

G4VCrossSectionSource

Public Member Functions

 G4XNNElasticLowE ()
virtual ~G4XNNElasticLowE ()
G4bool operator== (const G4XNNElasticLowE &right) const
G4bool operator!= (const G4XNNElasticLowE &right) const
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
virtual const G4CrossSectionVectorGetComponents () const
virtual G4bool IsValid (G4double e) const
virtual G4String Name () const
virtual void Print () const
virtual G4double HighLimit () const

Detailed Description

Definition at line 39 of file G4XNNElasticLowE.hh.


Constructor & Destructor Documentation

G4XNNElasticLowE::G4XNNElasticLowE (  ) 

Definition at line 88 of file G4XNNElasticLowE.cc.

References G4Neutron::NeutronDefinition(), G4InuclParticleNames::pp, G4Proton::ProtonDefinition(), and G4PhysicsVector::PutValue().

00089 { 
00090   // Cross-sections are available in the range (_eMin,_eMax)
00091 
00092   _eMin = _eMinTable * GeV;
00093   _eMax = std::exp(std::log(_eMinTable) + tableSize * _eStepLog) * GeV;
00094   if (_eMin < _lowLimit)
00095     throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");    
00096   if (_highLimit > _eMax)
00097     throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - High energy limit not valid");    
00098   G4PhysicsVector* pp = new G4PhysicsLnVector(_eMin,_eMax,tableSize);
00099 
00100   _eMin = std::exp(std::log(_eMinTable)-_eStepLog)*GeV;
00101   if (_eMin < _lowLimit)
00102     throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
00103   G4PhysicsVector* np = new G4PhysicsLnVector(_eMin,_eMax,tableSize);
00104 
00105   G4int i;
00106   for (i=0; i<tableSize; i++)
00107     {
00108       G4double value = ppTable[i] * millibarn;
00109       pp->PutValue(i,value);
00110       value = npTable[i] * millibarn;
00111       np->PutValue(i,value);
00112     }
00113   xMap[G4Proton::ProtonDefinition()] = pp;
00114   xMap[G4Neutron::NeutronDefinition()] = np;
00115 }

G4XNNElasticLowE::~G4XNNElasticLowE (  )  [virtual]

Definition at line 118 of file G4XNNElasticLowE.cc.

References G4Neutron::NeutronDefinition(), and G4Proton::ProtonDefinition().

00119 {
00120   delete xMap[G4Proton::ProtonDefinition()];
00121   delete xMap[G4Neutron::NeutronDefinition()];
00122 }


Member Function Documentation

G4double G4XNNElasticLowE::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const [virtual]

Implements G4VCrossSectionSource.

Definition at line 138 of file G4XNNElasticLowE.cc.

References G4VCrossSectionSource::FindKeyParticle(), G4KineticTrack::Get4Momentum(), and G4PhysicsVector::GetValue().

00139 {
00140   G4double sigma = 0.;
00141   G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
00142   G4bool dummy = false;
00143 
00144   G4ParticleDefinition * key = FindKeyParticle(trk1,trk2);
00145 
00146   typedef std::map <G4ParticleDefinition *, G4PhysicsVector*, std::less<G4ParticleDefinition *> > StringPhysMap;
00147 
00148   if (xMap.find(key)!= xMap.end())
00149     {
00150 
00151       StringPhysMap::const_iterator iter;
00152       for (iter = xMap.begin(); iter != xMap.end(); ++iter)
00153         {
00154           G4ParticleDefinition * str = (*iter).first;
00155           if (str == key)
00156             {
00157               G4PhysicsVector* physVector = (*iter).second; 
00158               //     G4PhysicsVector* physVector = xMap[key];
00159               if (sqrtS >= _eMin && sqrtS <= _eMax)
00160                 {
00161                   sigma = physVector->GetValue(sqrtS,dummy);
00162                 } else if ( sqrtS < _eMin )
00163                 {
00164                   sigma = physVector->GetValue(_eMin,dummy);
00165                 }
00166                 //G4cout << " sqrtS / sigma " << sqrtS/GeV << " / " <<
00167                 //          sigma/millibarn << G4endl;
00168             }
00169         }
00170     }
00171   return sigma;
00172 }

virtual const G4CrossSectionVector* G4XNNElasticLowE::GetComponents (  )  const [inline, virtual]

Implements G4VCrossSectionSource.

Definition at line 53 of file G4XNNElasticLowE.hh.

00053 { return 0; }

virtual G4double G4XNNElasticLowE::HighLimit (  )  const [inline, virtual]

Reimplemented from G4VCrossSectionSource.

Definition at line 61 of file G4XNNElasticLowE.hh.

00061 { return _highLimit; }

G4bool G4XNNElasticLowE::IsValid ( G4double  e  )  const [virtual]

Reimplemented from G4VCrossSectionSource.

Definition at line 246 of file G4XNNElasticLowE.cc.

References G4VCrossSectionSource::InLimits().

00247 {
00248   G4bool answer = InLimits(e,_lowLimit,_highLimit);
00249 
00250   return answer;
00251 }

G4String G4XNNElasticLowE::Name (  )  const [virtual]

Implements G4VCrossSectionSource.

Definition at line 238 of file G4XNNElasticLowE.cc.

Referenced by Print().

00239 {
00240   G4String name("NNElasticLowE");
00241   return name;
00242 }

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

Definition at line 131 of file G4XNNElasticLowE.cc.

00132 {
00133 
00134   return (this != (G4XNNElasticLowE *) &right);
00135 }

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

Definition at line 125 of file G4XNNElasticLowE.cc.

00126 {
00127   return (this == (G4XNNElasticLowE *) &right);
00128 }

void G4XNNElasticLowE::Print (  )  const [virtual]

Reimplemented from G4VCrossSectionSource.

Definition at line 175 of file G4XNNElasticLowE.cc.

References G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), Name(), G4Neutron::NeutronDefinition(), G4InuclParticleNames::pp, G4VCrossSectionSource::Print(), and G4Proton::ProtonDefinition().

00176 {
00177   // Dump the pp cross-section table
00178 
00179   G4cout << Name() << ", pp cross-section: " << G4endl;
00180 
00181   G4bool dummy = false;
00182   G4int i;
00183   G4ParticleDefinition * key = G4Proton::ProtonDefinition();
00184   G4PhysicsVector* pp = 0;
00185 
00186   typedef std::map <G4ParticleDefinition *, G4PhysicsVector*, std::less<G4ParticleDefinition *> > StringPhysMap;
00187   StringPhysMap::const_iterator iter;
00188 
00189   for (iter = xMap.begin(); iter != xMap.end(); ++iter)
00190     {
00191       G4ParticleDefinition * str = (*iter).first;
00192       if (str == key)
00193         {
00194           pp = (*iter).second; 
00195         }
00196     }
00197   
00198   if (pp != 0)
00199     {   
00200       for (i=0; i<tableSize; i++)
00201         {
00202           G4double e = pp->GetLowEdgeEnergy(i);
00203           G4double sigma = pp->GetValue(e,dummy) / millibarn;
00204           G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
00205         }
00206     }
00207   
00208   // Dump the np cross-section table
00209 
00210   G4cout << Name() << ", np cross-section: " << G4endl;
00211 
00212   key = G4Neutron::NeutronDefinition();
00213   G4PhysicsVector* np = 0;
00214   for (iter = xMap.begin(); iter != xMap.end(); ++iter)
00215     {
00216       G4ParticleDefinition * str = (*iter).first;
00217       if (str == key)
00218         {
00219           np = (*iter).second; 
00220         }
00221     }
00222   
00223   //  G4PhysicsVector* np = xMap[G4Neutron::NeutronDefinition()->GetParticleName()];
00224   
00225   if (np != 0)
00226     {   
00227       for (i=0; i<tableSize; i++)
00228         {
00229           G4double e = np->GetLowEdgeEnergy(i);
00230           G4double sigma = np->GetValue(e,dummy) / millibarn;
00231           G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
00232         }
00233     }
00234   G4VCrossSectionSource::Print();
00235 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:54:00 2013 for Geant4 by  doxygen 1.4.7