Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPIsoData Class Reference

#include <G4ParticleHPIsoData.hh>

Public Member Functions

 G4ParticleHPIsoData ()=default
 
 ~G4ParticleHPIsoData ()
 
G4double GetXsec (G4double energy)
 
G4bool Init (G4int A, G4int Z, G4double abun, const G4String &dirName, const G4String &aFSType)
 
G4bool Init (G4int A, G4int Z, G4int M, G4double abun, const G4String &dirName, const 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 () const
 
G4ParticleHPVectorMakeFissionData () const
 
G4ParticleHPVectorMakeCaptureData () const
 
G4ParticleHPVectorMakeInelasticData () const
 
G4ParticleHPVectorMakeChannelData () const
 
G4String GetName (G4int A, G4int Z, const G4String &base, const G4String &rest)
 
void FillChannelData (G4ParticleHPVector *aBuffer)
 
void ThinOut (G4double precision)
 
G4ParticleHPIsoDataoperator= (const G4ParticleHPIsoData &right)=delete
 
 G4ParticleHPIsoData (const G4ParticleHPIsoData &)=delete
 

Detailed Description

Definition at line 43 of file G4ParticleHPIsoData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPIsoData() [1/2]

G4ParticleHPIsoData::G4ParticleHPIsoData ( )
default

Referenced by G4ParticleHPIsoData(), and operator=().

◆ ~G4ParticleHPIsoData()

G4ParticleHPIsoData::~G4ParticleHPIsoData ( )
inline

Definition at line 49 of file G4ParticleHPIsoData.hh.

49{ delete theChannelData; }

◆ G4ParticleHPIsoData() [2/2]

G4ParticleHPIsoData::G4ParticleHPIsoData ( const G4ParticleHPIsoData & )
delete

Member Function Documentation

◆ FillChannelData()

void G4ParticleHPIsoData::FillChannelData ( G4ParticleHPVector * aBuffer)

Definition at line 46 of file G4ParticleHPIsoData.cc.

47{
48 if (theChannelData != nullptr) {
49 G4Exception("G4ParticleHPIsoData::FillChannelData","hadhp02",
50 FatalException, "Inconsistency: the data uploaded next time");
51 }
52 theChannelData = new G4ParticleHPVector;
53 for (G4int i = 0; i < aBuffer->GetVectorLength(); ++i) {
54 theChannelData->SetPoint(i, aBuffer->GetPoint(i));
55 }
56 theChannelData->Hash();
57}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
int G4int
Definition G4Types.hh:85
const G4ParticleHPDataPoint & GetPoint(G4int i) const
G4int GetVectorLength() const

◆ GetName()

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

Definition at line 137 of file G4ParticleHPIsoData.cc.

138{
139 G4bool dbool;
140 return (theNames.GetName(A, Z, base, rest, dbool)).GetName();
141}
bool G4bool
Definition G4Types.hh:86
const G4double A[17]

◆ GetXsec()

G4double G4ParticleHPIsoData::GetXsec ( G4double energy)
inline

Definition at line 51 of file G4ParticleHPIsoData.hh.

52 {
53 return std::max(0., theChannelData->GetXsec(energy));
54 }

◆ Init() [1/4]

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

Definition at line 56 of file G4ParticleHPIsoData.hh.

57 {
58 return Init(A, Z, 0, abun, dirName, aFSType);
59 }
G4bool Init(G4int A, G4int Z, G4double abun, const G4String &dirName, const G4String &aFSType)

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

◆ Init() [2/4]

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

Definition at line 63 of file G4ParticleHPIsoData.hh.

65 {
66 Init(A, Z, 0, abun, projectile, dataDirVariable);
67 }

◆ Init() [3/4]

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

Definition at line 59 of file G4ParticleHPIsoData.cc.

61{
62 theChannelData = nullptr;
63 G4double abundance = abun / 100.;
64 G4String filename;
65 G4bool result = true;
66 G4ParticleHPDataUsed aFile = theNames.GetName(A, Z, M, dirName, aFSType, result);
67 filename = aFile.GetName();
68
69 std::istringstream theChannel(filename, std::ios::in);
71 man->GetDataStream(filename, theChannel);
72
73#ifdef G4PHPDEBUG
74 if (man->GetDEBUG())
75 G4cout << "G4ParticleHPIsoData::Init = " << filename << " " << A << " " << Z << G4endl;
76#endif
77
78 if (Z == 1 && (aFile.GetZ() != Z || aFile.GetA() != A)) {
79 if (man->GetDEBUG())
80 G4cout << "Skipped = " << filename << " " << A << " " << Z << G4endl;
81 // 080901 TKDB No more necessary below protection, cross sections set to 0
82 }
83 if (!theChannel) { /*theChannel.close()*/
84 return false;
85 }
86 // accommodating deficiencie of some compilers
87 if (theChannel.eof()) { /*theChannel.close()*/
88 return false;
89 }
90 G4int dummy;
91 theChannel >> dummy >> dummy;
92 theChannelData = new G4ParticleHPVector;
93 G4int nData;
94 theChannel >> nData;
95 theChannelData->Init(theChannel, nData, CLHEP::eV, abundance * CLHEP::barn);
96 return result;
97}
#define M(row, col)
double G4double
Definition G4Types.hh:83
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4ParticleHPManager * GetInstance()

◆ Init() [4/4]

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

Definition at line 99 of file G4ParticleHPIsoData.cc.

102{
104
105 G4String baseName = man->GetParticleHPPath(projectile);
106
107 G4String dirName;
108 if (projectile == G4Neutron::Neutron()) {
109 dirName = baseName + "/Fission";
110 if (Z > 87) // TK Modifed for ENDF VII.0
111 {
112 Init(A, Z, M, abun, dirName, "/CrossSection");
113 }
114 else {
115 theChannelData = new G4ParticleHPVector;
116 }
117 theFissionData = theChannelData;
118 theChannelData = nullptr; // fast fix for double delete; revisit later. @@@@@@@
119
120 dirName = baseName + "/Capture";
121 Init(A, Z, M, abun, dirName, "/CrossSection");
122 theCaptureData = theChannelData;
123 theChannelData = nullptr;
124
125 dirName = baseName + "/Elastic";
126 Init(A, Z, M, abun, dirName, "/CrossSection");
127 theElasticData = theChannelData;
128 theChannelData = nullptr;
129 }
130
131 dirName = baseName + "/Inelastic";
132 Init(A, Z, M, abun, dirName, "/CrossSection");
133 theInelasticData = theChannelData;
134 theChannelData = nullptr;
135}
static G4Neutron * Neutron()
Definition G4Neutron.cc:101

◆ MakeCaptureData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeCaptureData ( ) const
inline

Definition at line 74 of file G4ParticleHPIsoData.hh.

74{ return theCaptureData; }

◆ MakeChannelData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeChannelData ( ) const
inline

Definition at line 76 of file G4ParticleHPIsoData.hh.

76{ return theChannelData; }

◆ MakeElasticData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeElasticData ( ) const
inline

Definition at line 72 of file G4ParticleHPIsoData.hh.

72{ return theElasticData; }

◆ MakeFissionData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeFissionData ( ) const
inline

Definition at line 73 of file G4ParticleHPIsoData.hh.

73{ return theFissionData; }

◆ MakeInelasticData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeInelasticData ( ) const
inline

Definition at line 75 of file G4ParticleHPIsoData.hh.

75{ return theInelasticData; }

◆ operator=()

G4ParticleHPIsoData & G4ParticleHPIsoData::operator= ( const G4ParticleHPIsoData & right)
delete

◆ ThinOut()

void G4ParticleHPIsoData::ThinOut ( G4double precision)
inline

Definition at line 82 of file G4ParticleHPIsoData.hh.

83 {
84 if (theFissionData != nullptr) theFissionData->ThinOut(precision);
85 if (theCaptureData != nullptr) theCaptureData->ThinOut(precision);
86 if (theElasticData != nullptr) theElasticData->ThinOut(precision);
87 if (theInelasticData != nullptr) theInelasticData->ThinOut(precision);
88 }

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