Geant4-11
Public Member Functions | Private Attributes
G4ParticleHPIsoData Class Reference

#include <G4ParticleHPIsoData.hh>

Public Member Functions

void FillChannelData (G4ParticleHPVector *aBuffer)
 
 G4ParticleHPIsoData ()
 
G4String GetName (G4int A, G4int Z, G4String base, G4String rest)
 
G4double GetXsec (G4double energy)
 
void Init (G4int A, G4int Z, G4double abun, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
G4bool Init (G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
 
void Init (G4int A, G4int Z, G4int M, G4double abun, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
G4bool Init (G4int A, G4int Z, G4int M, G4double abun, G4String dirName, G4String aFSType)
 
G4ParticleHPVectorMakeCaptureData ()
 
G4ParticleHPVectorMakeChannelData ()
 
G4ParticleHPVectorMakeElasticData ()
 
G4ParticleHPVectorMakeFissionData ()
 
G4ParticleHPVectorMakeInelasticData ()
 
void ThinOut (G4double precision)
 
 ~G4ParticleHPIsoData ()
 

Private Attributes

G4ParticleHPVectortheCaptureData
 
G4ParticleHPVectortheChannelData
 
G4ParticleHPVectortheElasticData
 
G4String theFileName
 
G4ParticleHPVectortheFissionData
 
G4ParticleHPVectortheInelasticData
 
G4ParticleHPNames theNames
 

Detailed Description

Definition at line 45 of file G4ParticleHPIsoData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPIsoData()

G4ParticleHPIsoData::G4ParticleHPIsoData ( )
inline

Definition at line 49 of file G4ParticleHPIsoData.hh.

50 {
56 }
G4ParticleHPVector * theChannelData
G4ParticleHPVector * theCaptureData
G4ParticleHPVector * theFissionData
G4ParticleHPVector * theElasticData
G4ParticleHPVector * theInelasticData

References theCaptureData, theChannelData, theElasticData, theFissionData, and theInelasticData.

◆ ~G4ParticleHPIsoData()

G4ParticleHPIsoData::~G4ParticleHPIsoData ( )
inline

Definition at line 58 of file G4ParticleHPIsoData.hh.

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

References theChannelData.

Member Function Documentation

◆ FillChannelData()

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!!!");
91 for(G4int i=0; i<aBuffer->GetVectorLength(); i++)
92 {
93 theChannelData->SetPoint(i, aBuffer->GetPoint(i));
94 }
96 }
int G4int
Definition: G4Types.hh:85
const G4ParticleHPDataPoint & GetPoint(G4int i) const
G4int GetVectorLength() const
void SetPoint(G4int i, const G4ParticleHPDataPoint &it)

References G4ParticleHPVector::GetPoint(), G4ParticleHPVector::GetVectorLength(), G4ParticleHPVector::Hash(), G4ParticleHPVector::SetPoint(), and theChannelData.

Referenced by G4ParticleHPChannel::UpdateData().

◆ GetName()

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 }
bool G4bool
Definition: G4Types.hh:86
const G4int Z[17]
const G4double A[17]
G4ParticleHPNames theNames
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)

References A, G4ParticleHPNames::GetName(), theNames, and Z.

◆ GetXsec()

G4double G4ParticleHPIsoData::GetXsec ( G4double  energy)
inline

Definition at line 60 of file G4ParticleHPIsoData.hh.

61 {
63 }
G4double GetXsec(G4int i)
G4double energy(const ThreeVector &p, const G4double m)
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References G4INCL::KinematicsUtils::energy(), G4ParticleHPVector::GetXsec(), G4INCL::Math::max(), and theChannelData.

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

◆ Init() [1/4]

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 ); };
#define M(row, col)
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)

References A, Init(), M, and Z.

◆ Init() [2/4]

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); };

References A, Init(), M, and Z.

Referenced by Init(), G4ParticleHPChannel::UpdateData(), and G4ParticleHPElementData::UpdateData().

◆ Init() [3/4]

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 ( std::getenv( dataDirVariable ) ) {
113 baseName = std::getenv( dataDirVariable );
114 } else {
115 baseName = std::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 {
132 }
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");
140 theChannelData = 0;
141
142 dirName = baseName+"/Elastic";
143 //Init(A, Z, abun, dirName, "/CrossSection/");
144 Init(A, Z, M, abun, dirName, "/CrossSection");
146 theChannelData = 0;
147 }
148
149 dirName = baseName+"/Inelastic";
150 //Init(A, Z, abun, dirName, "/CrossSection/");
151 Init(A, Z, M, abun, dirName, "/CrossSection");
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 }
static G4Alpha * Alpha()
Definition: G4Alpha.cc:88
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:93
static G4He3 * He3()
Definition: G4He3.cc:93
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
const G4String & GetParticleName() const
static G4Proton * Proton()
Definition: G4Proton.cc:92
static G4Triton * Triton()
Definition: G4Triton.cc:93

