G4PiNuclearCrossSection Class Reference

#include <G4PiNuclearCrossSection.hh>

Inheritance diagram for G4PiNuclearCrossSection:

G4VCrossSectionDataSet

Public Member Functions

 G4PiNuclearCrossSection ()
virtual ~G4PiNuclearCrossSection ()
virtual G4bool IsElementApplicable (const G4DynamicParticle *aParticle, G4int Z, const G4Material *)
virtual G4double GetElementCrossSection (const G4DynamicParticle *particle, G4int Z, const G4Material *)
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
virtual void CrossSectionDescription (std::ostream &) const
G4double GetTotalXsc ()
G4double GetElasticXsc ()

Detailed Description

Definition at line 37 of file G4PiNuclearCrossSection.hh.


Constructor & Destructor Documentation

G4PiNuclearCrossSection::G4PiNuclearCrossSection (  ) 

Definition at line 381 of file G4PiNuclearCrossSection.cc.

References G4VCrossSectionDataSet::SetMaxKinEnergy(), and G4VCrossSectionDataSet::SetMinKinEnergy().

00382  : G4VCrossSectionDataSet("G4PiNuclearCrossSection"),
00383    fTotalXsc(0.0), fElasticXsc(0.0)
00384 {
00385   SetMinKinEnergy(0.0);
00386   SetMaxKinEnergy(99.9*TeV);
00387    
00388   thePimData.push_back(new G4PiData(he_t,   he_in,  e1, 38));
00389   thePipData.push_back(new G4PiData(he_t,   he_in,  e1, 38));
00390   thePimData.push_back(new G4PiData(be_m_t, be_m_in, e1, 38));
00391   thePipData.push_back(new G4PiData(be_p_t, be_p_in, e1, 24));
00392   thePimData.push_back(new G4PiData(c_m_t,  c_m_in,  e2, 39));
00393   thePipData.push_back(new G4PiData(c_p_t,  c_p_in,  e2, 24));
00394   thePimData.push_back(new G4PiData(n_m_t,  n_m_in,  e2, 39));
00395   thePipData.push_back(new G4PiData(n_p_t,  n_p_in,  e2, 27));
00396   thePimData.push_back(new G4PiData(o_m_t,  o_m_in,  e3, 31));
00397   thePipData.push_back(new G4PiData(o_p_t,  o_p_in,  e3, 20));
00398   thePimData.push_back(new G4PiData(na_m_t, na_m_in, e3, 31));
00399   thePipData.push_back(new G4PiData(na_p_t, na_p_in, e3, 22));
00400   thePimData.push_back(new G4PiData(al_m_t, al_m_in, e3_1, 31));
00401   thePipData.push_back(new G4PiData(al_p_t, al_p_in, e3_1, 21));
00402   thePimData.push_back(new G4PiData(ca_m_t, ca_m_in, e3_1, 31));
00403   thePipData.push_back(new G4PiData(ca_p_t, ca_p_in, e3_1, 23));
00404   thePimData.push_back(new G4PiData(fe_m_t, fe_m_in, e4, 32));
00405   thePipData.push_back(new G4PiData(fe_p_t, fe_p_in, e4, 25));
00406   thePimData.push_back(new G4PiData(cu_m_t, cu_m_in, e4, 32));
00407   thePipData.push_back(new G4PiData(cu_p_t, cu_p_in, e4, 25));
00408   thePimData.push_back(new G4PiData(mo_m_t, mo_m_in, e5, 34));
00409   thePipData.push_back(new G4PiData(mo_p_t, mo_p_in, e5, 27));
00410   thePimData.push_back(new G4PiData(cd_m_t, cd_m_in, e5, 34));
00411   thePipData.push_back(new G4PiData(cd_p_t, cd_p_in, e5, 28));
00412   thePimData.push_back(new G4PiData(sn_m_t, sn_m_in, e6, 35));
00413   thePipData.push_back(new G4PiData(sn_p_t, sn_p_in, e6, 29));
00414   thePimData.push_back(new G4PiData(w_m_t,  w_m_in,  e6, 35));
00415   thePipData.push_back(new G4PiData(w_p_t,  w_p_in,  e6, 30));
00416   thePimData.push_back(new G4PiData(pb_m_t, pb_m_in, e7, 35));
00417   thePipData.push_back(new G4PiData(pb_p_t, pb_p_in, e7, 30));
00418   thePimData.push_back(new G4PiData(u_m_t,  u_m_in,  e7, 35));
00419   thePipData.push_back(new G4PiData(u_p_t,  u_p_in,  e7, 30));
00420 
00421   theZ.push_back(2); // He
00422   theZ.push_back(4); // Be
00423   theZ.push_back(6); // C
00424   theZ.push_back(7); // N
00425   theZ.push_back(8); // O
00426   theZ.push_back(11); // Na
00427   theZ.push_back(13); // Al
00428   theZ.push_back(20); // Ca
00429   theZ.push_back(26); // Fe
00430   theZ.push_back(29); // Cu
00431   theZ.push_back(42); // Mo
00432   theZ.push_back(48); // Cd
00433   theZ.push_back(50); // Sn
00434   theZ.push_back(74); // W
00435   theZ.push_back(82); // Pb
00436   theZ.push_back(92); // U
00437 }

