* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
////////////////////////////////////////////////////////////////////////////
//
-// support class for the QA histogram viewer
-//
+// support classes for the QA histogram viewer
+//
// origin: Mikolaj Krzewicki, Nikhef, Mikolaj.Krzewicki@cern.ch
//
///////////////////////////////////////////////////////////////////////////
+#include <list>
+#include <string>
+#include <Riostream.h>
+#include <TSystem.h>
+#include <TH1.h>
+#include <TList.h>
+#include <TNamed.h>
+#include <TObjString.h>
+#include <TString.h>
+#include <TFile.h>
+#include <TPRegexp.h>
+#include <TKey.h>
#include "AliQAHistNavigator.h"
ClassImp(AliQAHistNavigator)
fExpertDirName("Expert"),
fPEmptyList(new TList())
{
+ //ctor
fPEmptyList->AddLast(new AliQADirListItem(""));
ReReadFiles();
}
//_________________________________________________________________________
AliQAHistNavigator::~AliQAHistNavigator()
{
+ //dtor
}
//_________________________________________________________________________
Bool_t AliQAHistNavigator::GetHistogram(TH1*& hist)
{
+ //get histogram from file
TString file = GetFileName();
TString dir = GetDirName();
TString histname = GetItemName();
//_________________________________________________________________________
Bool_t AliQAHistNavigator::Next()
{
+ //move to the next histogram
if (!fPCurrFile||!fPCurrDetector||!fPCurrLevel) return kFALSE;
if (!(fPCurrItem=(AliQADirListItem*)GetItemList()->After(fPCurrItem)))
{
//_________________________________________________________________________
Bool_t AliQAHistNavigator::Prev()
{
+ //move to the previous histrogram
if (!fPCurrLevel||!fPCurrDetector||!fPCurrFile) return kFALSE;
if (!(fPCurrItem=(AliQADirListItem*)GetItemList()->Before(fPCurrItem)))
{
if (fPFile) fPFile->Close();
if (!(fPFile->Open(GetFileName(),"READ")))
{
- return kFALSE;
cout<<"There is no file: "<<GetFileName()<<endl;
+ return kFALSE;
}
return kTRUE;
}
}
//_________________________________________________________________________
-TString AliQAHistNavigator::GetPath(AliQADirListItem* item)
+TString AliQAHistNavigator::GetPath(AliQADirListItem* const item)
{
//Get the full path to teh directory containing item
AliQADirList* d=item->GetParent();
delete fPListOfFiles;
fPListOfFiles = new AliQADirList();
- TString CORRFileName;
- TString QAResultFileName;
+ TString fileNameCORR;
+ TString fileNameQAResult;
TString macdir(".");
gSystem->ExpandPathName(macdir);
{
if (reCORR.Match(filename))
{
- CORRFileName = filename;
+ fileNameCORR = filename;
continue;
}
if (reQA.Match(filename))
{
- QAResultFileName = filename;
+ fileNameQAResult = filename;
continue;
}
if (reMerged.Match(filename))
names.push_back(filename);
}
}
- if (!fPCORRFile) fPCORRFile = new TFile(CORRFileName,"READ");
- if (!fPQAResultFile) fPQAResultFile = new TFile(QAResultFileName,"READ");
+ if (!fPCORRFile) fPCORRFile = new TFile(fileNameCORR,"READ");
+ if (!fPQAResultFile) fPQAResultFile = new TFile(fileNameQAResult,"READ");
if (names.empty())
{
printf("GetListOfFiles: no files matching...\n");
char fullName[1000];
for (std::list<string>::iterator si=names.begin(); si!=names.end(); ++si)
{
- sprintf(fullName,"%s", si->c_str());
+ snprintf(fullName,sizeof(fullName),"%s", si->c_str());
AliQADirList* f = new AliQADirList();
f->SetName(fullName);
fPListOfFiles->GetDirs()->AddLast(f);
//_________________________________________________________________________
Bool_t AliQAHistNavigator::Crawl(AliQADirList* dir)
{
+ //scans the current directory and puts result in dir
+ //returns false if dir in file empty
TString oldkeyname;
TString keyname;
- //scans the current directory and puts result in dir
TString pwd = gDirectory->GetPath();
- //returns false if dir in file empty
TList* keys = gDirectory->GetListOfKeys();
if (!keys) return kFALSE;
if (keys->GetEntries()==0) return kFALSE;
return kTRUE;
}
+//_________________________________________________________________________
//_________________________________________________________________________
ClassImp(AliQADirList)
//_________________________________________________________________________