further mods to include AliCFGridSparse, now included in compilation, and fixup for...
[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);
29 virtual void SetExcludeOffEntries(Bool_t in){fExcludeOffEntries=in;};
30 virtual Bool_t GetExcludeOffEntries( ) const {return fExcludeOffEntries;};
31
32 virtual void Fill(Double_t *var, Double_t weight=1.);
33
34 virtual Float_t GetOverFlows(Int_t var) const;
35 virtual Float_t GetUnderFlows(Int_t var)const;
36 virtual Float_t GetEntries()const;
37
38 virtual Float_t GetElement(Int_t iel)const;
39 virtual Float_t GetElement(Int_t *bin)const;
40 virtual Float_t GetElement(Double_t *var)const;
41
42 virtual Float_t GetElementError(Int_t iel)const;
43 virtual Float_t GetElementError(Int_t *bin)const;
44 virtual Float_t GetElementError(Double_t *var)const;
45
46 virtual void SetElement(Int_t iel, Float_t val);
47 virtual void SetElement(Int_t *bin, Float_t val);
48 virtual void SetElement(Double_t *var, Float_t val);
49 virtual void SetElementError(Int_t iel, Float_t val);
50 virtual void SetElementError(Int_t *bin, Float_t val) ;
51 virtual void SetElementError(Double_t *var, Float_t val);
52
53 virtual TH1D* Project( Int_t ivar) const;
54 virtual TH2D* Project( Int_t ivar1, Int_t ivar2) const;
55 virtual TH3D* Project( Int_t ivar1, Int_t ivar2,Int_t ivar3) const;
56 virtual TH1D* Slice( Int_t, Double_t *, Double_t *) const {AliInfo("Not yet implemented!"); return 0x0;};
57
58
59 //basic operations
60
61 virtual void SumW2();
62 virtual void Add(AliCFVGrid* aGrid, Double_t c=1.);
63 virtual void Add(AliCFVGrid* aGrid1 ,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
64 virtual void Multiply(AliCFVGrid* aGrid, Double_t c=1.);
65 virtual void Multiply(AliCFVGrid* aGrid1,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
66 virtual void Divide(AliCFVGrid* aGrid, Double_t c=1.);
67 virtual void Divide(AliCFVGrid* aGrid1, AliCFVGrid* aGrid2, Double_t c1=1., Double_t c2=1.,Option_t *option=0);
68
69 THnSparse *GetGrid() const {return fData;};// Getter for the data Container: a THnSparse
70
71 virtual void Copy(TObject& c) const;
72
73
74 protected:
75
76 Bool_t fExcludeOffEntries; // exclude under/overflows in 'hidden dimensions' when performing projections, default is kTRUE.
77 THnSparse *fData;// The data Container: a THnSparse
78 ClassDef(AliCFGridSparse,1);
79};
80
81#endif
82