Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPJENDLHEData Class Reference

#include <G4ParticleHPJENDLHEData.hh>

Inheritance diagram for G4ParticleHPJENDLHEData:
Collaboration diagram for G4ParticleHPJENDLHEData:

Public Member Functions

 G4ParticleHPJENDLHEData ()
 
 G4ParticleHPJENDLHEData (G4String, G4ParticleDefinition *)
 
 ~G4ParticleHPJENDLHEData ()
 
G4bool IsApplicable (const G4DynamicParticle *, const G4Element *)
 
G4bool IsZAApplicable (const G4DynamicParticle *, G4double, G4double)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, G4double aT)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
void DumpPhysicsTable (const G4ParticleDefinition &)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
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)
 
const G4StringGetName () const
 

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 48 of file G4ParticleHPJENDLHEData.hh.

Constructor & Destructor Documentation

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( )

Definition at line 60 of file G4ParticleHPJENDLHEData.cc.

61 {
62  for ( std::map< G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itZ = mIsotope.begin();
63  itZ != mIsotope.end(); ++itZ ) {
64  std::map< G4int , G4PhysicsVector* >* pointer_map = itZ->second;
65  if ( pointer_map ) {
66  for ( std::map< G4int , G4PhysicsVector* >::iterator itA = pointer_map->begin();
67  itA != pointer_map->end() ; ++itA ) {
68  G4PhysicsVector* pointerPhysicsVector = itA->second;
69  if ( pointerPhysicsVector ) {
70  delete pointerPhysicsVector;
71  itA->second = NULL;
72  }
73  }
74  delete pointer_map;
75  itZ->second = NULL;
76  }
77  }
78  mIsotope.clear();
79 }
int G4int
Definition: G4Types.hh:78
G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( G4String  reaction,
G4ParticleDefinition pd 
)

Definition at line 83 of file G4ParticleHPJENDLHEData.cc.

84 :G4VCrossSectionDataSet( "JENDLHE"+reaction+"CrossSection" )
85 {
86  reactionName = reaction;
87  BuildPhysicsTable( *pd );
88 }
G4VCrossSectionDataSet(const G4String &nam="")
void BuildPhysicsTable(const G4ParticleDefinition &)

Here is the call graph for this function:

G4ParticleHPJENDLHEData::~G4ParticleHPJENDLHEData ( )

Definition at line 92 of file G4ParticleHPJENDLHEData.cc.

93 {
94  ;
95  //delete theCrossSections;
96 }

Member Function Documentation

void G4ParticleHPJENDLHEData::BuildPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 100 of file G4ParticleHPJENDLHEData.cc.

