54 if ( physTable !=
nullptr)
57 if ( physTable->size() < numberOfMCC)
60 physTable->
resize(numberOfMCC,
nullptr);
64 G4cerr <<
"G4PhysicsTableHelper::PreparePhysicsTable ";
65 G4cerr <<
"Physics Table "<< physTable ;
70 else if ( physTable->size() > numberOfMCC)
74 physTable->
resize(numberOfMCC);
78 G4cerr <<
"G4PhysicsTableHelper::PreparePhysicsTable ";
79 G4cerr <<
"Physics Table "<< physTable ;
80 G4cerr <<
" is longer than number of material-cuts-couple " <<
G4endl;
83 G4Exception(
"G4PhysicsTableHelper::PreparePhysicsTable()",
85 "Physics Table is inconsistent with material-cuts-couple");
92 if (physTable !=
nullptr)
94 physTable->
resize(numberOfMCC,
nullptr);
98 G4Exception(
"G4PhysicsTableHelper::PreparePhysicsTable()",
100 "Can't create Physics Table");
107 if ( physTable !=
nullptr)
109 G4cerr <<
"Physics Table size "<< physTable->size();
113 G4cerr <<
"Physics Table does not exist ";
115 G4cerr <<
": number of material-cuts-couple " << numberOfMCC <<
G4endl;
122 for (std::size_t idx = 0; idx <numberOfMCC; ++idx)
142 if (physTable ==
nullptr )
return false;
151 G4cerr <<
"G4PhysicsTableHelper::RetrievePhysicsTable ";
152 G4cerr <<
"Fail to retrieve from "<< fileName <<
G4endl;
155 G4Exception(
"G4ProductionCutsTable::RetrievePhysicsTable()",
157 JustWarning,
"Can not retrieve physics tables from file");
168 if ( tempTable->size() != converter->
size())
173 G4cerr <<
"G4PhysicsTableHelper::RetrievePhysicsTable ";
174 G4cerr <<
"Size of the physics table in "<< fileName;
175 G4cerr <<
"( size =" << tempTable->size() <<
")";
176 G4cerr <<
" is inconsistent with material-cut info";
177 G4cerr <<
"( size =" << converter->
size() <<
")";
181 G4Exception(
"G4ProductionCutsTable::RetrievePhysicsTable()",
183 "Retrieved file is inconsistent with current physics tables!");
189 for (std::size_t idx=0; idx<converter->
size(); ++idx)
191 if (converter->
IsUsed(idx))
193 if (converter->
GetIndex(idx)<0)
continue;
194 std::size_t i = converter->
GetIndex(idx);
196 if (vec !=
nullptr )
delete vec;
197 (*physTable)[i] = (*tempTable)[idx];
212 if ( physTable ==
nullptr) {
return; }
214 if ( physTable->size() <= idx)
219 G4cerr <<
"G4PhysicsTableHelper::SetPhysicsVector ";
220 G4cerr <<
"Given index (" << idx <<
") exceeds ";
221 G4cerr <<
"size of the physics table ";
222 G4cerr <<
"( size =" << physTable->size()<<
")";
226 G4Exception(
"G4ProductionCutsTable::SetPhysicsVector()",
233 (*physTable)[idx] = vec;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
G4bool IsUsed(std::size_t index) const
G4int GetIndex(std::size_t index) const
G4bool IsRecalcNeeded() const
static G4ThreadLocal G4int verboseLevel
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
static void SetVerboseLevel(G4int value)
static G4int GetVerboseLevel()
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii)
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false)
void resize(std::size_t, G4PhysicsVector *vec=(G4PhysicsVector *)(0))
void ClearFlag(std::size_t i)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
const G4MCCIndexConversionTable * GetMCCIndexConversionTable() const
static G4ProductionCutsTable * GetProductionCutsTable()