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

#include <G4NeutronHPFissionBaseFS.hh>

Inheritance diagram for G4NeutronHPFissionBaseFS:
G4NeutronHPFinalState G4NeutronHPFCFissionFS G4NeutronHPFFFissionFS G4NeutronHPLCFissionFS G4NeutronHPSCFissionFS G4NeutronHPTCFissionFS

Public Member Functions

 G4NeutronHPFissionBaseFS ()
 
virtual ~G4NeutronHPFissionBaseFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit)
 
G4DynamicParticleVectorApplyYourself (G4int Prompt)
 
virtual G4double GetXsec (G4double anEnergy)
 
virtual G4NeutronHPVectorGetXsec ()
 
void SetNeutron (const G4ReactionProduct &aNeutron)
 
void SetTarget (const G4ReactionProduct &aTarget)
 
- Public Member Functions inherited from G4NeutronHPFinalState
 G4NeutronHPFinalState ()
 
virtual ~G4NeutronHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType)
 
virtual G4NeutronHPFinalStateNew ()=0
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4int GetM ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4NeutronHPFinalState
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
 
void adjust_final_state (G4LorentzVector)
 
G4bool DoNotAdjustFinalState ()
 
- Protected Attributes inherited from G4NeutronHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4NeutronHPNames theNames
 
G4HadFinalState theResult
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 

Detailed Description

Definition at line 40 of file G4NeutronHPFissionBaseFS.hh.

Constructor & Destructor Documentation

G4NeutronHPFissionBaseFS::G4NeutronHPFissionBaseFS ( )
inline

Definition at line 44 of file G4NeutronHPFissionBaseFS.hh.

References G4NeutronHPFinalState::hasXsec.

45  {
46  hasXsec = true;
47  theXsection = new G4NeutronHPVector;
48  }
virtual G4NeutronHPFissionBaseFS::~G4NeutronHPFissionBaseFS ( )
inlinevirtual

Definition at line 49 of file G4NeutronHPFissionBaseFS.hh.

50  {
51  delete theXsection;
52  }

Member Function Documentation

G4DynamicParticleVector * G4NeutronHPFissionBaseFS::ApplyYourself ( G4int  Prompt)

Definition at line 94 of file G4NeutronHPFissionBaseFS.cc.

References G4ReactionProduct::GetKineticEnergy(), G4NeutronHPFinalState::HasFSData(), G4ReactionProduct::Lorentz(), G4Neutron::Neutron(), G4NeutronHPEnergyDistribution::Sample(), G4NeutronHPAngular::SampleAndUpdate(), G4ReactionProduct::SetDefinition(), G4DynamicParticle::SetDefinition(), G4ReactionProduct::SetKineticEnergy(), and G4DynamicParticle::SetMomentum().

Referenced by G4NeutronHPFCFissionFS::ApplyYourself(), G4NeutronHPTCFissionFS::ApplyYourself(), G4NeutronHPSCFissionFS::ApplyYourself(), G4NeutronHPLCFissionFS::ApplyYourself(), and G4NeutronHPFFFissionFS::ApplyYourself().

95  {
96 // if therere were no data for this isotope, break out.
97  if(!HasFSData()) { return 0; }
98 
99  G4int i;
101  G4ReactionProduct boosted;
102  boosted.Lorentz(theNeutron, theTarget);
103  G4double eKinetic = boosted.GetKineticEnergy();
104 
105 // Build neutrons
106  G4ReactionProduct * theNeutrons = new G4ReactionProduct[nPrompt];
107  for(i=0; i<nPrompt; i++)
108  {
109  theNeutrons[i].SetDefinition(G4Neutron::Neutron());
110  }
111 
112 // sample energies
113  G4int dummy;
114  for(i=0; i<nPrompt; i++)
115  {
116  // always in the lab system (if file-5)
117  theNeutrons[i].SetKineticEnergy(theEnergyDistribution.Sample(eKinetic, dummy));
118  }
119 
120 // sample neutron angular distribution
121  for(i=0; i<nPrompt; i++)
122  {
123  theAngularDistribution.SampleAndUpdate(theNeutrons[i]);
124  }
125 
126 // already in lab. Add neutrons to dynamic particle vector
127  for(i=0; i<nPrompt; i++)
128  {
130  it->SetDefinition(theNeutrons[i].GetDefinition());
131  it->SetMomentum(theNeutrons[i].GetMomentum());
132  aResult->push_back(it);
133  }
134  delete [] theNeutrons;
135 
136 // return the result
137  return aResult;
138  }
void SetMomentum(const G4ThreeVector &momentum)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
G4double Sample(G4double anEnergy, G4int &it)
int G4int
Definition: G4Types.hh:78
std::vector< G4DynamicParticle * > G4DynamicParticleVector
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4double GetKineticEnergy() const
void SampleAndUpdate(G4ReactionProduct &aNeutron)
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
double G4double
Definition: G4Types.hh:76
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
virtual G4double G4NeutronHPFissionBaseFS::GetXsec ( G4double  anEnergy)
inlinevirtual

