49{
53
54 if ( physTable != nullptr)
55 {
56
57 if ( physTable->size() < numberOfMCC)
58 {
59
60 physTable->
resize(numberOfMCC,
nullptr);
61#ifdef G4VERBOSE
63 {
64 G4cerr <<
"G4PhysicsTableHelper::PreparePhysicsTable ";
65 G4cerr <<
"Physics Table "<< physTable ;
67 }
68#endif
69 }
70 else if ( physTable->size() > numberOfMCC)
71 {
72
73
74 physTable->
resize(numberOfMCC);
75#ifdef G4VERBOSE
77 {
78 G4cerr <<
"G4PhysicsTableHelper::PreparePhysicsTable ";
79 G4cerr <<
"Physics Table "<< physTable ;
80 G4cerr <<
" is longer than number of material-cuts-couple " <<
G4endl;
81 }
82#endif
83 G4Exception(
"G4PhysicsTableHelper::PreparePhysicsTable()",
85 "Physics Table is inconsistent with material-cuts-couple");
86 }
87 }
88 else
89 {
90
92 if (physTable != nullptr)
93 {
94 physTable->
resize(numberOfMCC,
nullptr);
95 }
96 else
97 {
98 G4Exception(
"G4PhysicsTableHelper::PreparePhysicsTable()",
100 "Can't create Physics Table");
101 }
102 }
103
104#ifdef G4VERBOSE
106 {
107 if ( physTable != nullptr)
108 {
109 G4cerr <<
"Physics Table size "<< physTable->size();
110 }
111 else
112 {
113 G4cerr <<
"Physics Table does not exist ";
114 }
115 G4cerr <<
": number of material-cuts-couple " << numberOfMCC <<
G4endl;
116 }
117#endif
118
119
121
122 for (std::size_t idx = 0; idx <numberOfMCC; ++idx)
123 {
125
126
127
129
130
132 }
133
134 return physTable;
135}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
G4bool IsRecalcNeeded() const
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
static G4ProductionCutsTable * GetProductionCutsTable()