Geant4 10.7.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=nullptr)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
bool ForAllAtomsAndEnergies () const
 
void SetForAllAtomsAndEnergies (G4bool val)
 
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::G4PiNuclearCrossSection ( )

Definition at line 386 of file G4PiNuclearCrossSection.cc.

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

◆ ~G4PiNuclearCrossSection()

G4PiNuclearCrossSection::~G4PiNuclearCrossSection ( )
virtual

Definition at line 444 of file G4PiNuclearCrossSection.cc.

446{
447 for(auto xsec : thePimData) { delete xsec; }
448 for(auto xsec : thePipData) { delete xsec; }
449}

Member Function Documentation

◆ BuildPhysicsTable()

void G4PiNuclearCrossSection::BuildPhysicsTable ( const G4ParticleDefinition p)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 469 of file G4PiNuclearCrossSection.cc.

470{
471 if(&p != G4PionMinus::PionMinus() && &p != G4PionPlus::PionPlus()) {
473 ed << "This cross section is applicable only to pions and not to "
474 << p.GetParticleName() << G4endl;
475 G4Exception("G4PiNuclearCrossSection::BuildPhysicsTable", "had001",
476 FatalException, ed);
477 }
478}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57
const G4String & GetParticleName() const
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97

◆ CrossSectionDescription()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 452 of file G4PiNuclearCrossSection.cc.

453{
454 outFile << "G4PiNuclearCrossSection calculates the pion inelastic cross\n"
455 << "section for all nuclei heavier than hydrogen. It uses the\n"
456 << "Barashenkov cross sections and is valid for all incident\n"
457 << "energies.\n";
458}

◆ Default_Name()

static const char * G4PiNuclearCrossSection::Default_Name ( )
inlinestatic

Definition at line 44 of file G4PiNuclearCrossSection.hh.

44{return "G4PiNuclearCrossSection";}

◆ GetElasticXsc()

G4double G4PiNuclearCrossSection::GetElasticXsc ( )
inline

Definition at line 60 of file G4PiNuclearCrossSection.hh.

60{return fElasticXsc;};

◆ GetElementCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 481 of file G4PiNuclearCrossSection.cc.

