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

#include <G4NeutronHPElastic.hh>

+ Inheritance diagram for G4NeutronHPElastic:

Public Member Functions

 G4NeutronHPElastic ()
 
 ~G4NeutronHPElastic ()
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
G4int GetNiso ()
 
void DoNotSuspend ()
 
- 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 G4NeutronHPElastic.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPElastic()

G4NeutronHPElastic::G4NeutronHPElastic ( )

Definition at line 38 of file G4NeutronHPElastic.cc.

39 :G4HadronicInteraction("NeutronHPElastic")
40 {
41 overrideSuspension = false;
43 if(!getenv("G4NEUTRONHPDATA"))
44 throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
45 dirName = getenv("G4NEUTRONHPDATA");
46 G4String tString = "/Elastic";
47 dirName = dirName + tString;
48// G4cout <<"G4NeutronHPElastic::G4NeutronHPElastic testit "<<dirName<<G4endl;
50 //theElastic = new G4NeutronHPChannel[numEle];
51 //for (G4int i=0; i<numEle; i++)
52 //{
53 // theElastic[i].Init((*(G4Element::GetElementTable()))[i], dirName);
54 // while(!theElastic[i].Register(theFS)) ;
55 //}
56 for ( G4int i = 0 ; i < numEle ; i++ )
57 {
58 theElastic.push_back( new G4NeutronHPChannel );
59 (*theElastic[i]).Init((*(G4Element::GetElementTable()))[i], dirName);
60 while(!(*theElastic[i]).Register(theFS)) ;
61 }
62 delete theFS;
63 SetMinEnergy(0.*eV);
64 SetMaxEnergy(20.*MeV);
65 }
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)

◆ ~G4NeutronHPElastic()

G4NeutronHPElastic::~G4NeutronHPElastic ( )

Definition at line 67 of file G4NeutronHPElastic.cc.

68 {
69 //delete [] theElastic;
70 for ( std::vector<G4NeutronHPChannel*>::iterator
71 it = theElastic.begin() ; it != theElastic.end() ; it++ )
72 {
73 delete *it;
74 }
75 theElastic.clear();
76 }

Member Function Documentation

◆ ApplyYourself()

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

Implements G4HadronicInteraction.

Definition at line 80 of file G4NeutronHPElastic.cc.

81 {
82
83 if ( numEle < (G4int)G4Element::GetNumberOfElements() ) addChannelForNewElement();
84
86 const G4Material * theMaterial = aTrack.GetMaterial();
87 G4int n = theMaterial->GetNumberOfElements();
88 G4int index = theMaterial->GetElement(0)->GetIndex();
89 if(n!=1)
90 {
91 G4int i;
92 xSec = new G4double[n];
93 G4double sum=0;
94 const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
95 G4double rWeight;
97 for (i=0; i<n; i++)
98 {
99 index = theMaterial->GetElement(i)->GetIndex();
100 rWeight = NumAtomsPerVolume[i];
101 //xSec[i] = theElastic[index].GetXsec(aThermalE.GetThermalEnergy(aTrack,
102 xSec[i] = (*theElastic[index]).GetXsec(aThermalE.GetThermalEnergy(aTrack,
103 theMaterial->GetElement(i),
104 theMaterial->GetTemperature()));
105 xSec[i] *= rWeight;
106 sum+=xSec[i];
107 }
108 G4double random = G4UniformRand();
109 G4double running = 0;
110 for (i=0; i<n; i++)
111 {
112 running += xSec[i];
113 index = theMaterial->GetElement(i)->GetIndex();
114 //if(random<=running/sum) break;
115 if( sum == 0 || random <= running/sum ) break;
116 }
117 delete [] xSec;
118 // it is element-wise initialised.
119 }
120 //G4HadFinalState* finalState = theElastic[index].ApplyYourself(aTrack);
121 G4HadFinalState* finalState = (*theElastic[index]).ApplyYourself(aTrack);
122 if (overrideSuspension) finalState->SetStatusChange(isAlive);
125 return finalState;
126 }
@ isAlive
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53
size_t GetIndex() const
Definition: G4Element.hh:182
void SetStatusChange(G4HadFinalStateStatus aS)
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().

◆ DoNotSuspend()

void G4NeutronHPElastic::DoNotSuspend ( )
inline

Definition at line 63 of file G4NeutronHPElastic.hh.

63{overrideSuspension = true;}

◆ GetFatalEnergyCheckLevels()

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

Reimplemented from G4HadronicInteraction.

Definition at line 128 of file G4NeutronHPElastic.cc.

129{
130 //return std::pair<G4double, G4double>(10*perCent,10*GeV);
131 return std::pair<G4double, G4double>(10*perCent,DBL_MAX);
132}
#define DBL_MAX
Definition: templates.hh:83

◆ GetNiso()

G4int G4NeutronHPElastic::GetNiso ( )
inline

Definition at line 61 of file G4NeutronHPElastic.hh.

61{return (*theElastic[0]).GetNiso();}

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