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

#include <G4ParticleHPIsoData.hh>

Public Member Functions

 G4ParticleHPIsoData ()
 
 ~G4ParticleHPIsoData ()
 
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, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
void Init (G4int A, G4int Z, G4int M, G4double abun, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
G4ParticleHPVectorMakeElasticData ()
 
G4ParticleHPVectorMakeFissionData ()
 
G4ParticleHPVectorMakeCaptureData ()
 
G4ParticleHPVectorMakeInelasticData ()
 
G4ParticleHPVectorMakeChannelData ()
 
G4String GetName (G4int A, G4int Z, G4String base, G4String rest)
 
void FillChannelData (G4ParticleHPVector *aBuffer)
 
void ThinOut (G4double precision)
 

Detailed Description

Definition at line 45 of file G4ParticleHPIsoData.hh.

Constructor & Destructor Documentation

G4ParticleHPIsoData::G4ParticleHPIsoData ( )
inline

Definition at line 49 of file G4ParticleHPIsoData.hh.

50  {
51  theChannelData = 0;
52  theFissionData = 0;
53  theCaptureData = 0;
54  theElasticData = 0;
55  theInelasticData = 0;
56  }
G4ParticleHPIsoData::~G4ParticleHPIsoData ( )
inline

Definition at line 58 of file G4ParticleHPIsoData.hh.

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

Member Function Documentation

void G4ParticleHPIsoData::FillChannelData ( G4ParticleHPVector aBuffer)
inline

Definition at line 87 of file G4ParticleHPIsoData.hh.

88  {
89  if(theChannelData!=0) throw G4HadronicException(__FILE__, __LINE__, "IsoData has channel full already!!!");
90  theChannelData = new G4ParticleHPVector;
91  for(G4int i=0; i<aBuffer->GetVectorLength(); i++)
92  {
93  theChannelData->SetPoint(i, aBuffer->GetPoint(i));
94  }
95  theChannelData->Hash();
96  }
G4int GetVectorLength() const
int G4int
Definition: G4Types.hh:78
void SetPoint(G4int i, const G4ParticleHPDataPoint &it)
const G4ParticleHPDataPoint & GetPoint(G4int i) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4String G4ParticleHPIsoData::GetName ( G4int  A,
G4int  Z,
G4String  base,
G4String  rest 
)

Definition at line 170 of file G4ParticleHPIsoData.cc.

171  {
172  G4bool dbool;
173  return (theNames.GetName(A, Z, base, rest, dbool)).GetName();
174  }
double A(double temperature)
bool G4bool
Definition: G4Types.hh:79
G4String GetName(G4int A, G4int Z, G4String base, G4String rest)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)

Here is the call graph for this function:

G4double G4ParticleHPIsoData::GetXsec ( G4double  energy)
inline

Definition at line 60 of file G4ParticleHPIsoData.hh.

61  {
62  return std::max(0., theChannelData->GetXsec(energy));
63  }
G4double GetXsec(G4int i)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4ParticleHPIsoData::Init ( G4int  A,
G4int  Z,
G4double  abun,
G4String  dirName,
G4String  aFSType 
)
inline

Definition at line 66 of file G4ParticleHPIsoData.hh.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4ParticleHPIsoData::Init ( G4int  A,
G4int  Z,
G4int  M,
G4double  abun,
G4String  dirName,
G4String  aFSType 
)

Definition at line 39 of file G4ParticleHPIsoData.cc.