483{
484 G4double charge = particle->GetDefinition()->GetPDGCharge();
485 G4double kineticEnergy = particle->GetKineticEnergy();
486
487 // body
488
489 G4double result = 0;
490 // debug.push_back(Z);
491 size_t it = 0;
492
493 while(it < theZ.size() && Z > theZ[it]) it++; /* Loop checking, 08.01.2016, W. Pokorski */
494
495 // debug.push_back(theZ[it]);
496 // debug.push_back(kineticEnergy);
497
498 if( it == theZ.size() )
499 {
500 //AR-24Apr2018 Switch to treat transuranic elements as uranium
501 const G4bool isHeavyElementAllowed = true;
502 if ( isHeavyElementAllowed ) {
503 it--;
504 G4int zz = (Z > 100) ? 100 : Z; // Above Fermium, treat it as Fermium
505 // The cross section for a transuranic element is scaled from the
506 // corresponding cross section of Uranium, as follows:
507 // (atomic_weight_element/atomic_weight_uranium)^0.75
508 // Notes:
509 // - The exponent "0.75" is used to be consistent with the method
510 // G4PiNuclearCrossSection::Interpolate (otherwise I would use 2/3);
511 // - We use for Uranium 238.02891 and for the transuranic elements
512 // the values showed below in the comment.
513 const std::vector<G4double> vecScaling{ 0.996756, // <A>=237.0 for Np (Z=93)
514 1.018756, // <A>=244.0 for Pu (Z=94)
515 1.015623, // <A>=243.0 for Am (Z=95)
516 1.028136, // <A>=247.0 for Cm (Z=96)
517 1.028136, // <A>=247.0 for Bk (Z=97)
518 1.040598, // <A>=251.0 for Cf (Z=98)
519 1.043706, // <A>=252.0 for Es (Z=99)
520 1.059199 }; // <A>=257.0 for Fm (Z=100)
521 result = vecScaling[zz-93] * thePimData[it]->ReactionXSection( kineticEnergy );
522 fTotalXsc = vecScaling[zz-93] * thePimData[it]->TotalXSection( kineticEnergy );
523 fElasticXsc = std::max(fTotalXsc - result, 0.0);
524 return result;
525 } else {
527 ed << "This cross section not applicable to Z= " << Z << " projectile: "
528 << particle->GetParticleDefinition()->GetParticleName() << G4endl;
529 G4Exception("G4PiNuclearCrossSection::GetElementCrossSection", "had001",
530 FatalException, ed);
531 }
532 }
533 G4int Z1, Z2;
534 G4double x1, x2, xt1, xt2;
535 if( charge < 0 )
536 {
537 if( theZ[it] == Z )
538 {
539 result = thePimData[it]->ReactionXSection(kineticEnergy);
540 fTotalXsc = thePimData[it]->TotalXSection(kineticEnergy);
541
542 // debug.push_back("D1 ");
543 // debug.push_back(result);
544 // debug.push_back(fTotalXsc);
545 }
546 else
547 {
548 x1 = thePimData[it-1]->ReactionXSection(kineticEnergy);
549 xt1 = thePimData[it-1]->TotalXSection(kineticEnergy);
550 Z1 = theZ[it-1];
551 x2 = thePimData[it]->ReactionXSection(kineticEnergy);
552 xt2 = thePimData[it]->TotalXSection(kineticEnergy);
553 Z2 = theZ[it];
554
555 result = Interpolate(Z1, Z2, Z, x1, x2);
556 fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
557
558 // debug.push_back("D2 ");
559 // debug.push_back(x1);
560 // debug.push_back(x2);
561 // debug.push_back(xt1);
562 // debug.push_back(xt2);
563 // debug.push_back(Z1);
564 // debug.push_back(Z2);
565 // debug.push_back(result);
566 // debug.push_back(fTotalXsc);
567 }
568 }
569 else
570 {
571 if(theZ[it]==Z)
572 {
573 // at high energies, when no data for pi+, use pi-
574 std::vector<G4PiData *> * theData = &thePimData;
575 if(thePipData[it]->AppliesTo(kineticEnergy))
576 {
577 theData = &thePipData;
578 }
579 result = theData->operator[](it)->ReactionXSection(kineticEnergy);
580 fTotalXsc = theData->operator[](it)->TotalXSection(kineticEnergy);
581
582 // debug.push_back("D3 ");
583 // debug.push_back(result);
584 // debug.push_back(fTotalXsc);
585 }
586 else
587 {
588 std::vector<G4PiData *> * theLData = &thePimData;
589 if(thePipData[it-1]->AppliesTo(kineticEnergy))
590 {
591 theLData = &thePipData;
592 }
593 std::vector<G4PiData *> * theHData = &thePimData;
594 if(thePipData[it]->AppliesTo(kineticEnergy))
595 {
596 theHData = &thePipData;
597 }
598 x1 = theLData->operator[](it-1)->ReactionXSection(kineticEnergy);
599 xt1 = theLData->operator[](it-1)->TotalXSection(kineticEnergy);
600 Z1 = theZ[it-1];
601 x2 = theHData->operator[](it)->ReactionXSection(kineticEnergy);
602 xt2 = theHData->operator[](it)->TotalXSection(kineticEnergy);
603 Z2 = theZ[it];
604
605 result = Interpolate(Z1, Z2, Z, x1, x2);
606 fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
607
608 // debug.push_back("D4 ");
609 // debug.push_back(x1);
610 // debug.push_back(xt1);
611 // debug.push_back(x2);
612 // debug.push_back(xt2);
613 // debug.push_back(Z1);
614 // debug.push_back(Z2);
615 // debug.push_back(result);
616 // debug.push_back(fTotalXsc);
617 }
618 }
619 // debug.dump();
620
621 fElasticXsc = fTotalXsc - result;
622 if( fElasticXsc < 0.) fElasticXsc = 0.;
623
624 return result;
625}
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
const G4ParticleDefinition * GetParticleDefinition() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetPDGCharge() const

◆ GetTotalXsc()

G4double G4PiNuclearCrossSection::GetTotalXsc ( )
inline

Definition at line 59 of file G4PiNuclearCrossSection.hh.

59{return fTotalXsc;};

◆ IsElementApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 462 of file G4PiNuclearCrossSection.cc.

464{
465 return (1 < Z);
466}

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