Resolving circular dependency between libSTEERBase and libRAWDatabase (bug 45935)
[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
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;
c8df672e 54 virtual TH1D* Slice(Int_t ivar, Double_t* varMin, Double_t* varMax) const ;
55 virtual TH2D* Slice(Int_t ivar1, Int_t ivar2, Double_t *varMin, Double_t *varMax) const ;
56 virtual TH3D* Slice(Int_t ivar1, Int_t ivar2, Int_t ivar3, Double_t *varMin, Double_t *varMax) const ;
57 virtual void SetRangeUser(Double_t* varMin, Double_t* varMax) ;
db6722a5 58
59
60 //basic operations
61
62 virtual void SumW2();
63 virtual void Add(AliCFVGrid* aGrid, Double_t c=1.);
64 virtual void Add(AliCFVGrid* aGrid1 ,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
65 virtual void Multiply(AliCFVGrid* aGrid, Double_t c=1.);
66 virtual void Multiply(AliCFVGrid* aGrid1,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
67 virtual void Divide(AliCFVGrid* aGrid, Double_t c=1.);
68 virtual void Divide(AliCFVGrid* aGrid1, AliCFVGrid* aGrid2, Double_t c1=1., Double_t c2=1.,Option_t *option=0);
69
7411edfd 70 virtual void Rebin(const Int_t* group);
71
db6722a5 72 THnSparse *GetGrid() const {return fData;};// Getter for the data Container: a THnSparse
73
74 virtual void Copy(TObject& c) const;
75
76
77 protected:
78
db6722a5 79 THnSparse *fData;// The data Container: a THnSparse
318f64b1 80 ClassDef(AliCFGridSparse,2);
db6722a5 81};
82
83#endif
84