99 void bfcread_hist_files_add(
101 const Char_t *fileName=
"fileList.txt",
102 const Char_t *outHistFile=
"kathy",
103 const Char_t *TopDirTree=
"bfcTree")
105 cout <<
"bfcread_hist_files_add.C, input file list = "
107 cout <<
"bfcread_hist_files_add.C, output file list = "
108 << outHistFile << endl;
109 cout <<
"bfcread_hist_files_add.C, top level directory in hist file = "
110 << TopDirTree << endl;
112 gSystem->Load(
"St_base");
113 gSystem->Load(
"StChain");
114 gSystem->Load(
"StIOMaker");
115 gSystem->Load(
"StarClassLibrary");
116 gSystem->Load(
"StUtilities");
117 gSystem->Load(
"StAnalysisUtilities");
118 gSystem->Load(
"libglobal_Tables");
119 gSystem->Load(
"libStDb_Tables");
120 gSystem->Load(
"StDetectorDbMaker");
121 gSystem->Load(
"libStDb_Tables.so");
122 gSystem->Load(
"StBichsel");
123 gSystem->Load(
"StEvent");
124 gSystem->Load(
"StTpcDb");
125 gSystem->Load(
"StPmdUtil");
126 gSystem->Load(
"St_QA_Maker");
127 gSystem->Load(
"StTreeMaker");
130 char **fList =
new char[8192][256];
131 ifstream fin(fileName);
134 cout <<
"Input file " << fileName <<
" found." << endl;
135 for (Int_t i=0;i<nevents;i++){
136 char *line =
new char[256];
138 if (fin.eof())
break;
140 cout <<
" Added file : " << fList[j] << endl;
148 char *MakerHistDir=
new char[256];
153 treeMk->SetBranch(
"histBranch");
162 nevents = TMath::Min(nevents,fff->GetNFiles());
164 IOMk->SetIOMode(
"r");
165 IOMk->SetBranch(
"*",0,
"0");
166 IOMk->SetBranch(
"histBranch",0,
"r");
176 EventLoop:
if (ifl<nevents && istat==0) {
178 cout <<
"\nNow processing file : " << ifl+1 <<
"\n" << endl;
183 istat = IOMk->Open();
184 if (istat)
goto EventLoop;
185 istat = IOMk->Make();
186 if (istat)
goto EventLoop;
188 Event = IOMk->GetDataSet(
"hist");
190 cout <<
" No histogram branch found in file!" << endl;
198 dirList = (TList *) histContainer->
GetObject();
199 strcpy(MakerHistDir,histContainer->GetName());
200 MakerHistDir[strlen(MakerHistDir)-4] = 0;
205 cout <<
"\n --- MakerHistDir : " << MakerHistDir << endl;
209 for (
int l=0; l<nbranch; l++) {
210 if (!strcmp(MakerHistDir,HM[l]->
GetName())) {
221 HU[bnum]->SetPntrToMaker(IOMk);
224 dirList = HU[bnum]->FindHists(MakerHistDir);
227 hCCount = HU[bnum]->CopyHists(dirList);
229 cout <<
"bfcread_hist_files_add.C, # histograms copied = " <<
235 dirList = HU[bnum]->FindHists(MakerHistDir);
238 hCCount = HU[bnum]->AddHists(dirList);
240 cout <<
"bfcread_hist_files_add.C, # histograms added = " <<
246 HM[bnum]->SetHArraySize(HU[bnum]->getNewHistSize());
247 HM[bnum]->SetHArray(HU[bnum]->getNewHist());
262 istat = IOMk->Close();
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual TDataSet * Next() const
virtual const char * GetName() const
special overload
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)