Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PiNuclearCrossSection Class Reference

#include <G4PiNuclearCrossSection.hh>

Inheritance diagram for G4PiNuclearCrossSection:
Collaboration diagram for G4PiNuclearCrossSection:

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 ()
 
- 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 G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Static Public Member Functions

static const char * Default_Name ()
 

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 37 of file G4PiNuclearCrossSection.hh.

Constructor & Destructor Documentation

G4PiNuclearCrossSection::G4PiNuclearCrossSection ( )

Definition at line 388 of file G4PiNuclearCrossSection.cc.

390  fTotalXsc(0.0), fElasticXsc(0.0)
391 {
392  SetMinKinEnergy(0.0);
393  SetMaxKinEnergy(99.9*TeV);
394 
395  thePimData.push_back(new G4PiData(he_t, he_in, e1, 38));
396  thePipData.push_back(new G4PiData(he_t, he_in, e1, 38));
397  thePimData.push_back(new G4PiData(be_m_t, be_m_in, e1, 38));
398  thePipData.push_back(new G4PiData(be_p_t, be_p_in, e1, 24));
399  thePimData.push_back(new G4PiData(c_m_t, c_m_in, e2, 39));
400  thePipData.push_back(new G4PiData(c_p_t, c_p_in, e2, 24));
401  thePimData.push_back(new G4PiData(n_m_t, n_m_in, e2, 39));
402  thePipData.push_back(new G4PiData(n_p_t, n_p_in, e2, 27));
403  thePimData.push_back(new G4PiData(o_m_t, o_m_in, e3, 31));
404  thePipData.push_back(new G4PiData(o_p_t, o_p_in, e3, 20));
405  thePimData.push_back(new G4PiData(na_m_t, na_m_in, e3, 31));
406  thePipData.push_back(new G4PiData(na_p_t, na_p_in, e3, 22));
407  thePimData.push_back(new G4PiData(al_m_t, al_m_in, e3_1, 31));
408  thePipData.push_back(new G4PiData(al_p_t, al_p_in, e3_1, 21));
409  thePimData.push_back(new G4PiData(ca_m_t, ca_m_in, e3_1, 31));
410  thePipData.push_back(new G4PiData(ca_p_t, ca_p_in, e3_1, 23));
411  thePimData.push_back(new G4PiData(fe_m_t, fe_m_in, e4, 32));
412  thePipData.push_back(new G4PiData(fe_p_t, fe_p_in, e4, 25));
413  thePimData.push_back(new G4PiData(cu_m_t, cu_m_in, e4, 32));
414  thePipData.push_back(new G4PiData(cu_p_t, cu_p_in, e4, 25));
415  thePimData.push_back(new G4PiData(mo_m_t, mo_m_in, e5, 34));
416  thePipData.push_back(new G4PiData(mo_p_t, mo_p_in, e5, 27));
417  thePimData.push_back(new G4PiData(cd_m_t, cd_m_in, e5, 34));
418  thePipData.push_back(new G4PiData(cd_p_t, cd_p_in, e5, 28));
419  thePimData.push_back(new G4PiData(sn_m_t, sn_m_in, e6, 35));
420  thePipData.push_back(new G4PiData(sn_p_t, sn_p_in, e6, 29));
421  thePimData.push_back(new G4PiData(w_m_t, w_m_in, e6, 35));
422  thePipData.push_back(new G4PiData(w_p_t, w_p_in, e6, 30));
423  thePimData.push_back(new G4PiData(pb_m_t, pb_m_in, e7, 35));
424  thePipData.push_back(new G4PiData(pb_p_t, pb_p_in, e7, 30));
425  thePimData.push_back(new G4PiData(u_m_t, u_m_in, e7, 35));
426  thePipData.push_back(new G4PiData(u_p_t, u_p_in, e7, 30));
427 
428  theZ.push_back(2); // He
429  theZ.push_back(4); // Be
430  theZ.push_back(6); // C
431  theZ.push_back(7); // N
432  theZ.push_back(8); // O
433  theZ.push_back(11); // Na
434  theZ.push_back(13); // Al
435  theZ.push_back(20); // Ca
436  theZ.push_back(26); // Fe
437  theZ.push_back(29); // Cu
438  theZ.push_back(42); // Mo
439  theZ.push_back(48); // Cd
440  theZ.push_back(50); // Sn
441  theZ.push_back(74); // W
442  theZ.push_back(82); // Pb
443  theZ.push_back(92); // U
444 }
G4VCrossSectionDataSet(const G4String &nam="")
static const char * Default_Name()
static constexpr double TeV
Definition: G4SIunits.hh:218
void SetMinKinEnergy(G4double value)
void SetMaxKinEnergy(G4double value)

Here is the call graph for this function:

G4PiNuclearCrossSection::~G4PiNuclearCrossSection ( )
virtual

Definition at line 447 of file G4PiNuclearCrossSection.cc.

448 {
449  std::for_each(thePimData.begin(), thePimData.end(), G4PiData::Delete());
450  std::for_each(thePipData.begin(), thePipData.end(), G4PiData::Delete());
451 }

Member Function Documentation

void G4PiNuclearCrossSection::BuildPhysicsTable ( const G4ParticleDefinition p)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 471 of file G4PiNuclearCrossSection.cc.

472 {
473  if(&p == G4PionMinus::PionMinus() || &p == G4PionPlus::PionPlus()) { return; }
474  throw G4HadronicException(__FILE__, __LINE__,"Is applicable only for pions");
475 }
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98

Here is the call graph for this function:

void G4PiNuclearCrossSection::CrossSectionDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 454 of file G4PiNuclearCrossSection.cc.

