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

#include <G4NeutronHPIsoData.hh>

Public Member Functions

 G4NeutronHPIsoData ()
 
 ~G4NeutronHPIsoData ()
 
G4double GetXsec (G4double energy)
 
G4bool Init (G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
 
G4bool Init (G4int A, G4int Z, G4int M, G4double abun, G4String dirName, G4String aFSType)
 
void Init (G4int A, G4int Z, G4double abun)
 
void Init (G4int A, G4int Z, G4int M, G4double abun)
 
G4NeutronHPVectorMakeElasticData ()
 
G4NeutronHPVectorMakeFissionData ()
 
G4NeutronHPVectorMakeCaptureData ()
 
G4NeutronHPVectorMakeInelasticData ()
 
G4NeutronHPVectorMakeChannelData ()
 
G4String GetName (G4int A, G4int Z, G4String base, G4String rest)
 
void FillChannelData (G4NeutronHPVector *aBuffer)
 
void ThinOut (G4double precision)
 

Detailed Description

Definition at line 43 of file G4NeutronHPIsoData.hh.

Constructor & Destructor Documentation

G4NeutronHPIsoData::G4NeutronHPIsoData ( )
inline

Definition at line 47 of file G4NeutronHPIsoData.hh.

48  {
49  theChannelData = 0;
50  theFissionData = 0;
51  theCaptureData = 0;
52  theElasticData = 0;
53  theInelasticData = 0;
54  }
G4NeutronHPIsoData::~G4NeutronHPIsoData ( )
inline

Definition at line 56 of file G4NeutronHPIsoData.hh.

56 {if(theChannelData!=0) delete theChannelData;}

Member Function Documentation

void G4NeutronHPIsoData::FillChannelData ( G4NeutronHPVector aBuffer)
inline

Definition at line 85 of file G4NeutronHPIsoData.hh.

References G4NeutronHPVector::GetPoint(), G4NeutronHPVector::GetVectorLength(), and G4NeutronHPVector::SetPoint().

Referenced by G4NeutronHPChannel::UpdateData().

86  {
87  if(theChannelData!=0) throw G4HadronicException(__FILE__, __LINE__, "IsoData has channel full already!!!");
88  theChannelData = new G4NeutronHPVector;
89  for(G4int i=0; i<aBuffer->GetVectorLength(); i++)
90  {
91  theChannelData->SetPoint(i, aBuffer->GetPoint(i));
92  }
93  }
G4int GetVectorLength() const
void SetPoint(G4int i, const G4NeutronHPDataPoint &it)
int G4int
Definition: G4Types.hh:78
const G4NeutronHPDataPoint & GetPoint(G4int i) const
G4String G4NeutronHPIsoData::GetName ( G4int  A,
G4int  Z,
G4String  base,
G4String  rest 
)

Definition at line 130 of file G4NeutronHPIsoData.cc.

References G4NeutronHPNames::GetName().

131  {
132  G4bool dbool;
133  return (theNames.GetName(A, Z, base, rest, dbool)).GetName();
134  }
G4String GetName(G4int A, G4int Z, G4String base, G4String rest)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
bool G4bool
Definition: G4Types.hh:79
G4double G4NeutronHPIsoData::GetXsec ( G4double  energy)
inline

Definition at line 58 of file G4NeutronHPIsoData.hh.

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

Referenced by G4NeutronHPChannel::ApplyYourself(), and G4NeutronHPChannel::GetWeightedXsec().

59  {
60  return std::max(0., theChannelData->GetXsec(energy));
61  }
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
G4double GetXsec(G4int i)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4bool G4NeutronHPIsoData::Init ( G4int  A,
G4int  Z,
G4double  abun,
G4String  dirName,
G4String  aFSType 
)
inline

Definition at line 64 of file G4NeutronHPIsoData.hh.

References Init().

Referenced by Init(), G4NeutronHPElementData::UpdateData(), and G4NeutronHPChannel::UpdateData().

64 { G4int M = 0 ; return Init( A, Z, M, abun, dirName, aFSType); };
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
int G4int
Definition: G4Types.hh:78
G4bool G4NeutronHPIsoData::Init ( G4int  A,
G4int  Z,
G4int  M,
G4double  abun,
G4String  dirName,
G4String  aFSType 
)

Definition at line 38 of file G4NeutronHPIsoData.cc.

References python.hepunit::barn, python.hepunit::eV, G4cout, G4endl, G4NeutronHPDataUsed::GetA(), G4NeutronHPManager::GetDataStream(), G4NeutronHPManager::GetInstance(), G4NeutronHPNames::GetName(), G4NeutronHPDataUsed::GetName(), G4NeutronHPDataUsed::GetZ(), and G4NeutronHPVector::Init().

39  {
40  theChannelData = 0;
41  G4double abundance = abun/100.;
42  G4String filename;
43  G4bool result = true;
44  //G4NeutronHPDataUsed aFile = theNames.GetName(A, Z, dirName, aFSType, result);
45  G4NeutronHPDataUsed aFile = theNames.GetName(A, Z, M, dirName, aFSType, result);
46  filename = aFile.GetName();
47 // if(filename=="") return false;
48  //std::ifstream theChannel(filename);
49  std::istringstream theChannel(filename,std::ios::in);
50  G4NeutronHPManager::GetInstance()->GetDataStream(filename,theChannel);
51 
52  if(Z==1 && (aFile.GetZ()!=Z || std::abs(aFile.GetA()-A)>0.0001) )
53  {
54  if(getenv("NeutronHPNamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
55  //080901 TKDB No more necessary below protection, cross sections set to 0 in G4NeutronHPNames
56  //And below two lines causes trouble with G4PhysicsVector
57  //theChannel.close();
58  //return false;
59  }
60  if(!theChannel) {/*theChannel.close()*/; return false;}
61  // accommodating deficiencie of some compilers
62  if(theChannel.eof()) {/*theChannel.close()*/; return false;}
63  if(!theChannel) {/*theChannel.close()*/; return false;}
64  G4int dummy;
65  theChannel >> dummy >> dummy;
66  theChannelData = new G4NeutronHPVector;
67  G4int nData;
68  theChannel >> nData;
69  theChannelData->Init(theChannel, nData, eV, abundance*barn);
70 // G4cout << "Channel Data Statistics: "<<theChannelData->GetVectorLength()<<G4endl;
71 // G4cout << "Channel data"<<G4endl;
72 // G4int hpw;
73 // G4cin >> hpw;
74 // theChannelData->Dump();
75  //theChannel.close();
76  return result;
77  }
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
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void G4NeutronHPIsoData::Init ( G4int  A,
G4int  Z,
G4double  abun 
)
inline

Definition at line 68 of file G4NeutronHPIsoData.hh.

References Init().

68  { G4int M =0;
69  Init( A, Z, M, abun); };
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
int G4int
Definition: G4Types.hh:78
void G4NeutronHPIsoData::Init ( G4int  A,
G4int  Z,
G4int  M,
G4double  abun 
)

Definition at line 80 of file G4NeutronHPIsoData.cc.

References Init().

81  {
82  G4String dirName;
83  if(!getenv("G4NEUTRONHPDATA"))
84  throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
85  G4String baseName = getenv("G4NEUTRONHPDATA");
86  dirName = baseName+"/Fission";
87  //if(Z>89)
88  if(Z>87) //TK Modifed for ENDF VII.0
89  {
90  //Init(A, Z, abun, dirName, "/CrossSection/");
91  Init(A, Z, M, abun, dirName, "/CrossSection");
92  }
93  else
94  {
95  theChannelData = new G4NeutronHPVector;
96  }
97  theFissionData = theChannelData;
98  theChannelData = 0; // fast fix for double delete; revisit later. @@@@@@@
99  dirName = baseName+"/Capture";
100  //Init(A, Z, abun, dirName, "/CrossSection/");
101  Init(A, Z, M, abun, dirName, "/CrossSection");
102  theCaptureData = theChannelData;
103  theChannelData = 0;
104  dirName = baseName+"/Elastic";
105  //Init(A, Z, abun, dirName, "/CrossSection/");
106  Init(A, Z, M, abun, dirName, "/CrossSection");
107  theElasticData = theChannelData;
108  theChannelData = 0;
109  dirName = baseName+"/Inelastic";
110  //Init(A, Z, abun, dirName, "/CrossSection/");
111  Init(A, Z, M, abun, dirName, "/CrossSection");
112  theInelasticData = theChannelData;
113  theChannelData = 0;
114 
115 // if(theInelasticData!=0) G4cout << "Inelastic Data Statistics: "<<theInelasticData->GetVectorLength()<<G4endl;
116 // if(theElasticData!=0) G4cout << "Elastic Data Statistics: "<<theElasticData->GetVectorLength()<<G4endl;
117 // if(theCaptureData!=0) G4cout << "Capture Data Statistics: "<<theCaptureData->GetVectorLength()<<G4endl;
118 // if(theFissionData!=0) G4cout << "Fission Data Statistics: "<<theFissionData->GetVectorLength()<<G4endl;
119 // G4cout << "Inelastic data"<<G4endl;
120 // if(theInelasticData!=0) theInelasticData->Dump();
121 // G4cout << "Elastic data"<<G4endl;
122 // if(theElasticData!=0) theElasticData->Dump();
123 // G4cout << "Capture data"<<G4endl;
124 // if(theCaptureData!=0) theCaptureData->Dump();
125 // G4cout << "Fission data"<<G4endl;
126 // if(theFissionData!=0) theFissionData->Dump();
127 
128  }
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
G4NeutronHPVector* G4NeutronHPIsoData::MakeCaptureData ( )
inline

Definition at line 76 of file G4NeutronHPIsoData.hh.

Referenced by G4NeutronHPElementData::UpdateData().

77  {return theCaptureData;}
G4NeutronHPVector* G4NeutronHPIsoData::MakeChannelData ( )
inline

Definition at line 80 of file G4NeutronHPIsoData.hh.

Referenced by G4NeutronHPChannel::UpdateData().

81  {return theChannelData;}
G4NeutronHPVector* G4NeutronHPIsoData::MakeElasticData ( )
inline

Definition at line 72 of file G4NeutronHPIsoData.hh.

Referenced by G4NeutronHPElementData::UpdateData().

73  {return theElasticData;}
G4NeutronHPVector* G4NeutronHPIsoData::MakeFissionData ( )
inline

Definition at line 74 of file G4NeutronHPIsoData.hh.

Referenced by G4NeutronHPElementData::UpdateData().

75  {return theFissionData;}
G4NeutronHPVector* G4NeutronHPIsoData::MakeInelasticData ( )
inline

Definition at line 78 of file G4NeutronHPIsoData.hh.

Referenced by G4NeutronHPElementData::UpdateData().

79  {return theInelasticData;}
void G4NeutronHPIsoData::ThinOut ( G4double  precision)
inline

Definition at line 95 of file G4NeutronHPIsoData.hh.

References G4NeutronHPVector::ThinOut().

96  {
97  if(theFissionData) theFissionData->ThinOut(precision);
98  if(theCaptureData) theCaptureData->ThinOut(precision);
99  if(theElasticData) theElasticData->ThinOut(precision);
100  if(theInelasticData) theInelasticData->ThinOut(precision);
101  }
void ThinOut(G4double precision)

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