]>
Commit | Line | Data |
---|---|---|
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 | ||
15 | #include "TSystem.h" | |
16 | #include "Riostream.h" | |
17 | #include "TH1D.h" | |
18 | #include "TF1.h" | |
19 | #include "TList.h" | |
20 | #include "TObjString.h" | |
21 | #include "TString.h" | |
22 | #include "TFile.h" | |
23 | #include "TRegexp.h" | |
24 | #include "TPRegexp.h" | |
25 | #include "TKey.h" | |
26 | #include "TText.h" | |
27 | #include <list> | |
28 | #include <string> | |
29 | ||
30 | class AliQADirList; | |
31 | class AliQADirListItem; | |
32 | class AliQAHistNavigator; | |
33 | ||
34 | class AliQADirList : public TNamed{ | |
35 | public: | |
36 | AliQADirList(); | |
37 | virtual ~AliQADirList(); | |
38 | TList* GetItems() {return fPItems;} | |
39 | TList* GetDirs() {return fPDirs;} | |
40 | AliQADirList* GetParent() {return fPParent;} | |
41 | void SetParent(AliQADirList* l) {fPParent = l;} | |
42 | ||
43 | private: | |
44 | AliQADirList* fPParent; //pointer to parent folder | |
45 | TList* fPItems; //List of items contained in the list | |
46 | TList* fPDirs; //List of dirs | |
47 | AliQADirList(const AliQADirList&); // Not implemented | |
48 | AliQADirList& operator=(const AliQADirList&); // Not implemented | |
49 | ||
50 | ClassDef(AliQADirList,999) //AliQADirListDir | |
51 | }; | |
52 | ||
53 | class AliQADirListItem : public TObjString { | |
54 | public: | |
55 | AliQADirListItem(const char* s=""); | |
56 | virtual ~AliQADirListItem(); | |
57 | AliQADirList* GetParent() {return fPParent;} | |
58 | void SetParent(AliQADirList* parent) {fPParent=parent;} | |
59 | ||
60 | private: | |
61 | AliQADirList* fPParent; | |
62 | AliQADirListItem(const AliQADirListItem&); // Not implemented | |
63 | AliQADirListItem& operator=(const AliQADirListItem&); // Not implemented | |
64 | ||
65 | ClassDef(AliQADirListItem,999) | |
66 | }; | |
67 | ||
68 | class AliQAHistNavigator { | |
69 | ||
70 | public: | |
71 | AliQAHistNavigator( Int_t run=0 ); | |
72 | virtual ~AliQAHistNavigator(); | |
73 | ||
74 | Bool_t GetHistogram(TH1*& hist); | |
75 | Bool_t Next(); | |
76 | Bool_t Prev(); | |
77 | ||
78 | Bool_t SetFile (TString file ); | |
79 | Bool_t SetFile (Int_t file ); | |
80 | Bool_t SetDetector( TString detector ); | |
81 | Bool_t SetDetector( Int_t detector ); | |
82 | Bool_t SetLevel( TString type ); | |
83 | Bool_t SetLevel( Int_t type ); | |
84 | Bool_t SetItem( TString histo ); | |
85 | Bool_t SetItem( Int_t histo ); | |
86 | ||
87 | void SetLoopAllFiles( const Bool_t s=kTRUE ) {fLoopAllFiles=s;} | |
88 | void SetLoopAllDetectors( const Bool_t s=kTRUE ) {fLoopAllDetectors=s;} | |
89 | void SetLoopAllLevels( const Bool_t s=kTRUE ) {fLoopAllLevels=s;} | |
90 | ||
91 | TString GetDetectorName(); | |
92 | TString GetLevelName(); | |
93 | TString GetItemName(); | |
94 | TString GetFileName(); | |
95 | TString GetDirName(); | |
96 | TString GetPath(AliQADirListItem* item); | |
97 | ||
98 | AliQADirList* GetFileList() {return fPListOfFiles;} | |
99 | AliQADirList* GetDetectorList() {return fPCurrFile;} | |
100 | AliQADirList* GetLevelList() {return fPCurrDetector;} | |
101 | TList* GetItemList(); | |
102 | AliQADirList* GetCurrListOfFiles() {return fPListOfFiles;} | |
103 | AliQADirList* GetCurrFile() {return fPCurrFile;} | |
104 | AliQADirList* GetCurrDetector() {return fPCurrDetector;} | |
105 | AliQADirList* GetCurrLevel() {return fPCurrLevel;} | |
106 | AliQADirListItem* GetCurrItem() {return fPCurrItem;} | |
107 | ||
108 | Bool_t InitOK() {return fInitOK;} | |
109 | Bool_t ReReadFiles(); | |
110 | void SetExpertMode(Bool_t mode); | |
111 | ||
112 | Bool_t CloneDirStructure(); | |
113 | ||
114 | private: | |
115 | ||
116 | Bool_t OpenCurrentFile(); | |
117 | Bool_t OpenCurrentDirectory(); | |
118 | Bool_t GetListOfFiles(); | |
119 | Bool_t Crawl(AliQADirList* parent); | |
120 | ||
121 | TFile* fPFile; //pointer to current open file | |
122 | TFile* fPCORRFile; //pointer to file with ntuple | |
123 | TFile* fPQAResultFile; //pointer to file with AliQA object | |
124 | Int_t fRun; //runnumber | |
125 | ||
126 | //The state of the navigator, these help navigate the "tree" | |
127 | AliQADirList* fPCurrFile; //current list holding detectors | |
128 | AliQADirList* fPCurrDetector; //current list holding levels | |
129 | AliQADirList* fPCurrLevel; //current list holding histograms | |
130 | AliQADirListItem* fPCurrItem; //current histogram name | |
131 | ||
132 | AliQADirList* fPListOfFiles; //Tree-like structure of lists within lists mirroring the layout of histogtams in files | |
133 | ||
134 | Bool_t fLoopAllFiles; //whether to loop over all files | |
135 | Bool_t fLoopAllDetectors; //whether to loop over all detectors | |
136 | Bool_t fLoopAllLevels; //whether to loop over all levels | |
137 | ||
138 | Bool_t fInitOK; //whether there is data to navigate | |
139 | Bool_t fExpertMode; //expert histogram mode | |
140 | TString fExpertDirName; //expert dir name | |
141 | TList* fPEmptyList; | |
142 | ||
143 | AliQAHistNavigator(const AliQAHistNavigator&); // Not implemented | |
144 | AliQAHistNavigator& operator=(const AliQAHistNavigator&); // Not implemented | |
145 | ||
146 | ClassDef(AliQAHistNavigator,999) //AliQAHistNavigator class | |
147 | }; | |
148 | ||
149 | #endif | |
150 |