455 {
456  outFile << "G4PiNuclearCrossSection calculates the pion inelastic cross\n"
457  << "section for all nuclei heavier than hydrogen. It uses the\n"
458  << "Barashenkov cross sections and is valid for all incident\n"
459  << "energies.\n";
460 }
static const char* G4PiNuclearCrossSection::Default_Name ( )
inlinestatic

Definition at line 44 of file G4PiNuclearCrossSection.hh.

44 {return "G4PiNuclearCrossSection";}

Here is the caller graph for this function:

G4double G4PiNuclearCrossSection::GetElasticXsc ( )
inline

Definition at line 60 of file G4PiNuclearCrossSection.hh.

60 {return fElasticXsc;};
G4double G4PiNuclearCrossSection::GetElementCrossSection ( const G4DynamicParticle particle,
G4int  Z,
const G4Material  
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 478 of file G4PiNuclearCrossSection.cc.

480 {
481  G4double charge = particle->GetDefinition()->GetPDGCharge();
482  G4double kineticEnergy = particle->GetKineticEnergy();
483 
484  // body
485 
486  G4double result = 0;
487  // debug.push_back(Z);
488  size_t it = 0;
489 
490  while(it < theZ.size() && Z > theZ[it]) it++; /* Loop checking, 08.01.2016, W. Pokorski */
491 
492  // debug.push_back(theZ[it]);
493  // debug.push_back(kineticEnergy);
494 
495  if(Z > theZ[it])
496  {
497  throw G4HadronicException(__FILE__, __LINE__,
498  "Called G4PiNuclearCrossSection outside parametrization");
499  }
500  G4int Z1, Z2;
501  G4double x1, x2, xt1, xt2;
502  if( charge < 0 )
503  {
504  if( theZ[it] == Z )
505  {
506  result = thePimData[it]->ReactionXSection(kineticEnergy);
507  fTotalXsc = thePimData[it]->TotalXSection(kineticEnergy);
508 
509  // debug.push_back("D1 ");
510  // debug.push_back(result);
511  // debug.push_back(fTotalXsc);
512  }
513  else
514  {
515  x1 = thePimData[it-1]->ReactionXSection(kineticEnergy);
516  xt1 = thePimData[it-1]->TotalXSection(kineticEnergy);
517  Z1 = theZ[it-1];
518  x2 = thePimData[it]->ReactionXSection(kineticEnergy);
519  xt2 = thePimData[it]->TotalXSection(kineticEnergy);
520  Z2 = theZ[it];
521 
522  result = Interpolate(Z1, Z2, Z, x1, x2);
523  fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
524 
525  // debug.push_back("D2 ");
526  // debug.push_back(x1);
527  // debug.push_back(x2);
528  // debug.push_back(xt1);
529  // debug.push_back(xt2);
530  // debug.push_back(Z1);
531  // debug.push_back(Z2);
532  // debug.push_back(result);
533  // debug.push_back(fTotalXsc);
534  }
535  }
536  else
537  {
538  if(theZ[it]==Z)
539  {
540  // at high energies, when no data for pi+, use pi-
541  std::vector<G4PiData *> * theData = &thePimData;
542  if(thePipData[it]->AppliesTo(kineticEnergy))
543  {
544  theData = &thePipData;
545  }
546  result = theData->operator[](it)->ReactionXSection(kineticEnergy);
547  fTotalXsc = theData->operator[](it)->TotalXSection(kineticEnergy);
548 
549  // debug.push_back("D3 ");
550  // debug.push_back(result);
551  // debug.push_back(fTotalXsc);
552  }
553  else
554  {
555  std::vector<G4PiData *> * theLData = &thePimData;
556  if(thePipData[it-1]->AppliesTo(kineticEnergy))
557  {
558  theLData = &thePipData;
559  }
560  std::vector<G4PiData *> * theHData = &thePimData;
561  if(thePipData[it]->AppliesTo(kineticEnergy))
562  {
563  theHData = &thePipData;
564  }
565  x1 = theLData->operator[](it-1)->ReactionXSection(kineticEnergy);
566  xt1 = theLData->operator[](it-1)->TotalXSection(kineticEnergy);
567  Z1 = theZ[it-1];
568  x2 = theHData->operator[](it)->ReactionXSection(kineticEnergy);
569  xt2 = theHData->operator[](it)->TotalXSection(kineticEnergy);
570  Z2 = theZ[it];
571 
572  result = Interpolate(Z1, Z2, Z, x1, x2);
573  fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
574 
575  // debug.push_back("D4 ");
576  // debug.push_back(x1);
577  // debug.push_back(xt1);
578  // debug.push_back(x2);
579  // debug.push_back(xt2);
580  // debug.push_back(Z1);
581  // debug.push_back(Z2);
582  // debug.push_back(result);
583  // debug.push_back(fTotalXsc);
584  }
585  }
586  // debug.dump();
587 
588  fElasticXsc = fTotalXsc - result;
589  if( fElasticXsc < 0.) fElasticXsc = 0.;
590 
591  return result;
592 }
G4double G4ParticleHPJENDLHEData::G4double result
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

G4double G4PiNuclearCrossSection::GetTotalXsc ( )
inline

Definition at line 59 of file G4PiNuclearCrossSection.hh.

59 {return fTotalXsc;};
G4bool G4PiNuclearCrossSection::IsElementApplicable ( const G4DynamicParticle aParticle,
G4int  Z,
const G4Material  
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 464 of file G4PiNuclearCrossSection.cc.

466 {
467  return (1 < Z);
468 }

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