40  {
41  theChannelData = 0;
42  G4double abundance = abun/100.;
43  G4String filename;
44  G4bool result = true;
45  //G4ParticleHPDataUsed aFile = theNames.GetName(A, Z, dirName, aFSType, result);
46  G4ParticleHPDataUsed aFile = theNames.GetName(A, Z, M, dirName, aFSType, result);
47  filename = aFile.GetName();
48 // if(filename=="") return false;
49  //std::ifstream theChannel(filename);
50  std::istringstream theChannel(filename,std::ios::in);
51  G4ParticleHPManager::GetInstance()->GetDataStream(filename,theChannel);
52 
53 #ifdef G4PHPDEBUG
54  if(getenv("G4ParticleHPDebug")) G4cout << "G4ParticleHPIsoData::Init = "<< filename <<" "<< A << " " << Z <<G4endl;
55 #endif
56 
57  if(Z==1 && (aFile.GetZ()!=Z || std::abs(aFile.GetA()-A)>0.0001) )
58  {
59  if(getenv("G4ParticleHPDebug")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
60  //080901 TKDB No more necessary below protection, cross sections set to 0 in G4ParticleHPNames
61  //And below two lines causes trouble with G4PhysicsVector
62  //theChannel.close();
63  //return false;
64  }
65  if(!theChannel) {/*theChannel.close()*/; return false;}
66  // accommodating deficiencie of some compilers
67  if(theChannel.eof()) {/*theChannel.close()*/; return false;}
68  if(!theChannel) {/*theChannel.close()*/; return false;}
69  G4int dummy;
70  theChannel >> dummy >> dummy;
71  theChannelData = new G4ParticleHPVector;
72  G4int nData;
73  theChannel >> nData;
74  theChannelData->Init(theChannel, nData, CLHEP::eV, abundance*CLHEP::barn);
75 // G4cout << "Channel Data Statistics: "<<theChannelData->GetVectorLength()<<G4endl;
76 // G4cout << "Channel data"<<G4endl;
77 // G4int hpw;
78 // G4cin >> hpw;
79 // theChannelData->Dump();
80 // theChannel.close();
81  return result;
82  }
G4double G4ParticleHPJENDLHEData::G4double result
static G4ParticleHPManager * GetInstance()
void GetDataStream(G4String, std::istringstream &iss)
int G4int
Definition: G4Types.hh:78
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
static constexpr double barn
Definition: SystemOfUnits.h:85
bool G4bool
Definition: G4Types.hh:79
static constexpr double eV
#define G4endl
Definition: G4ios.hh:61
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4ParticleHPIsoData::Init ( G4int  A,
G4int  Z,
G4double  abun,
G4ParticleDefinition projectile,
const char *  dataDirVariable 
)
inline

Definition at line 70 of file G4ParticleHPIsoData.hh.

70  { G4int M =0;
71  Init( A, Z, M, abun, projectile, dataDirVariable ); };
int G4int
Definition: G4Types.hh:78
double A(double temperature)
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)

Here is the call graph for this function:

void G4ParticleHPIsoData::Init ( G4int  A,
G4int  Z,
G4int  M,
G4double  abun,
G4ParticleDefinition projectile,
const char *  dataDirVariable 
)

Definition at line 90 of file G4ParticleHPIsoData.cc.