Reimplemented from G4NeutronHPFinalState.

Definition at line 58 of file G4NeutronHPFissionBaseFS.hh.

References G4NeutronHPVector::GetY(), and G4INCL::Math::max().

Referenced by G4NeutronHPFissionFS::ApplyYourself().

59  {
60  return std::max(0., theXsection->GetY(anEnergy));
61  }
G4double GetY(G4double x)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual G4NeutronHPVector* G4NeutronHPFissionBaseFS::GetXsec ( )
inlinevirtual

Reimplemented from G4NeutronHPFinalState.

Definition at line 62 of file G4NeutronHPFissionBaseFS.hh.

62 { return theXsection; }
void G4NeutronHPFissionBaseFS::Init ( G4double  A,
G4double  Z,
G4int  M,
G4String dirName,
G4String bit 
)
virtual

Implements G4NeutronHPFinalState.

Reimplemented in G4NeutronHPLCFissionFS, G4NeutronHPSCFissionFS, and G4NeutronHPTCFissionFS.

Definition at line 43 of file G4NeutronHPFissionBaseFS.cc.

References python.hepunit::eV, G4NeutronHPManager::GetDataStream(), G4NeutronHPManager::GetInstance(), G4NeutronHPNames::GetName(), G4NeutronHPDataUsed::GetName(), G4NeutronHPFinalState::hasAnyData, G4NeutronHPFinalState::hasFSData, G4NeutronHPFinalState::hasXsec, G4NeutronHPAngular::Init(), G4NeutronHPEnergyDistribution::Init(), G4NeutronHPVector::Init(), G4NeutronHPFinalState::SetAZMs(), G4NeutronHPFinalState::theNames, G4NeutronHPFinalState::theNDLDataA, G4NeutronHPFinalState::theNDLDataZ, and G4INCL::CrossSections::total().

Referenced by G4NeutronHPFCFissionFS::Init(), G4NeutronHPTCFissionFS::Init(), G4NeutronHPSCFissionFS::Init(), and G4NeutronHPLCFissionFS::Init().

44  {
45  G4String tString = dirName;
46  G4bool dbool;
47  G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, bit, dbool);
48  G4String filename = aFile.GetName();
49  SetAZMs( A, Z, M, aFile );
50  //theBaseA = aFile.GetA();
51  //theBaseZ = aFile.GetZ();
52  //if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001) ) )
53  if ( !dbool || ( Z<2.5 && ( std::abs(theNDLDataZ - Z)>0.0001 || std::abs(theNDLDataA - A)>0.0001)) )
54  {
55  hasAnyData = false;
56  hasFSData = false;
57  hasXsec = false;
58  return; // no data for exactly this isotope.
59  }
60 
61  //std::ifstream theData(filename, std::ios::in);
62  std::istringstream theData(std::ios::in);
64  G4int dummy;
65  if(!(theData))
66  {
67  //theData.close();
68  hasFSData = false;
69  hasXsec = false;
70  hasAnyData = false;
71  return; // no data for this FS for this isotope
72  }
73  theData >> dummy>>dummy;
74  G4int total;
75  theData >> total;
76  theXsection->Init(theData, total, eV);
77  if (!(theData >> dummy))
78  {
79  hasFSData = false;
80  //theData.close();
81  return;
82  }
83  theData >> dummy;
84 
85  theAngularDistribution.Init(theData);
86 
87  theData >> dummy >> dummy;
88 
89  theEnergyDistribution.Init(theData);
90  //theData.close();
91 
92  }
static G4NeutronHPManager * GetInstance()
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
void GetDataStream(G4String, std::istringstream &iss)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void Init(std::istream &aDataFile)
G4double total(Particle const *const p1, Particle const *const p2)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
void G4NeutronHPFissionBaseFS::SetNeutron ( const G4ReactionProduct aNeutron)
inline

Definition at line 64 of file G4NeutronHPFissionBaseFS.hh.

References G4NeutronHPAngular::SetNeutron().

Referenced by G4NeutronHPFissionFS::ApplyYourself().

65  {
66  theNeutron = aNeutron;
67  theAngularDistribution.SetNeutron(aNeutron);
68  }
void SetNeutron(const G4ReactionProduct &aNeutron)
void G4NeutronHPFissionBaseFS::SetTarget ( const G4ReactionProduct aTarget)
inline

Definition at line 70 of file G4NeutronHPFissionBaseFS.hh.

References G4NeutronHPAngular::SetTarget().

Referenced by G4NeutronHPFissionFS::ApplyYourself().

71  {
72  theTarget = aTarget;
73  theAngularDistribution.SetTarget(aTarget);
74  }
void SetTarget(const G4ReactionProduct &aTarget)

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