31 #include <TCollection.h>
35 #include <TObjString.h>
48 : TNamed(fname, ftitle)
50 , RootFile(TFile::Open(fname, option, ftitle, compress))
59 : TNamed(f->GetName(), f->GetTitle())
124 std::fstream* f =
new std::fstream(fname);
143 cerr <<
"-E- Could not open input file " << fname << endl;
144 Fatal(
"open",
"Could not open input file");
151 TString newParFileName =
"";
152 TFile* newParFile = 0;
155 TListIter myIter(fnamelist);
162 while ((
string = static_cast<TObjString*>(myIter.Next()))) {
163 inFile = TFile::Open(string->GetString().Data());
165 cout <<
"-W- File \"" <<
string->GetString().Data() <<
"\" does not exist" << endl;
170 newParFileName =
string->GetString();
171 newParFileName.Replace(newParFileName.Last(
'/') + 1, newParFileName.Length(),
"");
173 Form(
"%sallParams_%d_%06d.root", newParFileName.Data(), currentDate.GetDate(), currentDate.GetTime());
174 newParFile = TFile::Open(newParFileName.Data(),
"RECREATE");
177 TList* inputKeys =
static_cast<TList*
>(inFile->GetListOfKeys());
179 TListIter keyIter(inputKeys);
180 while ((inpKey = static_cast<TKey*>(keyIter.Next()))) {
181 TObject* tempObj = inFile->Get(inpKey->GetName());
190 if (newParFile != 0) {
193 std::cout <<
"****NO file to close file = \"" << std::endl;
195 std::cout <<
"**** merged file = \"" << newParFileName.Data() <<
"\"" << std::endl;
197 return this->
open(newParFileName, option, ftitle, compress);
234 cout <<
"Root file I/O " <<
file->GetName() <<
" is open\n";
235 cout <<
"detector I/Os: ";
236 while ((io = static_cast<FairDetParIo*>(next()))) {
237 cout <<
" " << io->GetName();
241 cout <<
"No ROOT file open\n";
void activateParIo(FairParIo *)
static FairRuntimeDb * instance(void)
FairParRootFile * getParRootFile()
ClassImp(FairEventBuilder)
void readVersions(FairRtdbRun *)
Bool_t open(const Text_t *fname, Option_t *option="READ", const Text_t *ftitle="", Int_t compress=1)
FairParRootFile(const Text_t *fname, Option_t *option="READ", const Text_t *ftitle="", Int_t compress=1)
pointer to current run in ROOT file
void readVersions(FairRtdbRun *)