91  {
92 
93  G4String particleName;
94  if ( projectile == G4Neutron::Neutron() ) {
95  ;
96  } else if ( projectile == G4Proton::Proton() ) {
97  particleName = "Proton";
98  } else if ( projectile == G4Deuteron::Deuteron() ) {
99  particleName = "Deuteron";
100  } else if ( projectile == G4Triton::Triton() ) {
101  particleName = "Triton";
102  } else if ( projectile == G4He3::He3() ) {
103  particleName = "He3";
104  } else if ( projectile == G4Alpha::Alpha() ) {
105  particleName = "Alpha";
106  } else {
107  G4String message("G4ParticleHPInelastic may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + projectile->GetParticleName());
108  throw G4HadronicException(__FILE__, __LINE__,message.c_str());
109  }
110 
111  G4String baseName;
112  if ( getenv( dataDirVariable ) ) {
113  baseName = getenv( dataDirVariable );
114  } else {
115  baseName = getenv( "G4PARTICLEHPDATA" );
116  baseName += "/" + particleName;
117  }
118 
119  // G4String baseName = getenv(dataDirVariable);
120  G4String dirName;
121  if( projectile == G4Neutron::Neutron() ){
122  dirName = baseName+"/Fission";
123  //if(Z>89)
124  if(Z>87) //TK Modifed for ENDF VII.0
125  {
126  //Init(A, Z, abun, dirName, "/CrossSection/");
127  Init(A, Z, M, abun, dirName, "/CrossSection");
128  }
129  else
130  {
131  theChannelData = new G4ParticleHPVector;
132  }
133  theFissionData = theChannelData;
134  theChannelData = 0; // fast fix for double delete; revisit later. @@@@@@@
135 
136  dirName = baseName+"/Capture";
137  //Init(A, Z, abun, dirName, "/CrossSection/");
138  Init(A, Z, M, abun, dirName, "/CrossSection");
139  theCaptureData = theChannelData;
140  theChannelData = 0;
141 
142  dirName = baseName+"/Elastic";
143  //Init(A, Z, abun, dirName, "/CrossSection/");
144  Init(A, Z, M, abun, dirName, "/CrossSection");
145  theElasticData = theChannelData;
146  theChannelData = 0;
147  }
148 
149  dirName = baseName+"/Inelastic";
150  //Init(A, Z, abun, dirName, "/CrossSection/");
151  Init(A, Z, M, abun, dirName, "/CrossSection");
152  theInelasticData = theChannelData;
153  theChannelData = 0;
154 
155 // if(theInelasticData!=0) G4cout << "Inelastic Data Statistics: "<<theInelasticData->GetVectorLength()<<G4endl;
156 // if(theElasticData!=0) G4cout << "Elastic Data Statistics: "<<theElasticData->GetVectorLength()<<G4endl;
157 // if(theCaptureData!=0) G4cout << "Capture Data Statistics: "<<theCaptureData->GetVectorLength()<<G4endl;
158 // if(theFissionData!=0) G4cout << "Fission Data Statistics: "<<theFissionData->GetVectorLength()<<G4endl;
159 // G4cout << "Inelastic data"<<G4endl;
160 // if(theInelasticData!=0) theInelasticData->Dump();
161 // G4cout << "Elastic data"<<G4endl;
162 // if(theElasticData!=0) theElasticData->Dump();
163 // G4cout << "Capture data"<<G4endl;
164 // if(theCaptureData!=0) theCaptureData->Dump();
165 // G4cout << "Fission data"<<G4endl;
166 // if(theFissionData!=0) theFissionData->Dump();
167 
168  }
const G4String & GetParticleName() const
double A(double temperature)
static G4Triton * Triton()
Definition: G4Triton.cc:95
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
static G4He3 * He3()
Definition: G4He3.cc:94

Here is the call graph for this function:

G4ParticleHPVector* G4ParticleHPIsoData::MakeCaptureData ( )
inline

Definition at line 78 of file G4ParticleHPIsoData.hh.

79  {return theCaptureData;}

Here is the caller graph for this function:

G4ParticleHPVector* G4ParticleHPIsoData::MakeChannelData ( )
inline

Definition at line 82 of file G4ParticleHPIsoData.hh.

83  {return theChannelData;}

Here is the caller graph for this function:

G4ParticleHPVector* G4ParticleHPIsoData::MakeElasticData ( )
inline

Definition at line 74 of file G4ParticleHPIsoData.hh.

75  {return theElasticData;}

Here is the caller graph for this function:

G4ParticleHPVector* G4ParticleHPIsoData::MakeFissionData ( )
inline

Definition at line 76 of file G4ParticleHPIsoData.hh.

77  {return theFissionData;}

Here is the caller graph for this function:

G4ParticleHPVector* G4ParticleHPIsoData::MakeInelasticData ( )
inline

Definition at line 80 of file G4ParticleHPIsoData.hh.

81  {return theInelasticData;}

Here is the caller graph for this function:

void G4ParticleHPIsoData::ThinOut ( G4double  precision)
inline

Definition at line 98 of file G4ParticleHPIsoData.hh.

99  {
100  if(theFissionData) theFissionData->ThinOut(precision);
101  if(theCaptureData) theCaptureData->ThinOut(precision);
102  if(theElasticData) theElasticData->ThinOut(precision);
103  if(theInelasticData) theInelasticData->ThinOut(precision);
104  }
void ThinOut(G4double precision)

Here is the call graph for this function:


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