26 #include <TCollection.h>
28 #include <TObjString.h>
62 if (!((strcmp(status,
"in") == 0) || (strcmp(status,
"out") == 0))) {
63 cout <<
"Put the right stream option for file " << fname
64 <<
"\n writing state : out\n reading state : in \nopen aborted \n";
67 file =
new std::fstream();
68 if (strcmp(status,
"in") == 0) {
69 file->open(fname, ios::in);
71 if (strcmp(status,
"out") == 0) {
72 file->open(fname, ios::out);
74 filebuf* buf =
file->rdbuf();
75 if (
file && (buf->is_open() == 1)) {
80 cerr <<
"-E- Could not open input file " << fname << endl;
81 Fatal(
"open",
"Could not open input file");
87 if (0 == fnamelist->GetEntries()) {
88 LOG(error) <<
"The defined list of parameter files is empty. There are no parameters initialized from the "
92 TString outFileName = gSystem->WorkingDirectory();
94 outFileName +=
"/all_";
95 Int_t pid = gSystem->GetPid();
97 outFileName +=
".par";
98 TString catCommand =
"cat ";
100 TListIter myIter(fnamelist);
101 while ((
string = static_cast<TObjString*>(myIter.Next()))) {
104 TString strParPath =
string->GetString();
105 gSystem->ExpandPathName(strParPath);
106 if (gSystem->AccessPathName(strParPath))
107 LOG(fatal) <<
"Parameter file " << strParPath <<
" does not exist.";
109 catCommand +=
string->GetString();
113 catCommand += outFileName;
117 gSystem->Exec(catCommand);
119 return open(outFileName, status);
140 cout <<
"Ascii I/O " <<
filename <<
" is open\n";
143 cout <<
"detector I/Os: ";
144 while ((io = static_cast<FairDetParIo*>(next()))) {
145 cout <<
" " << io->GetName();
149 cout <<
"No file open\n";
Bool_t open(const Text_t *fname, const Text_t *status="in")
void activateParIo(FairParIo *)
static FairRuntimeDb * instance(void)
ClassImp(FairEventBuilder)