Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPCapture Class Reference

#include <G4NeutronHPCapture.hh>

Inheritance diagram for G4NeutronHPCapture:
G4HadronicInteraction

Public Member Functions

 G4NeutronHPCapture ()
 
 ~G4NeutronHPCapture ()
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
 
virtual const std::pair
< G4double, G4double
GetFatalEnergyCheckLevels () const
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int)
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
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
 
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 std::pair< G4double,
G4double
GetEnergyMomentumCheckLevels () 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 47 of file G4NeutronHPCapture.hh.

Constructor & Destructor Documentation

G4NeutronHPCapture::G4NeutronHPCapture ( )

Definition at line 40 of file G4NeutronHPCapture.cc.

References G4Element::GetElementTable(), G4Element::GetNumberOfElements(), lightions::Init(), python.hepunit::MeV, G4AutoDelete::Register(), G4HadronicInteraction::SetMaxEnergy(), and G4HadronicInteraction::SetMinEnergy().

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

Definition at line 74 of file G4NeutronHPCapture.cc.

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

Member Function Documentation

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

Implements G4HadronicInteraction.

Definition at line 87 of file G4NeutronHPCapture.cc.

References G4NeutronHPManager::CloseReactionWhiteBoard(), G4cout, G4endl, G4UniformRand, G4Material::GetElement(), G4Element::GetIndex(), G4NeutronHPManager::GetInstance(), G4HadProjectile::GetMaterial(), G4Element::GetNumberOfElements(), G4Material::GetNumberOfElements(), G4Material::GetTemperature(), G4NeutronHPThermalBoost::GetThermalEnergy(), G4Material::GetVecNbOfAtomsPerVolume(), G4INCL::Math::max(), n, G4NeutronHPManager::OpenReactionWhiteBoard(), and G4Nucleus::SetParameters().

88  {
89 
90  if ( numEle < (G4int)G4Element::GetNumberOfElements() ) addChannelForNewElement();
91 
93  if(getenv("NeutronHPCapture")) G4cout <<" ####### G4NeutronHPCapture called"<<G4endl;
94  const G4Material * theMaterial = aTrack.GetMaterial();
95  G4int n = theMaterial->GetNumberOfElements();
96  G4int index = theMaterial->GetElement(0)->GetIndex();
97  if(n!=1)
98  {
99  xSec = new G4double[n];
100  G4double sum=0;
101  G4int i;
102  const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
103  G4double rWeight;
104  G4NeutronHPThermalBoost aThermalE;
105  for (i=0; i<n; i++)
106  {
107  index = theMaterial->GetElement(i)->GetIndex();
108  rWeight = NumAtomsPerVolume[i];
109  //xSec[i] = theCapture[index].GetXsec(aThermalE.GetThermalEnergy(aTrack,
110  xSec[i] = (*theCapture[index]).GetXsec(aThermalE.GetThermalEnergy(aTrack,
111  theMaterial->GetElement(i),
112  theMaterial->GetTemperature()));
113  xSec[i] *= rWeight;
114  sum+=xSec[i];
115  }
116  G4double random = G4UniformRand();
117  G4double running = 0;
118  for (i=0; i<n; i++)
119  {
120  running += xSec[i];
121  index = theMaterial->GetElement(i)->GetIndex();
122  //if(random<=running/sum) break;
123  if( sum == 0 || random <= running/sum ) break;
124  }
125  if(i==n) i=std::max(0, n-1);
126  delete [] xSec;
127  }
128 
129  //return theCapture[index].ApplyYourself(aTrack);
130  //G4HadFinalState* result = theCapture[index].ApplyYourself(aTrack);
131  G4HadFinalState* result = (*theCapture[index]).ApplyYourself(aTrack);
132  aNucleus.SetParameters(G4NeutronHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargA(),G4NeutronHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargZ());
134  return result;
135  }
static G4NeutronHPManager * GetInstance()
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:200
int G4int
Definition: G4Types.hh:78
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:204
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
Definition: G4Element.cc:402
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
size_t GetIndex() const
Definition: G4Element.hh:181
const G4int n
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)
G4double GetTemperature() const
Definition: G4Material.hh:180
#define G4endl
Definition: G4ios.hh:61
const G4Material * GetMaterial() const
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
double G4double
Definition: G4Types.hh:76
const std::pair< G4double, G4double > G4NeutronHPCapture::GetFatalEnergyCheckLevels ( ) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 137 of file G4NeutronHPCapture.cc.

References DBL_MAX, and python.hepunit::perCent.

138 {
139  //return std::pair<G4double, G4double>(10*perCent,10*GeV);
140  return std::pair<G4double, G4double>(10*perCent,DBL_MAX);
141 }
float perCent
Definition: hepunit.py:239
#define DBL_MAX
Definition: templates.hh:83
G4int G4NeutronHPCapture::GetVerboseLevel ( ) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 157 of file G4NeutronHPCapture.cc.

References G4NeutronHPManager::GetInstance(), and G4NeutronHPManager::GetVerboseLevel().

158 {
160 }
static G4NeutronHPManager * GetInstance()
void G4NeutronHPCapture::SetVerboseLevel ( G4int  newValue)
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 161 of file G4NeutronHPCapture.cc.

References G4NeutronHPManager::GetInstance(), and G4NeutronHPManager::SetVerboseLevel().

162 {
164 }
static G4NeutronHPManager * GetInstance()
void SetVerboseLevel(G4int i)

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