Added AlidNdEtaCorrection (new procedure).
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / AlidNdEtaCorrection.h
CommitLineData
55e05544 1/* $Id$ */
2
3#ifndef ALIDNDETACORRECTION_H
4#define ALIDNDETACORRECTION_H
5
6
7// ------------------------------------------------------
8//
9// Class to handle corrections for dN/dEta measurements
10//
11// ------------------------------------------------------
12//
13// TODO:
14// - make the ntrack to npart correction 3D
15// - add documentation
16// - add status: generate or use maps
17// - add functionality to set the bin sizes
18//
19
20#include <TNamed.h>
21#include <TFile.h>
22
23#include <CorrectionMatrix2D.h>
24
25
26class AlidNdEtaCorrection : public TNamed
27{
28protected:
29
30 CorrectionMatrix2D* fNtrackToNparticleCorrection; // handles the track-to-vertex correction
31 CorrectionMatrix2D* fVertexRecoCorrection; // handles the vertex reco (n tracks vs vtx)
32
33 CorrectionMatrix2D* fTriggerBiasCorrection; // MB to desired sample
34
35public:
36 AlidNdEtaCorrection(Char_t* name="dndeta_correction");
37
38 void FillEvent(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillGene(vtx, n);}
39 void FillEventWithReconstructedVertex(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillMeas(vtx, n);}
40
41 void FillParticle(Float_t vtx, Float_t eta, Float_t pt=0) {fNtrackToNparticleCorrection->FillGene(vtx, eta);}
42 void FillParticleWhenMeasuredTrack(Float_t vtx, Float_t eta, Float_t pt=0) {fNtrackToNparticleCorrection->FillMeas(vtx, eta);}
43
44 void FillParticleAllEvents(Float_t eta, Float_t pt=0) {fTriggerBiasCorrection->FillGene(eta, pt);}
45 void FillParticleWhenEventTriggered(Float_t eta, Float_t pt=0) {fTriggerBiasCorrection->FillMeas(eta, pt);}
46
47 void Finish(Int_t nEventsAll = 1, Int_t nEventsTriggered = 1);
48
49 CorrectionMatrix2D* GetNtrackToNpraticleCorrection() {return fNtrackToNparticleCorrection;}
50 CorrectionMatrix2D* GetVertexRecoCorrection() {return fVertexRecoCorrection;}
51 CorrectionMatrix2D* GetTriggerBiasCorrection() {return fTriggerBiasCorrection;}
52
53 virtual Long64_t Merge(TCollection* list);
54
55 void SaveHistograms();
56 Bool_t LoadHistograms(Char_t* fileName, Char_t* dir = "dndeta_correction");
57 Bool_t LoadCorrection(Char_t* fileName, Char_t* dir = "dndeta_correction")
58 {return LoadHistograms(fileName, dir);}
59
60 void DrawHistograms();
61
62 // void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
63
64 Float_t GetNtracksToNpartCorrection(Float_t vtx, Float_t eta, Float_t pt)
65 {return fNtrackToNparticleCorrection->GetCorrection(vtx, eta);}
66
67 Float_t GetVertexRecoCorrection(Float_t vtx, Float_t n) {return fVertexRecoCorrection->GetCorrection(vtx, n);}
68
69 Float_t GetTriggerBiasCorrection(Float_t eta, Float_t pt=0) {return fTriggerBiasCorrection->GetCorrection(eta, pt);}
70
71
72 ClassDef(AlidNdEtaCorrection,0)
73};
74
75#endif