65 G4PhysCollection::clear();
72 G4PhysCollection::resize(siz, vec);
84 fOut.open(fileName, std::ios::out | std::ios::binary);
88 fOut.open(fileName, std::ios::out);
95 G4cerr <<
"G4PhysicsTable::StorePhysicsTable():";
103 std::size_t tableSize = size();
106 fOut.write((
char*) (&tableSize),
sizeof tableSize);
110 fOut << tableSize <<
G4endl;
114 for(
auto itr = cbegin(); itr != cend(); ++itr)
116 G4int vType = (*itr)->GetType();
119 fOut.write((
char*) (&vType),
sizeof vType);
125 (*itr)->Store(fOut, ascii);
137 fIn.open(fileName, std::ios::in);
156 fIn.open(fileName, std::ios::in | std::ios::binary);
160 fIn.open(fileName, std::ios::in);
167 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
178 std::size_t tableSize = 0;
181 fIn.read((
char*) (&tableSize),
sizeof tableSize);
191 for(std::size_t idx = 0; idx < tableSize; ++idx)
196 fIn.read((
char*) (&vType),
sizeof vType);
206 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
207 G4cerr <<
" Illegal Physics Vector type: " << vType <<
" in: ";
217 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
218 G4cerr <<
" Rrror in retreiving " << idx
219 <<
"-th Physics Vector from file: ";
227 G4PhysCollection::push_back(pVec);
239 for(
auto itr = right.cbegin(); itr != right.cend(); ++itr)
241 out << std::setw(8) << i <<
"-th Vector ";
242 out <<
": Type " <<
G4int((*itr)->GetType());
263 size_t tableSize = G4PhysCollection::size();
265 for(std::size_t idx = 0; idx < tableSize; ++idx)
std::ostream & operator<<(std::ostream &out, G4PhysicsTable &right)
@ T_G4PhysicsOrderedFreeVector
@ T_G4PhysicsLinearVector
G4GLOB_DLL std::ostream G4cerr
G4bool GetFlag(std::size_t i) const
G4bool ExistPhysicsTable(const G4String &fileName) const
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false)
void resize(std::size_t, G4PhysicsVector *vec=(G4PhysicsVector *)(0))
G4PhysicsVector * CreatePhysicsVector(G4int type)
virtual ~G4PhysicsTable()
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)