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

#include <G4NeutronHPCapture.hh>

+ Inheritance diagram for G4NeutronHPCapture:

Public Member Functions

 G4NeutronHPCapture ()
 
 ~G4NeutronHPCapture ()
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &, G4Nucleus &)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
const G4HadronicInteractionGetMyPointer () const
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
G4bool operator== (const G4HadronicInteraction &right) const
 
G4bool operator!= (const G4HadronicInteraction &right) const
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 48 of file G4NeutronHPCapture.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPCapture()

G4NeutronHPCapture::G4NeutronHPCapture ( )

Definition at line 41 of file G4NeutronHPCapture.cc.

42 :G4HadronicInteraction("NeutronHPCapture")
43 {
44 SetMinEnergy( 0.0 );
45 SetMaxEnergy( 20.*MeV );
46// G4cout << "Capture : start of construction!!!!!!!!"<<G4endl;
47 if(!getenv("G4NEUTRONHPDATA"))
48 throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
49 dirName = getenv("G4NEUTRONHPDATA");
50 G4String tString = "/Capture";
51 dirName = dirName + tString;
53// G4cout << "+++++++++++++++++++++++++++++++++++++++++++++++++"<<G4endl;
54// G4cout <<"Disname="<<dirName<<" numEle="<<numEle<<G4endl;
55 //theCapture = new G4NeutronHPChannel[numEle];
56// G4cout <<"G4NeutronHPChannel constructed"<<G4endl;
58 //for (G4int i=0; i<numEle; i++)
59 //{
60// // G4cout << "initializing theCapture "<<i<<" "<< numEle<<G4endl;
61 // theCapture[i].Init((*(G4Element::GetElementTable()))[i], dirName);
62 // theCapture[i].Register(theFS);
63 //}
64 for ( G4int i = 0 ; i < numEle ; i++ )
65 {
66 theCapture.push_back( new G4NeutronHPChannel );
67 (*theCapture[i]).Init((*(G4Element::GetElementTable()))[i], dirName);
68 (*theCapture[i]).Register(theFS);
69 }
70 delete theFS;
71// G4cout << "-------------------------------------------------"<<G4endl;
72// G4cout << "Leaving G4NeutronHPCapture::G4NeutronHPCapture"<<G4endl;
73 }
int G4int
Definition: G4Types.hh:66
static size_t GetNumberOfElements()
Definition: G4Element.cc:406
static const G4ElementTable * GetElementTable()
Definition: G4Element.cc:399
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)

◆ ~G4NeutronHPCapture()

G4NeutronHPCapture::~G4NeutronHPCapture ( )

Definition at line 75 of file G4NeutronHPCapture.cc.

76 {
77 //delete [] theCapture;
78// G4cout << "Leaving G4NeutronHPCapture::~G4NeutronHPCapture"<<G4endl;
79 for ( std::vector<G4NeutronHPChannel*>::iterator
80 ite = theCapture.begin() ; ite != theCapture.end() ; ite++ )
81 {
82 delete *ite;
83 }
84 theCapture.clear();
85 }

Member Function Documentation

◆ ApplyYourself()

G4HadFinalState * G4NeutronHPCapture::ApplyYourself ( const G4HadProjectile aTrack,
G4Nucleus aTargetNucleus 
)
virtual

Implements G4HadronicInteraction.

Definition at line 88 of file G4NeutronHPCapture.cc.

89 {
90
91 if ( numEle < (G4int)G4Element::GetNumberOfElements() ) addChannelForNewElement();
92
94 if(getenv("NeutronHPCapture")) G4cout <<" ####### G4NeutronHPCapture called"<<G4endl;
95 const G4Material * theMaterial = aTrack.GetMaterial();
96 G4int n = theMaterial->GetNumberOfElements();
97 G4int index = theMaterial->GetElement(0)->GetIndex();
98 if(n!=1)
99 {
100 xSec = new G4double[n];
101 G4double sum=0;
102 G4int i;
103 const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
104 G4double rWeight;
105 G4NeutronHPThermalBoost aThermalE;
106 for (i=0; i<n; i++)
107 {
108 index = theMaterial->GetElement(i)->GetIndex();
109 rWeight = NumAtomsPerVolume[i];
110 //xSec[i] = theCapture[index].GetXsec(aThermalE.GetThermalEnergy(aTrack,
111 xSec[i] = (*theCapture[index]).GetXsec(aThermalE.GetThermalEnergy(aTrack,
112 theMaterial->GetElement(i),
113 theMaterial->GetTemperature()));
114 xSec[i] *= rWeight;
115 sum+=xSec[i];
116 }
117 G4double random = G4UniformRand();
118 G4double running = 0;
119 for (i=0; i<n; i++)
120 {
121 running += xSec[i];
122 index = theMaterial->GetElement(i)->GetIndex();
123 //if(random<=running/sum) break;
124 if( sum == 0 || random <= running/sum ) break;
125 }
126 if(i==n) i=std::max(0, n-1);
127 delete [] xSec;
128 }
129
130 //return theCapture[index].ApplyYourself(aTrack);
131 //G4HadFinalState* result = theCapture[index].ApplyYourself(aTrack);
132 G4HadFinalState* result = (*theCapture[index]).ApplyYourself(aTrack);
135 return result;
136 }
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
size_t GetIndex() const
Definition: G4Element.hh:182
const G4Material * GetMaterial() const
G4double GetTemperature() const
Definition: G4Material.hh:181
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:201
size_t GetNumberOfElements() const
Definition: G4Material.hh:185
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:205
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
static G4NeutronHPManager * GetInstance()
G4NeutronHPReactionWhiteBoard * GetReactionWhiteBoard()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)

Referenced by ApplyYourself().

◆ GetFatalEnergyCheckLevels()

const std::pair< G4double, G4double > G4NeutronHPCapture::GetFatalEnergyCheckLevels ( ) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 138 of file G4NeutronHPCapture.cc.

139{
140 //return std::pair<G4double, G4double>(10*perCent,10*GeV);
141 return std::pair<G4double, G4double>(10*perCent,DBL_MAX);
142}
#define DBL_MAX
Definition: templates.hh:83

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