62 G4PhysCollection::clear();
69 G4PhysCollection::resize(siz, vec);
81 fOut.open(fileName, std::ios::out | std::ios::binary);
85 fOut.open(fileName, std::ios::out);
92 G4cerr <<
"G4PhysicsTable::StorePhysicsTable():";
100 std::size_t tableSize = size();
103 fOut.write((
char*) (&tableSize),
sizeof tableSize);
107 fOut << tableSize <<
G4endl;
111 for(
auto itr = cbegin(); itr != cend(); ++itr)
113 G4int vType = (*itr)->GetType();
116 fOut.write((
char*) (&vType),
sizeof vType);
122 (*itr)->Store(fOut, ascii);
134 fIn.open(fileName, std::ios::in);
153 fIn.open(fileName, std::ios::in | std::ios::binary);
157 fIn.open(fileName, std::ios::in);
164 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
175 std::size_t tableSize = 0;
178 fIn.read((
char*) (&tableSize),
sizeof tableSize);
188 for(std::size_t idx = 0; idx < tableSize; ++idx)
193 fIn.read((
char*) (&vType),
sizeof vType);
203 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
204 G4cerr <<
" Illegal Physics Vector type: " << vType <<
" in: ";
214 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
215 G4cerr <<
" Rrror in retreiving " << idx
216 <<
"-th Physics Vector from file: ";
224 G4PhysCollection::push_back(pVec);
236 for(
auto itr = right.cbegin(); itr != right.cend(); ++itr)
238 out << std::setw(8) << i <<
"-th Vector ";
239 out <<
": Type " <<
G4int((*itr)->GetType());
260 size_t tableSize = G4PhysCollection::size();
262 for(std::size_t idx = 0; idx < tableSize; ++idx)
@ T_G4PhysicsLinearVector
G4GLOB_DLL std::ostream G4cerr
G4bool GetFlag(std::size_t i) const
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false, G4bool spline=false)
G4bool ExistPhysicsTable(const G4String &fileName) const
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
void resize(std::size_t, G4PhysicsVector *vec=(G4PhysicsVector *)(0))
G4PhysicsVector * CreatePhysicsVector(G4int type, G4bool spline)
std::vector< G4PhysicsVector * > G4PhysCollection
virtual ~G4PhysicsTable()
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)