57 if ( physTable !=
nullptr )
60 if ( physTable->size() < numberOfMCC )
65 G4cout <<
"G4PhysicsTableHelper::PreparePhysicsTable: "
66 <<
" the table " << physTable <<
" size="
68 <<
" will be is resized to " << numberOfMCC <<
G4endl;
72 physTable->
resize(numberOfMCC,
nullptr);
74 else if ( physTable->size() > numberOfMCC )
79 ed <<
"table " << physTable <<
" size=" << physTable->size()
80 <<
" is longer than number of material-cuts-couple " << numberOfMCC;
81 G4Exception(
"G4PhysicsTableHelper::PreparePhysicsTable()",
89 physTable->
resize(numberOfMCC,
nullptr);
95 G4cout <<
"G4PhysicsTableHelper::PreparePhysicsTable: "
96 <<
" the table "<< physTable
97 <<
" size=" << numberOfMCC <<
G4endl;
104 for (std::size_t idx = 0; idx <numberOfMCC; ++idx)
124 if (physTable ==
nullptr )
return false;
131 ed <<
"Cannot retrieve physics table from the file <" << fileName <<
">";
132 G4Exception(
"G4ProductionCutsTable::RetrievePhysicsTable()",
144 if ( tempTable->size() != converter->
size())
147 ed <<
"Physics table in " << fileName
148 <<
"\n size=" << tempTable->size() <<
" "
149 <<
" is inconsistent with material-cut-couple "
150 <<
"size=" << converter->
size() <<
" the table is not retrieved!";
151 G4Exception(
"G4ProductionCutsTable::RetrievePhysicsTable()",
158 for (std::size_t idx=0; idx<converter->
size(); ++idx)
160 if (converter->
IsUsed(idx))
170 if (vec !=
nullptr )
delete vec;
171 (*physTable)[i] = (*tempTable)[idx];
186 if ( physTable ==
nullptr) {
return; }
188 if ( physTable->size() <= idx)
191 ed <<
"Given index (" << idx <<
") exceeds "
192 <<
"the size of the physics table "
193 <<
"( size =" << physTable->size() <<
") the vector is not added!";
194 G4Exception(
"G4ProductionCutsTable::SetPhysicsVector()",
201 (*physTable)[idx] = vec;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4bool IsUsed(std::size_t index) const
G4int GetIndex(std::size_t index) const
G4bool IsRecalcNeeded() const
static G4int verboseLevel
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)
static void SetVerboseLevel(G4int value)
static G4int GetVerboseLevel()
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
void resize(std::size_t, G4PhysicsVector *vec=nullptr)
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false, G4bool spline=false)
void ClearFlag(std::size_t i)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
const G4MCCIndexConversionTable * GetMCCIndexConversionTable() const
static G4ProductionCutsTable * GetProductionCutsTable()