Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PiNuclearCrossSection Class Reference

#include <G4PiNuclearCrossSection.hh>

+ Inheritance 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 IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
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 GetElementCrossSection (const G4DynamicParticle *, G4int Z, 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 BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

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::G4PiNuclearCrossSection ( )

Definition at line 381 of file G4PiNuclearCrossSection.cc.

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

◆ ~G4PiNuclearCrossSection()

G4PiNuclearCrossSection::~G4PiNuclearCrossSection ( )
virtual

Definition at line 439 of file G4PiNuclearCrossSection.cc.

441{
442 std::for_each(thePimData.begin(), thePimData.end(), G4PiData::Delete());
443 std::for_each(thePipData.begin(), thePipData.end(), G4PiData::Delete());
444}

Member Function Documentation

◆ BuildPhysicsTable()

void G4PiNuclearCrossSection::BuildPhysicsTable ( const G4ParticleDefinition p)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 464 of file G4PiNuclearCrossSection.cc.

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

◆ CrossSectionDescription()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 447 of file G4PiNuclearCrossSection.cc.

448{
449 outFile << "G4PiNuclearCrossSection calculates the pion inelastic cross\n"
450 << "section for all nuclei heavier than hydrogen. It uses the\n"
451 << "Barashenkov cross sections and is valid for all incident\n"
452 << "energies.\n";
453}

◆ GetElasticXsc()

G4double G4PiNuclearCrossSection::GetElasticXsc ( )
inline

Definition at line 58 of file G4PiNuclearCrossSection.hh.

58{return fElasticXsc;};

◆ GetElementCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 471 of file G4PiNuclearCrossSection.cc.

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

◆ GetTotalXsc()

G4double G4PiNuclearCrossSection::GetTotalXsc ( )
inline

Definition at line 57 of file G4PiNuclearCrossSection.hh.

57{return fTotalXsc;};

◆ IsElementApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 457 of file G4PiNuclearCrossSection.cc.

459{
460 return (1 < Z);
461}

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