25 #include <Riostream.h>
30 #include <TObjString.h>
46 fPQAResultFile( NULL ),
49 fPCurrDetector( NULL ),
54 fLoopAllDetectors(kTRUE),
55 fLoopAllLevels(kTRUE),
58 fExpertDirName("Expert"),
59 fPEmptyList(new TList())
79 cout<<
"GetHistogram: "<<file<<
":"<<dir<<
"/"<<histname<<endl;
80 if (file==
""||dir==
""||histname==
"")
82 printf(
"GetItem: nothing to fetch...\n");
86 hist =
dynamic_cast<TH1*
>( gDirectory->FindKey(histname)->ReadObj() );
89 printf(
"GetItem: null pointer returned by gDirectory\n");
118 printf(
"----------------back at the beginning!\n");
119 }
else return kFALSE;
168 printf(
"----------------back at the end!\n");
169 }
else return kFALSE;
222 if (!gDirectory->cd(
GetDirName()))
return kFALSE;
231 if (!tmp)
return kFALSE;
244 printf(
"AliQAHistNavigator::SetFile(%i)\n",file);
246 if (!tmp)
return kFALSE;
261 if (!tmp)
return kFALSE;
273 printf(
"AliQAHistNavigator::SetDetector(%i)\n",det);
275 if (!tmp)
return kFALSE;
288 if (!tmp)
return kFALSE;
300 if (!tmp)
return kFALSE;
312 if (!tmp)
return kFALSE;
322 if (!tmp)
return kFALSE;
331 TList* itemlist=NULL;
335 if (expertlist) itemlist = expertlist->
GetItems();
386 path = d->GetName() +
path;
402 TString sep = (d->
GetParent()) ?
"/" :
":/" ;
403 path = d->GetName() + sep +
path;
424 TString fileNameCORR;
425 TString fileNameQAResult;
428 gSystem->ExpandPathName(macdir);
430 void* dirhandle = gSystem->OpenDirectory(macdir.Data());
433 const char* filename;
439 reg+= (
fRun==0) ?
"[0-9].*" : revstr.Data();
441 TPRegexp reHist(reg);
442 TPRegexp reMerged(
"Merged.QA.Data.[0-9]*.root");
443 TPRegexp reCORR(
"CORR.QA.[0-9]*.root");
444 TPRegexp reQA(
"QA.root");
445 std::list<string> names;
446 while((filename = gSystem->GetDirEntry(dirhandle)) != 0)
448 if (reCORR.Match(filename))
450 fileNameCORR = filename;
453 if (reQA.Match(filename))
455 fileNameQAResult = filename;
458 if (reMerged.Match(filename))
461 names.push_back(filename);
464 if (reHist.Match(filename))
466 names.push_back(filename);
473 printf(
"GetListOfFiles: no files matching...\n");
478 for (std::list<string>::iterator si=names.begin(); si!=names.end(); ++si)
480 snprintf(fullName,
sizeof(fullName),
"%s", si->c_str());
482 f->SetName(fullName);
488 gSystem->FreeDirectory(dirhandle);
504 TString filename = f->GetName();
505 TFile file(filename);
506 if (!
Crawl(f))
continue;
518 TString pwd = gDirectory->GetPath();
519 TList* keys = gDirectory->GetListOfKeys();
520 if (!keys)
return kFALSE;
521 if (keys->GetEntries()==0)
return kFALSE;
524 while ((key = dynamic_cast <TKey* > (keyiter.Next()) ))
526 keyname = key->GetName();
527 if (keyname==oldkeyname)
continue;
528 oldkeyname = keyname;
529 TString classname=key->GetClassName();
530 if (!classname)
return kFALSE;
531 if (classname==
"TDirectoryFile")
533 gDirectory->cd(key->GetName());
542 newdir->SetName(keyname);
544 dir->
GetDirs()->AddLast(newdir);
562 printf(
"AliQAHistNavigator::AliQAHistNavigator(): error reading files\n");
594 fPItems(new TList()),
Bool_t SetFile(TString file)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
ClassImp(AliQAHistNavigator) AliQAHistNavigator
AliQADirList * fPListOfFiles
Bool_t OpenCurrentDirectory()
Bool_t GetHistogram(TH1 *&hist)
AliQADirList * fPCurrLevel
TString GetDetectorName()
virtual ~AliQADirListItem()
TFile f("CalibObjects.root")
void SetExpertMode(Bool_t mode)
Bool_t Crawl(AliQADirList *parent)
AliQADirList * fPCurrFile
Bool_t SetItem(TString histo)
Bool_t SetLevel(TString type)
void SetParent(AliQADirList *const l)
Bool_t CloneDirStructure()
Bool_t SetDetector(TString detector)
AliQADirList * GetParent()
AliQADirList * fPCurrDetector
AliQADirListItem * fPCurrItem
virtual ~AliQAHistNavigator()
TString GetPath(AliQADirListItem *const item)
AliQADirList * GetParent() const
void SetParent(AliQADirList *const parent)