References A, G4Alpha::Alpha(), G4Deuteron::Deuteron(), G4ParticleDefinition::GetParticleName(), G4He3::He3(), Init(), M, G4Neutron::Neutron(), G4Proton::Proton(), theCaptureData, theChannelData, theElasticData, theFissionData, theInelasticData, G4Triton::Triton(), and Z.

◆ Init() [4/4]

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

Definition at line 39 of file G4ParticleHPIsoData.cc.

40 {
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(std::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(std::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;
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 }
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4ParticleHPManager * GetInstance()
void GetDataStream(G4String, std::istringstream &iss)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
static constexpr double barn
Definition: SystemOfUnits.h:86
static constexpr double eV

References A, CLHEP::barn, CLHEP::eV, G4cout, G4endl, G4ParticleHPDataUsed::GetA(), G4ParticleHPManager::GetDataStream(), G4ParticleHPManager::GetInstance(), G4ParticleHPDataUsed::GetName(), G4ParticleHPNames::GetName(), G4ParticleHPDataUsed::GetZ(), G4ParticleHPVector::Init(), M, theChannelData, theNames, and Z.

◆ MakeCaptureData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeCaptureData ( )
inline

Definition at line 78 of file G4ParticleHPIsoData.hh.

79 {return theCaptureData;}

References theCaptureData.

Referenced by G4ParticleHPElementData::UpdateData().

◆ MakeChannelData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeChannelData ( )
inline

Definition at line 82 of file G4ParticleHPIsoData.hh.

83 {return theChannelData;}

References theChannelData.

Referenced by G4ParticleHPChannel::UpdateData().

◆ MakeElasticData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeElasticData ( )
inline

Definition at line 74 of file G4ParticleHPIsoData.hh.

75 {return theElasticData;}

References theElasticData.

Referenced by G4ParticleHPElementData::UpdateData().

◆ MakeFissionData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeFissionData ( )
inline

Definition at line 76 of file G4ParticleHPIsoData.hh.

77 {return theFissionData;}

References theFissionData.

Referenced by G4ParticleHPElementData::UpdateData().

◆ MakeInelasticData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeInelasticData ( )
inline

Definition at line 80 of file G4ParticleHPIsoData.hh.

81 {return theInelasticData;}

References theInelasticData.

Referenced by G4ParticleHPElementData::UpdateData().

◆ ThinOut()

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);
104 }
void ThinOut(G4double precision)

References theCaptureData, theElasticData, theFissionData, theInelasticData, and G4ParticleHPVector::ThinOut().

Field Documentation

◆ theCaptureData

G4ParticleHPVector* G4ParticleHPIsoData::theCaptureData
private

Definition at line 109 of file G4ParticleHPIsoData.hh.

Referenced by G4ParticleHPIsoData(), Init(), MakeCaptureData(), and ThinOut().

◆ theChannelData

G4ParticleHPVector* G4ParticleHPIsoData::theChannelData
private

◆ theElasticData

G4ParticleHPVector* G4ParticleHPIsoData::theElasticData
private

Definition at line 110 of file G4ParticleHPIsoData.hh.

Referenced by G4ParticleHPIsoData(), Init(), MakeElasticData(), and ThinOut().

◆ theFileName

G4String G4ParticleHPIsoData::theFileName
private

Definition at line 114 of file G4ParticleHPIsoData.hh.

◆ theFissionData

G4ParticleHPVector* G4ParticleHPIsoData::theFissionData
private

Definition at line 108 of file G4ParticleHPIsoData.hh.

Referenced by G4ParticleHPIsoData(), Init(), MakeFissionData(), and ThinOut().

◆ theInelasticData

G4ParticleHPVector* G4ParticleHPIsoData::theInelasticData
private

Definition at line 111 of file G4ParticleHPIsoData.hh.

Referenced by G4ParticleHPIsoData(), Init(), MakeInelasticData(), and ThinOut().

◆ theNames

G4ParticleHPNames G4ParticleHPIsoData::theNames
private

Definition at line 115 of file G4ParticleHPIsoData.hh.

Referenced by GetName(), and Init().


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