first checkin of Claus' code with a few modifications
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / dNdEtaCorrection.h
CommitLineData
75ec0f41 1// ------------------------------------------------------
2//
3// Class to handle corrections for dN/dEta measurements
4//
5// ------------------------------------------------------
6//
7// TODO:
8// - add documentation
9// - add status: generate or use maps
10// - add functionality to set the bin sizes
11// - add histograms with errors (for error visualization)
12//
13
14#ifndef ROOT_TObject
15#include "TObject.h"
16#endif
17#ifndef ROOT_TFile
18#include "TFile.h"
19#endif
20#ifndef ROOT_TH2
21#include "TH2.h"
22#endif
23
24
25class dNdEtaCorrection : public TObject
26{
27protected:
28
29 TString fName;
30
31 TH2F* hEtaVsVtx_meas;
32 TH2F* hEtaVsVtx_gene;
33
34 TH2F* hEtaVsVtx_corr;
35 TH2F* hEtaVsVtx_ratio;
36
37public:
38 dNdEtaCorrection(Char_t* name="dndeta_correction");
39
40 void FillMeas(Float_t vtx, Float_t eta) {hEtaVsVtx_meas->Fill(vtx, eta);}
41 void FillGene(Float_t vtx, Float_t eta) {hEtaVsVtx_gene->Fill(vtx, eta);}
42
43 void Finish();
44
45 void SaveHistograms();
46 Bool_t LoadHistograms(Char_t* fileName, Char_t* dir = "dndeta_correction");
47 Bool_t LoadCorrection(Char_t* fileName, Char_t* dir = "dndeta_correction")
48 {return LoadHistograms(fileName, dir);}
49
50 void DrawHistograms();
51
52 void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
53
54 Float_t GetCorrection(Float_t vtx, Float_t eta)
55 {return hEtaVsVtx_corr->GetBinContent(hEtaVsVtx_corr->FindBin(vtx,eta));}
56
57 ClassDef(dNdEtaCorrection,0)
58};
59
60