]>
Commit | Line | Data |
---|---|---|
4b4eb769 | 1 | #ifndef ALITPCDATADCS_H |
2 | #define ALITPCDATADCS_H | |
3 | ||
4 | #include <TMap.h> | |
5 | #include <TClonesArray.h> | |
6 | #include <TH2F.h> | |
7 | #include <TGraph.h> | |
8 | #include <TF1.h> | |
9 | ||
10 | // | |
11 | // This is an example of a container class | |
12 | // of the data retreieved from the DCS archive DB. | |
13 | // It is called by the detector's Preprocessor and | |
14 | // it is stored in the CDB. | |
15 | // | |
16 | ||
17 | class AliTPCDataDCS : public TObject { | |
18 | public: | |
19 | enum {kNAliases=6, kNHistos=3, kNGraphs=3, kNFunctions=2}; | |
20 | enum {kHvMin=0, kHvMax=500}; | |
21 | ||
22 | AliTPCDataDCS(); | |
23 | AliTPCDataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime); | |
24 | ~AliTPCDataDCS(); | |
25 | ||
26 | void SetRun(Int_t run) {fRun = run;} | |
27 | void SetStartTime(Int_t startTime) {fStartTime = startTime;} | |
28 | void SetEndTime(Int_t endTime) {fEndTime = endTime;} | |
29 | Int_t GetRun() {return fRun;} | |
30 | Int_t GetStartTime() {return fStartTime;} | |
31 | Int_t GetEndTime() {return fEndTime;} | |
32 | ||
33 | void ProcessData(TMap& aliasMap); | |
34 | ||
35 | const char* GetAliasName(UInt_t pos) | |
36 | {return pos<kNAliases ? fAliasNames[pos].Data() : 0;} | |
37 | const TH1F* GetHisto(UInt_t pos) | |
38 | {return pos<kNHistos ? fHv[pos] : 0;} | |
39 | ||
40 | Float_t GetMean(UInt_t pos) {return pos<kNHistos ? fMean[pos] : 0;} | |
41 | Float_t GetWidth(UInt_t pos) {return pos<kNHistos ? fWidth[pos] : 0;} | |
42 | ||
43 | const TGraph* GetGraph(UInt_t pos) | |
44 | {return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos)) : 0;} | |
45 | ||
46 | const TF1* GetFunction() {return fFunc;} | |
47 | ||
48 | Double_t Eval(int pos, Double_t time) | |
49 | {return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos))->Eval(time) : -1;} | |
50 | ||
51 | void Draw(const Option_t* option); | |
52 | ||
2bb7b766 | 53 | void Clean(); |
54 | ||
4b4eb769 | 55 | |
56 | private: | |
57 | void Init(); | |
58 | void Introduce(UInt_t numAlias, const TObjArray* aliasArr); | |
59 | void CreateGraph(int i, int dim, const Double_t *x, const Double_t *y); | |
60 | ||
61 | Int_t fRun; // run number | |
62 | UInt_t fStartTime; // run start time | |
63 | UInt_t fEndTime; // run end time | |
64 | ||
65 | Float_t fMean[kNHistos]; // array of histos' mean values | |
66 | Float_t fWidth[kNHistos]; // array of histos' widths | |
67 | ||
68 | TString fAliasNames[kNAliases]; // array of DCS alias names | |
69 | TH1F *fHv[kNHistos]; // array of histos | |
70 | TClonesArray fGraphs; // array of TGraphs | |
71 | TF1 *fFunc; // fit function | |
72 | ||
73 | Bool_t fIsProcessed; // End-of-process flag | |
74 | ||
75 | ClassDef(AliTPCDataDCS, 2); | |
76 | }; | |
77 | ||
78 | #endif |