G4PiNuclearCrossSection::~G4PiNuclearCrossSection (  )  [virtual]

Definition at line 440 of file G4PiNuclearCrossSection.cc.

00441 {
00442   std::for_each(thePimData.begin(), thePimData.end(), G4PiData::Delete());
00443   std::for_each(thePipData.begin(), thePipData.end(), G4PiData::Delete());
00444 }


Member Function Documentation

void G4PiNuclearCrossSection::BuildPhysicsTable ( const G4ParticleDefinition  )  [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 464 of file G4PiNuclearCrossSection.cc.

References G4PionMinus::PionMinus(), and G4PionPlus::PionPlus().

00465 {
00466   if(&p == G4PionMinus::PionMinus() || &p == G4PionPlus::PionPlus()) { return; }
00467   throw G4HadronicException(__FILE__, __LINE__,"Is applicable only for pions");
00468 }

void G4PiNuclearCrossSection::CrossSectionDescription ( std::ostream &   )  const [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 447 of file G4PiNuclearCrossSection.cc.

00448 {
00449   outFile << "G4PiNuclearCrossSection calculates the pion inelastic cross\n"
00450           << "section for all nuclei heavier than hydrogen.  It uses the\n"
00451           << "Barashenkov cross sections and is valid for all incident\n"
00452           << "energies.\n"; 
00453 }

G4double G4PiNuclearCrossSection::GetElasticXsc (  )  [inline]

Definition at line 58 of file G4PiNuclearCrossSection.hh.

00058 {return fElasticXsc;};

G4double G4PiNuclearCrossSection::GetElementCrossSection ( const G4DynamicParticle particle,
G4int  Z,
const G4Material  
) [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 471 of file G4PiNuclearCrossSection.cc.

References G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), and G4ParticleDefinition::GetPDGCharge().

00473 {
00474   G4double charge = particle->GetDefinition()->GetPDGCharge();
00475   G4double kineticEnergy = particle->GetKineticEnergy();
00476 
00477   // body
00478 
00479   G4double result = 0;
00480   //  debug.push_back(Z);
00481   size_t it = 0;
00482 
00483   while(it < theZ.size() && Z > theZ[it]) it++;
00484 
00485   //  debug.push_back(theZ[it]);
00486   //  debug.push_back(kineticEnergy);
00487 
00488   if(Z > theZ[it]) 
00489   {
00490     throw G4HadronicException(__FILE__, __LINE__,
00491       "Called G4PiNuclearCrossSection outside parametrization");
00492   }
00493   G4int Z1, Z2;
00494   G4double x1, x2, xt1, xt2;
00495   if( charge < 0 )
00496   {
00497     if( theZ[it] == Z )
00498     {
00499       result = thePimData[it]->ReactionXSection(kineticEnergy);
00500       fTotalXsc = thePimData[it]->TotalXSection(kineticEnergy);
00501 
00502       //      debug.push_back("D1 ");
00503       //      debug.push_back(result);
00504       //      debug.push_back(fTotalXsc);
00505     }
00506     else
00507     {
00508       x1 = thePimData[it-1]->ReactionXSection(kineticEnergy);
00509       xt1 = thePimData[it-1]->TotalXSection(kineticEnergy);
00510       Z1 = theZ[it-1];
00511       x2 = thePimData[it]->ReactionXSection(kineticEnergy);
00512       xt2 = thePimData[it]->TotalXSection(kineticEnergy);
00513       Z2 = theZ[it];
00514 
00515       result = Interpolate(Z1, Z2, Z, x1, x2);
00516       fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
00517 
00518       //      debug.push_back("D2 ");
00519       //      debug.push_back(x1);
00520       //      debug.push_back(x2);
00521       //      debug.push_back(xt1);
00522       //      debug.push_back(xt2);
00523       //      debug.push_back(Z1);
00524       //      debug.push_back(Z2);
00525       //      debug.push_back(result);
00526       //      debug.push_back(fTotalXsc);
00527     }
00528   }
00529   else
00530   {
00531     if(theZ[it]==Z)
00532     {
00533       // at high energies, when no data for pi+, use pi- 
00534       std::vector<G4PiData *> * theData = &thePimData;
00535       if(thePipData[it]->AppliesTo(kineticEnergy))
00536       {
00537         theData = &thePipData;
00538       }
00539       result = theData->operator[](it)->ReactionXSection(kineticEnergy);
00540       fTotalXsc = theData->operator[](it)->TotalXSection(kineticEnergy);
00541 
00542       //      debug.push_back("D3 ");
00543       //      debug.push_back(result);
00544       //      debug.push_back(fTotalXsc);
00545     }
00546     else
00547     {
00548       std::vector<G4PiData *> * theLData = &thePimData;
00549       if(thePipData[it-1]->AppliesTo(kineticEnergy))
00550       {
00551         theLData = &thePipData;
00552       }
00553       std::vector<G4PiData *> * theHData = &thePimData;
00554       if(thePipData[it]->AppliesTo(kineticEnergy))
00555       {
00556         theHData = &thePipData;
00557       }
00558       x1 = theLData->operator[](it-1)->ReactionXSection(kineticEnergy);
00559       xt1 = theLData->operator[](it-1)->TotalXSection(kineticEnergy);
00560       Z1 = theZ[it-1];
00561       x2 = theHData->operator[](it)->ReactionXSection(kineticEnergy);
00562       xt2 = theHData->operator[](it)->TotalXSection(kineticEnergy);
00563       Z2 = theZ[it];
00564 
00565       result = Interpolate(Z1, Z2, Z, x1, x2);
00566       fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
00567 
00568       //      debug.push_back("D4 ");
00569       //      debug.push_back(x1);
00570       //      debug.push_back(xt1);
00571       //      debug.push_back(x2);
00572       //      debug.push_back(xt2);
00573       //      debug.push_back(Z1);
00574       //      debug.push_back(Z2);
00575       //      debug.push_back(result);
00576       //      debug.push_back(fTotalXsc);
00577     }
00578   }
00579   //  debug.dump();
00580 
00581   fElasticXsc = fTotalXsc - result;
00582   if( fElasticXsc < 0.) fElasticXsc = 0.;
00583 
00584   return result;
00585 }

G4double G4PiNuclearCrossSection::GetTotalXsc (  )  [inline]

Definition at line 57 of file G4PiNuclearCrossSection.hh.

00057 {return fTotalXsc;};

G4bool G4PiNuclearCrossSection::IsElementApplicable ( const G4DynamicParticle aParticle,
G4int  Z,
const G4Material  
) [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 457 of file G4PiNuclearCrossSection.cc.

00459 {
00460   return (1 < Z);
00461 }


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