o) adding log tags to all files
[u/mrichter/AliRoot.git] / PWG0 / CorrectionMatrix2D.h
CommitLineData
dc740de4 1/* $Id$ */
2
ddec1c19 3#ifndef CORRECTIONMATRIX2D_H
4#define CORRECTIONMATRIX2D_H
5
6// ------------------------------------------------------
7//
b6d3306b 8// Class to handle 2d - corrections
ddec1c19 9//
10// ------------------------------------------------------
ddec1c19 11
b6d3306b 12#ifndef ROOT_TNamed
13#include "TNamed.h"
ddec1c19 14#endif
15#ifndef ROOT_TFile
16#include "TFile.h"
17#endif
18#ifndef ROOT_TH2
19#include "TH2.h"
20#endif
ddec1c19 21#ifndef ROOT_TError
22#include "TError.h"
23#endif
b6d3306b 24#ifndef ROOT_TCanvas
25#include "TCanvas.h"
26#endif
ddec1c19 27
b6d3306b 28class CorrectionMatrix2D : public TNamed
ddec1c19 29{
ddec1c19 30public:
b6d3306b 31 CorrectionMatrix2D(Char_t* name="CorrectionMatrix", Char_t* title="",
32 Int_t nBinX=10, Float_t Xmin=0., Float_t Xmax=10.,
33 Int_t nBinY=10, Float_t Ymin=0., Float_t Ymax=10.);
34
35 CorrectionMatrix2D(Char_t* name, Char_t* title,
36 Int_t nBinX, Float_t *X, Int_t nBinY, Float_t *Y);
ddec1c19 37
b6d3306b 38 virtual ~CorrectionMatrix2D();
ddec1c19 39
b6d3306b 40 TH2F* GetGeneratedHistogram() { return fhGene; }
41 TH2F* GetMeasuredHistogram() { return fhMeas; }
ddec1c19 42
b6d3306b 43 void SetGeneratedHistogram(TH2F* agene) { fhGene = agene; }
44 void SetMeasuredHistogram(TH2F* ameas) { fhMeas = ameas; }
ddec1c19 45
b6d3306b 46 void FillMeas(Float_t ax, Float_t ay) {fhMeas->Fill(ax,ay);}
47 void FillGene(Float_t ax, Float_t ay) {fhGene->Fill(ax,ay);}
ddec1c19 48
b6d3306b 49 void Finish();
50
51 void SetAxisTitles(Char_t* titleX="", Char_t* titleY="");
ddec1c19 52
53 void SaveHistograms();
54 void DrawHistograms();
55
56 Bool_t LoadHistograms(Char_t* fileName, Char_t* dir);
57 Bool_t LoadCorrection(Char_t* fileName, Char_t* dir) {return LoadHistograms(fileName, dir);}
58
59 void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
60
b6d3306b 61 Float_t GetCorrection(Float_t ax, Float_t ay) {return fhCorr->GetBinContent(fhCorr->FindBin(ax,ay));}
ddec1c19 62
b6d3306b 63protected:
64
65 TH2F* fhMeas;
66 TH2F* fhGene;
67
68 TH2F* fhCorr;
69 TH2F* fhRatio;
70
71
ddec1c19 72 ClassDef(CorrectionMatrix2D,0)
73};
74
75#endif
76