]>
Commit | Line | Data |
---|---|---|
1e9dad92 | 1 | #ifndef ALICFVGRID_H |
2 | #define ALICFVGRID_H | |
3 | //--------------------------------------------------------------------// | |
4 | // // | |
5 | // AliCFGrid.cxx Class // | |
6 | // Just an interface to handle both AliCFGrid and AliCFGridSparse // | |
7 | // implementations // | |
8 | // // | |
9 | //--------------------------------------------------------------------// | |
10 | ||
11 | #include "AliCFFrame.h" | |
12 | ||
13 | class TCollection; | |
14 | class TH1D; | |
15 | class TH2D; | |
16 | class TH3D; | |
17 | ||
18 | class AliCFVGrid : public AliCFFrame | |
19 | { | |
20 | public: | |
21 | AliCFVGrid(); | |
22 | AliCFVGrid(const AliCFVGrid & c); | |
23 | AliCFVGrid(const Char_t* name,const Char_t* title); | |
24 | AliCFVGrid(const Char_t* name, const Char_t* title, const Int_t nVarIn, const Int_t* nBinIn, const Double_t *binLimitsIn=0); | |
25 | ||
26 | virtual ~AliCFVGrid(); | |
27 | AliCFVGrid& operator=(const AliCFVGrid& corr); | |
28 | ||
29 | //abstract stuff | |
30 | ||
31 | virtual void Fill(Double_t *var, Double_t weight=1.) = 0; | |
32 | ||
33 | virtual Float_t GetOverFlows(Int_t var) const = 0; | |
34 | virtual Float_t GetUnderFlows(Int_t var)const = 0; | |
1e9dad92 | 35 | virtual Float_t GetEntries()const = 0 ; |
36 | ||
37 | virtual Float_t GetElement(Int_t iel)const = 0; | |
38 | virtual Float_t GetElement(Int_t *bin)const = 0; | |
39 | virtual Float_t GetElement(Double_t *var)const = 0; | |
40 | virtual Float_t GetElementError(Int_t iel)const = 0; | |
41 | virtual Float_t GetElementError(Int_t *bin)const = 0; | |
42 | virtual Float_t GetElementError(Double_t *var)const = 0; | |
43 | ||
44 | virtual void SetElement(Int_t iel, Float_t val) = 0; | |
45 | virtual void SetElement(Int_t *bin, Float_t val) = 0; | |
46 | virtual void SetElement(Double_t *var, Float_t val) = 0; | |
47 | virtual void SetElementError(Int_t iel, Float_t val) = 0; | |
48 | virtual void SetElementError(Int_t *bin, Float_t val) = 0; | |
49 | virtual void SetElementError(Double_t *var, Float_t val) = 0; | |
50 | ||
51 | virtual TH1D* Project( Int_t ivar) const = 0; | |
52 | virtual TH2D* Project( Int_t ivar1, Int_t ivar2) const = 0; | |
53 | virtual TH3D* Project( Int_t ivar1, Int_t ivar2,Int_t ivar3) const = 0; | |
54 | virtual TH1D* Slice( Int_t ivar, Double_t *varMin, Double_t *varMax) const = 0; | |
55 | ||
56 | //basic operations | |
57 | virtual void SumW2()=0; | |
58 | virtual void Add(AliCFVGrid* aGrid, Double_t c=1.) = 0; | |
59 | virtual void Add(AliCFVGrid* aGrid1 ,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.) = 0; | |
60 | virtual void Multiply(AliCFVGrid* aGrid, Double_t c=1.) = 0; | |
61 | virtual void Multiply(AliCFVGrid* aGrid1,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.) = 0; | |
62 | virtual void Divide(AliCFVGrid* aGrid, Double_t c=1.) = 0; | |
63 | virtual void Divide(AliCFVGrid* aGrid1, AliCFVGrid* aGrid2, Double_t c1=1., Double_t c2=1.,Option_t *option=0) = 0; | |
7411edfd | 64 | virtual void Rebin(const Int_t* group) = 0; |
1e9dad92 | 65 | |
66 | ||
67 | ||
68 | //implemented in AliCFVGrid | |
69 | ||
318f64b1 | 70 | virtual void SetExcludeOffEntriesInProj(Bool_t in){fExclOffEntriesInProj=in;}; |
71 | virtual Bool_t GetExcludeOffEntriesInProj( ) const {return fExclOffEntriesInProj;}; | |
1e9dad92 | 72 | virtual void Scale(Int_t iel, Double_t *fact); |
73 | virtual void Scale(Int_t* bin, Double_t *fact); | |
74 | virtual void Scale(Double_t* var, Double_t *fact); | |
75 | virtual void Scale(Double_t *fact); // To normalize MC to int lumi, for ex. | |
76 | virtual Int_t GetEmptyBins()const; | |
77 | virtual Int_t CheckStats(Double_t thr) const; | |
78 | virtual Int_t GetSumW2()const {return fSumW2;}; | |
79 | virtual Int_t GetEmptyBins(Double_t *varMin,Double_t *varMax) const; | |
80 | virtual Double_t GetIntegral() const; | |
81 | virtual Double_t GetIntegral(Int_t *binMin,Int_t *binMax) const; | |
82 | virtual Double_t GetIntegral(Double_t *varMin,Double_t *varMax) const; | |
83 | virtual Long64_t Merge(TCollection* list); | |
84 | virtual void Copy(TObject& c) const; | |
85 | ||
86 | protected: | |
87 | ||
88 | Double_t GetSum(Int_t ivar, Int_t *binMin, Int_t* binMax) const; | |
89 | void GetScaledValues(Double_t *fact, Double_t *in, Double_t *out) const; | |
318f64b1 | 90 | Bool_t fExclOffEntriesInProj; // exclude under/overflows in |
91 | //'hidden dimensions' when performing projections, | |
92 | // default is kTRUE. please notice that | |
93 | // if you you use AliCFGrid instead of AliCFGridSparse, | |
94 | // only option kTRUE is actually available | |
1e9dad92 | 95 | Bool_t fSumW2;//flag to check if calculation of squared weights enabled |
96 | ||
318f64b1 | 97 | ClassDef(AliCFVGrid,2); |
1e9dad92 | 98 | }; |
99 | ||
100 | #endif | |
101 |