101 {
102 
103 // if ( &aP != G4Neutron::Neutron() )
104 // throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
105  particleName = aP.GetParticleName();
106 
107  G4String baseName = getenv( "G4NEUTRONHPDATA" );
108  G4String dirName = baseName+"/JENDL_HE/"+particleName+"/"+reactionName ;
109  G4String aFSType = "/CrossSection/";
110  G4ParticleHPNames theNames;
111 
112  G4String filename;
113 
114 // Create JENDL_HE data
115 // Create map element or isotope
116 
117  size_t numberOfElements = G4Element::GetNumberOfElements();
118  //theCrossSections = new G4PhysicsTable( numberOfElements );
119 
120  // make a PhysicsVector for each element
121 
122  static G4ThreadLocal G4ElementTable *theElementTable = 0 ; if (!theElementTable) theElementTable= G4Element::GetElementTable();
123  vElement.clear();
124  vElement.resize( numberOfElements );
125  for ( size_t i = 0; i < numberOfElements; ++i )
126  {
127 
128  G4Element* theElement = (*theElementTable)[i];
129  vElement[i] = false;
130 
131  // isotope
132  G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
133  G4int Z = static_cast<G4int> ((*theElementTable)[i]->GetZ());
134  if ( nIso!=0 )
135  {
136  G4bool found_at_least_one = false;
137  for ( G4int i1 = 0; i1 < nIso; i1++ )
138  {
139  G4int A = theElement->GetIsotope(i1)->GetN();
140 
141  if ( isThisNewIsotope( Z , A ) )
142  {
143 
144  std::stringstream ss;
145  ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
146  filename = ss.str();
147  std::fstream file;
148  file.open ( filename , std::fstream::in );
149  G4int dummy;
150  file >> dummy;
151  if ( file.good() )
152  {
153 
154  //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
155  found_at_least_one = true;
156 
157  // read the file
158  G4PhysicsVector* aPhysVec = readAFile ( &file );
159 
160  //Regist
161 
162  registAPhysicsVector( Z , A , aPhysVec );
163 
164  }
165  else
166  {
167  //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
168  }
169 
170  file.close();
171 
172  }
173  else
174  {
175  found_at_least_one = TRUE;
176  }
177  }
178 
179  if ( found_at_least_one ) vElement[i] = true;
180 
181  }
182  else
183  {
184  G4StableIsotopes theStableOnes;
185  G4int first = theStableOnes.GetFirstIsotope( Z );
186  G4bool found_at_least_one = FALSE;
187  for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(theElement->GetZ() ) ); i1++)
188  {
189  G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
190 
191  if ( isThisNewIsotope( Z , A ) )
192  {
193 
194  std::stringstream ss;
195  ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
196  filename = ss.str();
197 
198  std::fstream file;
199  file.open ( filename , std::fstream::in );
200  G4int dummy;
201  file >> dummy;
202  if ( file.good() )
203  {
204  //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
205  found_at_least_one = TRUE;
206  //Read the file
207 
208  G4PhysicsVector* aPhysVec = readAFile ( &file );
209 
210  //Regist the PhysicsVector
211  registAPhysicsVector( Z , A , aPhysVec );
212 
213  }
214  else
215  {
216  //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
217  }
218 
219  file.close();
220  }
221  else
222  {
223  found_at_least_one = TRUE;
224  }
225  }
226 
227  if ( found_at_least_one ) vElement[i] = true;
228 
229  }
230 
231  }
232 
233 }
G4int GetFirstIsotope(G4int Z)
G4double GetZ() const
Definition: G4Element.hh:131
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4int GetN() const
Definition: G4Isotope.hh:94
double A(double temperature)
static size_t GetNumberOfElements()
Definition: G4Element.cc:405
bool G4bool
Definition: G4Types.hh:79
#define FALSE
Definition: globals.hh:52
#define TRUE
Definition: globals.hh:55
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ParticleHPJENDLHEData::DumpPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 237 of file G4ParticleHPJENDLHEData.cc.

238 {
239  if(&aP!=G4Neutron::Neutron())
240  throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
241 // G4cout << "G4ParticleHPJENDLHEData::DumpPhysicsTable still to be implemented"<<G4endl;
242 }
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

Here is the call graph for this function:

G4double G4ParticleHPJENDLHEData::GetCrossSection ( const G4DynamicParticle ,
const G4Element ,
G4double  aT 
)
G4bool G4ParticleHPJENDLHEData::IsApplicable ( const G4DynamicParticle aP,
const G4Element anE 
)

Definition at line 41 of file G4ParticleHPJENDLHEData.cc.

42 {
43 
44  G4bool result = true;
45  G4double eKin = aP->GetKineticEnergy();
46  //if(eKin>20*MeV||aP->GetDefinition()!=G4Neutron::Neutron()) result = false;
47  if ( eKin < 20*MeV || 3*GeV < eKin || aP->GetDefinition()!=G4Neutron::Neutron() )
48  {
49  result = false;
50  }
51 // Element Check
52  else if ( !(vElement[ anE->GetIndex() ]) ) result = false;
53 
54  return result;
55 
56 }
G4double G4ParticleHPJENDLHEData::G4double result
G4double GetKineticEnergy() const
bool G4bool
Definition: G4Types.hh:79
size_t GetIndex() const
Definition: G4Element.hh:182
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4bool G4ParticleHPJENDLHEData::IsZAApplicable ( const G4DynamicParticle ,
G4double  ,
G4double   
)
inline

Definition at line 60 of file G4ParticleHPJENDLHEData.hh.

61  { return false; }

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