]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ACORDE/AliACORDEDataDCS.h
Optimisation
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEDataDCS.h
1 /****************************************************
2  AliACORDEDataDCS class
3         Pointer to the DCS objects
4  Author: Pedro Gonzalez (CIEMAT, Madrid)
5  Last updated: March 21 th 2010
6         Fixing coding violatgion
7         Mario Rodriguez (FCFM-BUAP, Puebla MX)
8
9 *****************************************************/
10 #ifndef AliACORDEDATADCS_H
11 #define AliACORDEDATADCS_H
12
13 #include <TClonesArray.h>
14 #include <TGraph.h>
15 #include <TMap.h>
16 class AliACORDEDataDCS : public TObject {
17 public:
18         enum {kNAliases=60, kNHistos=60, kNGraphs=60, kNFunctions=2};
19         enum {kHvMin=0, kHvMax=20};
20
21         AliACORDEDataDCS();
22         AliACORDEDataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime);
23         AliACORDEDataDCS(const AliACORDEDataDCS & data);
24         AliACORDEDataDCS& operator=(const AliACORDEDataDCS & data);
25
26         ~AliACORDEDataDCS();
27
28         void SetRun(Int_t run) {fRun = run;} 
29         void SetStartTime(Int_t startTime) {fStartTime = startTime;}
30         void SetEndTime(Int_t endTime) {fEndTime = endTime;}
31         Int_t GetRun() const {return fRun;}
32         Int_t GetStartTime() const {return fStartTime;}
33         Int_t GetEndTime() const {return fEndTime;}
34
35         void ProcessData(TMap& aliasMap);
36
37         const char* GetAliasName(UInt_t pos)
38                         {return pos<kNAliases ? fAliasNames[pos].Data() : 0;}
39         TH1F* GetHisto(UInt_t pos) const {return pos<kNHistos ? fHv[pos] : 0;}
40
41         Float_t GetMean(UInt_t pos) const {return pos<kNHistos ? fMean[pos] : 0;}
42         Float_t GetWidth(UInt_t pos) const {return pos<kNHistos ? fWidth[pos] : 0;}
43
44         const TGraph* GetGraph(UInt_t pos) {return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos)) : 0;}
45
46         const TF1* GetFunction() const {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
53
54 private:
55         void Init();
56         void Introduce(UInt_t numAlias, const TObjArray* aliasArr);
57         void CreateGraph(int i, int dim, const Double_t *x, const Double_t *y);
58
59         Int_t fRun; // # of Run
60         UInt_t fStartTime; // Start time of the Run
61         UInt_t fEndTime; // End time of the Run
62
63         Float_t fMean[kNHistos]; // Mean of hits distribution for ACORDE
64         Float_t fWidth[kNHistos]; // Width of the hits dist. for ACORDE
65
66         TString fAliasNames[kNAliases]; // Alias names for ACORDE Data Points
67         TH1F *fHv[kNHistos]; // High Voltage values
68         TClonesArray fGraphs; // Clones of plots for ACORDE
69         TF1 *fFunc; // Funtion for ACORDE DP
70
71         Bool_t fIsProcessed; // Boolean flag to know if the vent was processed
72
73         ClassDef(AliACORDEDataDCS, 1);
74 };
75
76 #endif