Geant4 11.2.2
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, 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)
 
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

◆ ~G4ParticleHPIsoData()

G4ParticleHPIsoData::~G4ParticleHPIsoData ( )
inline

Definition at line 48 of file G4ParticleHPIsoData.hh.

48{ 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
void SetPoint(G4int i, const G4ParticleHPDataPoint &it)

Referenced by G4ParticleHPChannel::UpdateData().

◆ GetName()

G4String G4ParticleHPIsoData::GetName ( G4int A,
G4int Z,
G4String base,
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]
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)

◆ GetXsec()

G4double G4ParticleHPIsoData::GetXsec ( G4double energy)
inline

Definition at line 50 of file G4ParticleHPIsoData.hh.

51 {
52 return std::max(0., theChannelData->GetXsec(energy));
53 }
G4double GetXsec(G4int i)

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 62 of file G4ParticleHPIsoData.hh.

64 {
65 Init(A, Z, 0, abun, projectile, dataDirVariable);
66 }
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)

◆ Init() [2/4]

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

Definition at line 55 of file G4ParticleHPIsoData.hh.

56 {
57 return Init(A, Z, 0, abun, dirName, aFSType);
58 };

Referenced by Init(), Init(), 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 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}
#define M(row, col)
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
static G4ParticleHPManager * GetInstance()

◆ Init() [4/4]

G4bool G4ParticleHPIsoData::Init ( G4int A,
G4int Z,
G4int M,
G4double abun,
G4String dirName,
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}
double G4double
Definition G4Types.hh:83
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)

◆ MakeCaptureData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeCaptureData ( )
inline

Definition at line 73 of file G4ParticleHPIsoData.hh.

73{ return theCaptureData; }

Referenced by G4ParticleHPElementData::UpdateData().

◆ MakeChannelData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeChannelData ( )
inline

Definition at line 75 of file G4ParticleHPIsoData.hh.

75{ return theChannelData; }

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

◆ MakeElasticData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeElasticData ( )
inline

Definition at line 71 of file G4ParticleHPIsoData.hh.

71{ return theElasticData; }

Referenced by G4ParticleHPElementData::UpdateData().

◆ MakeFissionData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeFissionData ( )
inline

Definition at line 72 of file G4ParticleHPIsoData.hh.

72{ return theFissionData; }

Referenced by G4ParticleHPElementData::UpdateData().

◆ MakeInelasticData()

G4ParticleHPVector * G4ParticleHPIsoData::MakeInelasticData ( )
inline

Definition at line 74 of file G4ParticleHPIsoData.hh.

74{ return theInelasticData; }

Referenced by G4ParticleHPElementData::UpdateData().

◆ operator=()

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

◆ ThinOut()

void G4ParticleHPIsoData::ThinOut ( G4double precision)
inline

Definition at line 81 of file G4ParticleHPIsoData.hh.

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

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