]>
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 | ||
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 | ||
d3a269ff | 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 | ||
923f55ee | 68 | class AliQAHistNavigator { |
69 | ||
70 | public: | |
d3a269ff | 71 | AliQAHistNavigator( Int_t run=0 ); |
72 | virtual ~AliQAHistNavigator(); | |
923f55ee | 73 | |
74 | Bool_t GetHistogram(TH1*& hist); | |
923f55ee | 75 | Bool_t Next(); |
76 | Bool_t Prev(); | |
923f55ee | 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 ); | |
d3a269ff | 84 | Bool_t SetItem( TString histo ); |
85 | Bool_t SetItem( Int_t histo ); | |
86 | ||
923f55ee | 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;} | |
d3a269ff | 90 | |
923f55ee | 91 | TString GetDetectorName(); |
92 | TString GetLevelName(); | |
d3a269ff | 93 | TString GetItemName(); |
923f55ee | 94 | TString GetFileName(); |
95 | TString GetDirName(); | |
d3a269ff | 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 | ||
7b852582 | 108 | Bool_t InitOK() {return fInitOK;} |
109 | Bool_t ReReadFiles(); | |
d3a269ff | 110 | void SetExpertMode(Bool_t mode); |
923f55ee | 111 | |
112 | Bool_t CloneDirStructure(); | |
113 | ||
114 | private: | |
115 | ||
116 | Bool_t OpenCurrentFile(); | |
117 | Bool_t OpenCurrentDirectory(); | |
118 | Bool_t GetListOfFiles(); | |
d3a269ff | 119 | Bool_t Crawl(AliQADirList* parent); |
923f55ee | 120 | |
121 | TFile* fPFile; //pointer to current open file | |
d3a269ff | 122 | TFile* fPCORRFile; //pointer to file with ntuple |
123 | TFile* fPQAResultFile; //pointer to file with AliQA object | |
923f55ee | 124 | Int_t fRun; //runnumber |
923f55ee | 125 | |
126 | //The state of the navigator, these help navigate the "tree" | |
d3a269ff | 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 | |
923f55ee | 131 | |
d3a269ff | 132 | AliQADirList* fPListOfFiles; //Tree-like structure of lists within lists mirroring the layout of histogtams in files |
923f55ee | 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 | |
7b852582 | 137 | |
138 | Bool_t fInitOK; //whether there is data to navigate | |
d3a269ff | 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 | |
923f55ee | 145 | |
146 | ClassDef(AliQAHistNavigator,999) //AliQAHistNavigator class | |
147 | }; | |
148 | ||
149 | #endif | |
150 |