new way of calculation Nsigma correction
[u/mrichter/AliRoot.git] / PWG0 / CorrectionMatrix2D.h
CommitLineData
1caed034 1// ------------------------------------------------------
2//
3// Class to handle 2d-corrections.
4//
5// ------------------------------------------------------
6//
7// TODO:
8//
9// - change the finish method (should not be called finish)
10// - add option in draw method
11//
1caed034 12
dc740de4 13/* $Id$ */
14
ddec1c19 15#ifndef CORRECTIONMATRIX2D_H
16#define CORRECTIONMATRIX2D_H
17
ddec1c19 18
ea2ef7cc 19#include <TNamed.h>
20#include <TH2.h>
21
22class TFile;
23class TCanvas;
24class AliLog;
ddec1c19 25
b6d3306b 26class CorrectionMatrix2D : public TNamed
ddec1c19 27{
ddec1c19 28public:
1caed034 29 CorrectionMatrix2D(const CorrectionMatrix2D& c);
fcf2fb36 30 CorrectionMatrix2D(Char_t* name, Char_t* title,
b6d3306b 31 Int_t nBinX=10, Float_t Xmin=0., Float_t Xmax=10.,
32 Int_t nBinY=10, Float_t Ymin=0., Float_t Ymax=10.);
33
34 CorrectionMatrix2D(Char_t* name, Char_t* title,
35 Int_t nBinX, Float_t *X, Int_t nBinY, Float_t *Y);
ddec1c19 36
b6d3306b 37 virtual ~CorrectionMatrix2D();
ddec1c19 38
1caed034 39 CorrectionMatrix2D& operator=(const CorrectionMatrix2D& corrMatrix);
40
41 virtual void Copy(TObject& c) const;
42
b6d3306b 43 TH2F* GetGeneratedHistogram() { return fhGene; }
44 TH2F* GetMeasuredHistogram() { return fhMeas; }
ddec1c19 45
a571621d 46 TH1F* Get1DCorrection(Char_t* opt="x");
47
b6d3306b 48 void SetGeneratedHistogram(TH2F* agene) { fhGene = agene; }
1caed034 49 void SetMeasuredHistogram(TH2F* ameas) { fhMeas = ameas; }
ddec1c19 50
b6d3306b 51 void FillMeas(Float_t ax, Float_t ay) {fhMeas->Fill(ax,ay);}
52 void FillGene(Float_t ax, Float_t ay) {fhGene->Fill(ax,ay);}
ea2ef7cc 53
54 void Divide();
55
56 virtual Long64_t Merge(TCollection* list);
57
b6d3306b 58 void SetAxisTitles(Char_t* titleX="", Char_t* titleY="");
ddec1c19 59
60 void SaveHistograms();
61 void DrawHistograms();
62
f2cb0edf 63 Bool_t LoadHistograms(Char_t* fileName, Char_t* dir = ".");
ddec1c19 64
a571621d 65 void RemoveEdges(Float_t cut=2, Int_t nBinsX=0, Int_t nBinsY=0);
ddec1c19 66
b6d3306b 67 Float_t GetCorrection(Float_t ax, Float_t ay) {return fhCorr->GetBinContent(fhCorr->FindBin(ax,ay));}
ddec1c19 68
b6d3306b 69protected:
70
1caed034 71 TH2F* fhMeas; // histogram of measured particles (or tracks)
72 TH2F* fhGene; // histogram of generated particles
b6d3306b 73
ea2ef7cc 74 TH2F* fhCorr; // correction histogram (ratio generated/measured)
b6d3306b 75
ea2ef7cc 76 ClassDef(CorrectionMatrix2D,1)
ddec1c19 77};
78
79#endif
80