]>
Commit | Line | Data |
---|---|---|
923f55ee | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | /////////////////////////////////////////////////////////////////////////////// | |
5 | // | |
6 | // (see AliQAHistNavigator.cxx for details) | |
7 | // | |
8 | // Origin: Mikolaj Krzewicki, Nikhef, Mikolaj.Krzewicki@cern.ch | |
9 | // | |
10 | ////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef ALIQAHISTNAVIGATOR_H | |
13 | #define ALIQAHISTNAVIGATOR_H | |
14 | ||
21535372 | 15 | #include <TNamed.h> |
16 | #include <TObjString.h> | |
17 | ||
18 | class TList; | |
19 | class TFile; | |
20 | class TString; | |
7d5ed7d8 | 21 | class TH1; |
d3a269ff | 22 | |
23 | class AliQADirList : public TNamed{ | |
24 | public: | |
25 | AliQADirList(); | |
26 | virtual ~AliQADirList(); | |
21535372 | 27 | TList* GetItems() const {return fPItems;} |
28 | TList* GetDirs() const {return fPDirs;} | |
29 | AliQADirList* GetParent() const {return fPParent;} | |
30 | void SetParent(AliQADirList* const l) {fPParent = l;} | |
d3a269ff | 31 | |
32 | private: | |
33 | AliQADirList* fPParent; //pointer to parent folder | |
34 | TList* fPItems; //List of items contained in the list | |
35 | TList* fPDirs; //List of dirs | |
36 | AliQADirList(const AliQADirList&); // Not implemented | |
37 | AliQADirList& operator=(const AliQADirList&); // Not implemented | |
38 | ||
39 | ClassDef(AliQADirList,999) //AliQADirListDir | |
40 | }; | |
41 | ||
21535372 | 42 | class AliQADirListItem : public TObjString{ |
d3a269ff | 43 | public: |
44 | AliQADirListItem(const char* s=""); | |
45 | virtual ~AliQADirListItem(); | |
46 | AliQADirList* GetParent() {return fPParent;} | |
21535372 | 47 | void SetParent(AliQADirList* const parent) {fPParent=parent;} |
d3a269ff | 48 | |
49 | private: | |
50 | AliQADirList* fPParent; | |
51 | AliQADirListItem(const AliQADirListItem&); // Not implemented | |
52 | AliQADirListItem& operator=(const AliQADirListItem&); // Not implemented | |
53 | ||
54 | ClassDef(AliQADirListItem,999) | |
55 | }; | |
56 | ||
923f55ee | 57 | class AliQAHistNavigator { |
58 | ||
59 | public: | |
d3a269ff | 60 | AliQAHistNavigator( Int_t run=0 ); |
61 | virtual ~AliQAHistNavigator(); | |
923f55ee | 62 | |
63 | Bool_t GetHistogram(TH1*& hist); | |
923f55ee | 64 | Bool_t Next(); |
65 | Bool_t Prev(); | |
923f55ee | 66 | |
67 | Bool_t SetFile (TString file ); | |
68 | Bool_t SetFile (Int_t file ); | |
69 | Bool_t SetDetector( TString detector ); | |
70 | Bool_t SetDetector( Int_t detector ); | |
71 | Bool_t SetLevel( TString type ); | |
72 | Bool_t SetLevel( Int_t type ); | |
d3a269ff | 73 | Bool_t SetItem( TString histo ); |
74 | Bool_t SetItem( Int_t histo ); | |
75 | ||
923f55ee | 76 | void SetLoopAllFiles( const Bool_t s=kTRUE ) {fLoopAllFiles=s;} |
77 | void SetLoopAllDetectors( const Bool_t s=kTRUE ) {fLoopAllDetectors=s;} | |
78 | void SetLoopAllLevels( const Bool_t s=kTRUE ) {fLoopAllLevels=s;} | |
d3a269ff | 79 | |
923f55ee | 80 | TString GetDetectorName(); |
81 | TString GetLevelName(); | |
d3a269ff | 82 | TString GetItemName(); |
923f55ee | 83 | TString GetFileName(); |
84 | TString GetDirName(); | |
21535372 | 85 | TString GetPath(AliQADirListItem* const item); |
d3a269ff | 86 | |
21535372 | 87 | AliQADirList* GetFileList() const {return fPListOfFiles;} |
88 | AliQADirList* GetDetectorList() const {return fPCurrFile;} | |
89 | AliQADirList* GetLevelList() const {return fPCurrDetector;} | |
d3a269ff | 90 | TList* GetItemList(); |
21535372 | 91 | AliQADirList* GetCurrListOfFiles() const {return fPListOfFiles;} |
92 | AliQADirList* GetCurrFile() const {return fPCurrFile;} | |
93 | AliQADirList* GetCurrDetector() const {return fPCurrDetector;} | |
94 | AliQADirList* GetCurrLevel() const {return fPCurrLevel;} | |
95 | AliQADirListItem* GetCurrItem() const {return fPCurrItem;} | |
d3a269ff | 96 | |
21535372 | 97 | Bool_t InitOK() const {return fInitOK;} |
7b852582 | 98 | Bool_t ReReadFiles(); |
d3a269ff | 99 | void SetExpertMode(Bool_t mode); |
923f55ee | 100 | |
101 | Bool_t CloneDirStructure(); | |
102 | ||
103 | private: | |
104 | ||
105 | Bool_t OpenCurrentFile(); | |
106 | Bool_t OpenCurrentDirectory(); | |
107 | Bool_t GetListOfFiles(); | |
d3a269ff | 108 | Bool_t Crawl(AliQADirList* parent); |
923f55ee | 109 | |
110 | TFile* fPFile; //pointer to current open file | |
d3a269ff | 111 | TFile* fPCORRFile; //pointer to file with ntuple |
112 | TFile* fPQAResultFile; //pointer to file with AliQA object | |
923f55ee | 113 | Int_t fRun; //runnumber |
923f55ee | 114 | |
115 | //The state of the navigator, these help navigate the "tree" | |
d3a269ff | 116 | AliQADirList* fPCurrFile; //current list holding detectors |
117 | AliQADirList* fPCurrDetector; //current list holding levels | |
118 | AliQADirList* fPCurrLevel; //current list holding histograms | |
119 | AliQADirListItem* fPCurrItem; //current histogram name | |
923f55ee | 120 | |
d3a269ff | 121 | AliQADirList* fPListOfFiles; //Tree-like structure of lists within lists mirroring the layout of histogtams in files |
923f55ee | 122 | |
123 | Bool_t fLoopAllFiles; //whether to loop over all files | |
124 | Bool_t fLoopAllDetectors; //whether to loop over all detectors | |
125 | Bool_t fLoopAllLevels; //whether to loop over all levels | |
7b852582 | 126 | |
127 | Bool_t fInitOK; //whether there is data to navigate | |
d3a269ff | 128 | Bool_t fExpertMode; //expert histogram mode |
129 | TString fExpertDirName; //expert dir name | |
21535372 | 130 | TList* fPEmptyList; //just an empty list |
d3a269ff | 131 | |
132 | AliQAHistNavigator(const AliQAHistNavigator&); // Not implemented | |
133 | AliQAHistNavigator& operator=(const AliQAHistNavigator&); // Not implemented | |
923f55ee | 134 | |
135 | ClassDef(AliQAHistNavigator,999) //AliQAHistNavigator class | |
136 | }; | |
137 | ||
138 | #endif | |
139 |