74 for (G4PhysCollection::const_iterator itr=right.begin();
75 itr!=right.end(); ++itr )
77 G4PhysCollection::push_back(*itr);
87 G4PhysCollection::clear();
93 G4PhysCollection::resize(siz, vec);
104 { fOut.open(fileName, std::ios::out|std::ios::binary); }
106 { fOut.open(fileName, std::ios::out); }
112 G4cerr <<
"G4PhysicsTable::StorePhysicsTable():";
120 size_t tableSize = size();
123 fOut.write( (
char*)(&tableSize),
sizeof tableSize);
127 fOut << tableSize <<
G4endl;
133 G4int vType = (*itr)->GetType();
136 fOut.write( (
char*)(&vType),
sizeof vType);
142 (*itr)->Store(fOut,ascii);
154 fIn.open(fileName,std::ios::in);
171 { fIn.open(fileName,std::ios::in|std::ios::binary); }
173 { fIn.open(fileName,std::ios::in);}
179 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
193 fIn.read((
char*)(&tableSize),
sizeof tableSize);
203 for (
size_t idx=0; idx<tableSize; ++idx)
208 fIn.read( (
char*)(&vType),
sizeof vType);
218 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
219 G4cerr <<
" Illegal Physics Vector type: " << vType <<
" in: ";
229 G4cerr <<
"G4PhysicsTable::RetrievePhysicsTable():";
230 G4cerr <<
" Rrror in retreiving " << idx
231 <<
"-th Physics Vector from file: ";
239 G4PhysCollection::push_back(pVec);
254 out << std::setw(8) << i <<
"-th Vector ";
255 out <<
": Type " <<
G4int((*itr)->GetType()) ;
275 size_t tableSize = G4PhysCollection::size();
277 for (
size_t idx=0; idx<tableSize; idx++)
std::ostream & operator<<(std::ostream &out, G4PhysicsTable &right)
G4PhysicsTable::iterator G4PhysicsTableIterator
@ T_G4PhysicsOrderedFreeVector
@ T_G4PhysicsLinearVector
G4DLLIMPORT std::ostream G4cerr
void resize(size_t, G4PhysicsVector *vec=(G4PhysicsVector *)(0))
G4bool ExistPhysicsTable(const G4String &fileName) const
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false)
G4bool GetFlag(size_t i) const
G4PhysicsVector * CreatePhysicsVector(G4int type)
virtual ~G4PhysicsTable()
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)