extended by cuts on min / max absolute and relative impact parameter
[u/mrichter/AliRoot.git] / CORRFW / AliCFVGrid.h
CommitLineData
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
13class TCollection;
14class TH1D;
15class TH2D;
16class TH3D;
17
18class 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
9105291d 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 AliCFVGrid* Project( Int_t nVars, Int_t* vars, Double_t* varMin, Double_t* varMax) const = 0;
c8df672e 55 virtual TH1D* Slice(Int_t ivar, Double_t *varMin, Double_t *varMax) const = 0;
56 virtual TH2D* Slice(Int_t ivar1, Int_t ivar2, Double_t *varMin, Double_t *varMax) const = 0;
57 virtual TH3D* Slice(Int_t ivar1, Int_t ivar2, Int_t ivar3, Double_t *varMin, Double_t *varMax) const = 0;
1e9dad92 58
9105291d 59 virtual void UseAxisRange(Bool_t b) const = 0 ;
60
1e9dad92 61 //basic operations
62 virtual void SumW2()=0;
63 virtual void Add(AliCFVGrid* aGrid, Double_t c=1.) = 0;
64 virtual void Add(AliCFVGrid* aGrid1 ,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.) = 0;
65 virtual void Multiply(AliCFVGrid* aGrid, Double_t c=1.) = 0;
66 virtual void Multiply(AliCFVGrid* aGrid1,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.) = 0;
67 virtual void Divide(AliCFVGrid* aGrid, Double_t c=1.) = 0;
68 virtual void Divide(AliCFVGrid* aGrid1, AliCFVGrid* aGrid2, Double_t c1=1., Double_t c2=1.,Option_t *option=0) = 0;
7411edfd 69 virtual void Rebin(const Int_t* group) = 0;
1e9dad92 70
71
72
73 //implemented in AliCFVGrid
74
75 virtual void Scale(Int_t iel, Double_t *fact);
76 virtual void Scale(Int_t* bin, Double_t *fact);
77 virtual void Scale(Double_t* var, Double_t *fact);
78 virtual void Scale(Double_t *fact); // To normalize MC to int lumi, for ex.
79 virtual Int_t GetEmptyBins()const;
80 virtual Int_t CheckStats(Double_t thr) const;
81 virtual Int_t GetSumW2()const {return fSumW2;};
82 virtual Int_t GetEmptyBins(Double_t *varMin,Double_t *varMax) const;
83 virtual Double_t GetIntegral() const;
84 virtual Double_t GetIntegral(Int_t *binMin,Int_t *binMax) const;
85 virtual Double_t GetIntegral(Double_t *varMin,Double_t *varMax) const;
86 virtual Long64_t Merge(TCollection* list);
87 virtual void Copy(TObject& c) const;
88
89 protected:
90
91 Double_t GetSum(Int_t ivar, Int_t *binMin, Int_t* binMax) const;
92 void GetScaledValues(Double_t *fact, Double_t *in, Double_t *out) const;
318f64b1 93 //'hidden dimensions' when performing projections,
94 // default is kTRUE. please notice that
95 // if you you use AliCFGrid instead of AliCFGridSparse,
96 // only option kTRUE is actually available
1e9dad92 97 Bool_t fSumW2;//flag to check if calculation of squared weights enabled
98
9105291d 99 ClassDef(AliCFVGrid,3);
1e9dad92 100};
101
102#endif
103