TH2 histograms (Energy vs Time): Number of energy bins reduced.
[u/mrichter/AliRoot.git] / CORRFW / AliCFGridSparse.h
CommitLineData
db6722a5 1#ifndef ALICFGRIDSPARSE_H
2#define ALICFGRIDSPARSE_H
3//--------------------------------------------------------------------//
4// //
5// AliCFGridSparse.cxx Class //
6// Class to handle N-dim maps for the correction Framework //
7// uses a THnSparse to store the grid //
8// Author:S.Arcelli, silvia.arcelli@cern.ch
9//--------------------------------------------------------------------//
10
11#include "AliCFVGrid.h"
12#include "THnSparse.h"
13#include "AliLog.h"
14class TH1D;
15class TH2D;
16class TH3D;
17
18class AliCFGridSparse : public AliCFVGrid
19{
20 public:
21 AliCFGridSparse();
22 AliCFGridSparse(const Char_t* name,const Char_t* title);
23 AliCFGridSparse(const Char_t* name, const Char_t* title, const Int_t nVarIn, const Int_t* nBinIn, const Double_t *binLimitsIn=0);
24 AliCFGridSparse(const AliCFGridSparse & c);
25
26 virtual ~AliCFGridSparse();
27 AliCFGridSparse& operator=(const AliCFGridSparse& corr) ;
28 virtual void SetBinLimits(Int_t ivar, Double_t * array);
db6722a5 29
30 virtual void Fill(Double_t *var, Double_t weight=1.);
31
32 virtual Float_t GetOverFlows(Int_t var) const;
33 virtual Float_t GetUnderFlows(Int_t var)const;
34 virtual Float_t GetEntries()const;
35
36 virtual Float_t GetElement(Int_t iel)const;
37 virtual Float_t GetElement(Int_t *bin)const;
38 virtual Float_t GetElement(Double_t *var)const;
39
40 virtual Float_t GetElementError(Int_t iel)const;
41 virtual Float_t GetElementError(Int_t *bin)const;
42 virtual Float_t GetElementError(Double_t *var)const;
43
44 virtual void SetElement(Int_t iel, Float_t val);
45 virtual void SetElement(Int_t *bin, Float_t val);
46 virtual void SetElement(Double_t *var, Float_t val);
47 virtual void SetElementError(Int_t iel, Float_t val);
48 virtual void SetElementError(Int_t *bin, Float_t val) ;
49 virtual void SetElementError(Double_t *var, Float_t val);
50
9105291d 51 virtual TH1D* Project( Int_t ivar) const;
52 virtual TH2D* Project( Int_t ivar1, Int_t ivar2) const;
53 virtual TH3D* Project( Int_t ivar1, Int_t ivar2,Int_t ivar3) const;
54 virtual AliCFGridSparse* Project(Int_t nVars, Int_t* vars, Double_t* varMin, Double_t* varMax) const ;
c8df672e 55 virtual TH1D* Slice(Int_t ivar, Double_t* varMin, Double_t* varMax) const ;
56 virtual TH2D* Slice(Int_t ivar1, Int_t ivar2, Double_t *varMin, Double_t *varMax) const ;
57 virtual TH3D* Slice(Int_t ivar1, Int_t ivar2, Int_t ivar3, Double_t *varMin, Double_t *varMax) const ;
9105291d 58 virtual void SetRangeUser(Int_t iVar, Double_t varMin, Double_t varMax) ;
c8df672e 59 virtual void SetRangeUser(Double_t* varMin, Double_t* varMax) ;
db6722a5 60
9105291d 61 virtual void UseAxisRange(Bool_t b) const ;
db6722a5 62
63 //basic operations
64
65 virtual void SumW2();
9be0fa4e 66 virtual void Add(const AliCFVGrid* aGrid, Double_t c=1.);
67 virtual void Add(const AliCFVGrid* aGrid1 ,const AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
68 virtual void Multiply(const AliCFVGrid* aGrid, Double_t c=1.);
69 virtual void Multiply(const AliCFVGrid* aGrid1,const AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
70 virtual void Divide(const AliCFVGrid* aGrid, Double_t c=1.);
71 virtual void Divide(const AliCFVGrid* aGrid1, const AliCFVGrid* aGrid2, Double_t c1=1., Double_t c2=1.,Option_t *option=0);
db6722a5 72
7411edfd 73 virtual void Rebin(const Int_t* group);
9105291d 74 virtual void SetGrid(THnSparse* grid) {fData=grid;}
75 THnSparse *GetGrid() const {return fData;};// Getter for the data Container: a THnSparse
db6722a5 76
77 virtual void Copy(TObject& c) const;
78
79
80 protected:
81
db6722a5 82 THnSparse *fData;// The data Container: a THnSparse
318f64b1 83 ClassDef(AliCFGridSparse,2);
db6722a5 84};
85
86#endif
87