Conserve the container axis ranges in Projection
[u/mrichter/AliRoot.git] / CORRFW / AliCFGrid.h
563113d0 1#ifndef ALICFGRID_H
2#define ALICFGRID_H
563113d0 4//--------------------------------------------------------------------//
5// //
6// AliCFGrid.cxx Class //
7// Class to handle N-dim maps for the correction Framework //
1e9dad92 8// The class uses a une-dimensional array of floats to store the grid //
563113d0 9// //
1e9dad92 12#include "AliCFVGrid.h"
c8df672e 13#include "AliLog.h"
563113d0 14
1e9dad92 15class TH1D;
16class TH2D;
17class TH3D;
563113d0 18
1e9dad92 19class AliCFGrid : public AliCFVGrid
563113d0 20{
21 public:
22 AliCFGrid();
23 AliCFGrid(const Char_t* name,const Char_t* title);
1e9dad92 24 AliCFGrid(const Char_t* name, const Char_t* title, const Int_t nVarIn, const Int_t* nBinIn, const Double_t *binLimitsIn=0);
563113d0 25 AliCFGrid(const AliCFGrid & c);
27 virtual ~AliCFGrid();
28 AliCFGrid& operator=(const AliCFGrid& corr);
1e9dad92 29
30 virtual void Fill(Double_t *var, Double_t weight=1.);
563113d0 32 virtual Float_t GetOverFlows(Int_t var) const;
33 virtual Float_t GetUnderFlows(Int_t var)const ;
563113d0 34 virtual Float_t GetEntries()const ;
1e9dad92 35
563113d0 36 virtual Float_t GetElement(Int_t iel)const;
37 virtual Float_t GetElement(Int_t *bin)const;
1e9dad92 38 virtual Float_t GetElement(Double_t *var)const;
563113d0 39 virtual Float_t GetElementError(Int_t iel)const;
40 virtual Float_t GetElementError(Int_t *bin)const;
1e9dad92 41 virtual Float_t GetElementError(Double_t *var)const;
563113d0 42 virtual void SetElement(Int_t iel, Float_t val);
43 virtual void SetElement(Int_t *bin, Float_t val);
1e9dad92 44 virtual void SetElement(Double_t *var, Float_t val);
563113d0 45 virtual void SetElementError(Int_t iel, Float_t val);
46 virtual void SetElementError(Int_t *bin, Float_t val);
1e9dad92 47 virtual void SetElementError(Double_t *var, Float_t val);
9105291d 49 virtual TH1D* Project( Int_t ivar) const;
50 virtual TH2D* Project( Int_t ivar1, Int_t ivar2) const;
51 virtual TH3D* Project( Int_t ivar1, Int_t ivar2,Int_t ivar3) const;
52 virtual AliCFGrid* Project( Int_t /*nVars*/, Int_t* /*vars*/, Double_t* /*varMin*/, Double_t* /*varMax*/) const
53 {AliWarning("not implemented"); return 0x0;}
1e9dad92 54 virtual TH1D* Slice( Int_t ivar, Double_t *varMin, Double_t *varMax) const;
c8df672e 55 virtual TH2D* Slice( Int_t /*ivar1*/, Int_t /*ivar2*/, Double_t */*varMin*/, Double_t */*varMax*/) const
56 {AliWarning("not implemented"); return 0x0;}
57 virtual TH3D* Slice( Int_t /*ivar1*/, Int_t /*ivar2*/, Int_t /*ivar3*/, Double_t */*varMin*/, Double_t */*varMax*/) const
58 {AliWarning("not implemented"); return 0x0;}
563113d0 59
9105291d 60 virtual void UseAxisRange(Bool_t b) const {AliWarning("Not implemented because this class is obsolete");}
563113d0 62 //basic operations
64 virtual void SumW2();
65 virtual void Copy(TObject& c) const;
1e9dad92 66 virtual void Add(AliCFVGrid* aGrid, Double_t c=1.);
67 virtual void Add(AliCFVGrid* aGrid1 ,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
68 virtual void Multiply(AliCFVGrid* aGrid, Double_t c=1.);
69 virtual void Multiply(AliCFVGrid* aGrid1,AliCFVGrid* aGrid2, Double_t c1=1.,Double_t c2=1.);
70 virtual void Divide(AliCFVGrid* aGrid, Double_t c=1.);
71 virtual void Divide(AliCFVGrid* aGrid1, AliCFVGrid* aGrid2, Double_t c1=1., Double_t c2=1.,Option_t *option=0);
563113d0 72
7411edfd 73 void Rebin(const Int_t* group);
563113d0 75
76 protected:
1e9dad92 77
563113d0 78 Float_t fNentriesTot;//Total number of entries
79 Float_t *fNunfl;//[fNVar] underflows in each dimension
80 Float_t *fNovfl;//[fNVar] overflows in each dimension
563113d0 81 Float_t *fData;//[fNDim] The data Container
82 Float_t *fErr2;//[fNDim] The squared weights Container (only with SumW2)
db6722a5 85 ClassDef(AliCFGrid,4);
563113d0 86};