Script to convert raw format to root format (Marian)
[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
1afae8ff 18// - update MERge function
45e97e28 19//
55e05544 20
21#include <TNamed.h>
55e05544 22
45e97e28 23#include <AliCorrectionMatrix2D.h>
24#include <AliCorrectionMatrix3D.h>
55e05544 25
26class AlidNdEtaCorrection : public TNamed
27{
55e05544 28public:
29 AlidNdEtaCorrection(Char_t* name="dndeta_correction");
30
1afae8ff 31 // fVertexRecoCorrection, fTriggerCorrection
32 void FillEvent(Float_t vtx, Float_t n) {fTriggerCorrection->FillGene(vtx, n);}
33 void FillEventWithTrigger(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillGene(vtx, n); fTriggerCorrection->FillMeas(vtx, n);}
34 void FillEventWithTriggerWithReconstructedVertex(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillMeas(vtx, n);}
55e05544 35
45e97e28 36 // fTrack2ParticleCorrection
37 void FillParticle(Float_t vtx, Float_t eta, Float_t pt) {fTrack2ParticleCorrection->FillGene(vtx, eta, pt);}
38 void FillParticleWhenMeasuredTrack(Float_t vtx, Float_t eta, Float_t pt) {fTrack2ParticleCorrection->FillMeas(vtx, eta, pt);}
55e05544 39
45e97e28 40 // fTriggerBiasCorrection
41 void FillParticleAllEvents(Float_t eta, Float_t pt) {fTriggerBiasCorrection->FillGene(eta, pt);}
42 void FillParticleWhenEventTriggered(Float_t eta, Float_t pt) {fTriggerBiasCorrection->FillMeas(eta, pt);}
43
44 void IncreaseEventCount() { fNEvents++; }
45 void IncreaseTriggeredEventCount() { fNTriggeredEvents++; }
46
47 void Finish();
48
49 AliCorrectionMatrix3D* GetTrack2ParticleCorrection() {return fTrack2ParticleCorrection;}
50 AliCorrectionMatrix2D* GetVertexRecoCorrection() {return fVertexRecoCorrection;}
51 AliCorrectionMatrix2D* GetTriggerBiasCorrection() {return fTriggerBiasCorrection;}
55e05544 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
45e97e28 64 Float_t GetTrack2ParticleCorrection(Float_t vtx, Float_t eta, Float_t pt)
65 {return fTrack2ParticleCorrection->GetCorrection(vtx, eta, pt);}
847489f7 66
55e05544 67 Float_t GetVertexRecoCorrection(Float_t vtx, Float_t n) {return fVertexRecoCorrection->GetCorrection(vtx, n);}
68
1afae8ff 69 Float_t GetTriggerCorrection(Float_t vtx, Float_t n) {return fTriggerCorrection->GetCorrection(vtx, n);}
70
55e05544 71 Float_t GetTriggerBiasCorrection(Float_t eta, Float_t pt=0) {return fTriggerBiasCorrection->GetCorrection(eta, pt);}
45e97e28 72
847489f7 73 Float_t GetMeasuredFraction(Float_t ptCutOff, Float_t eta = -1, Bool_t debug = kFALSE);
74
45e97e28 75protected:
76 AliCorrectionMatrix3D* fTrack2ParticleCorrection; // handles the track-to-particle correction, function of vtx_z, eta, pt
77 AliCorrectionMatrix2D* fVertexRecoCorrection; // handles the vertex reconstruction efficiency, function of n_clustersITS and vtx_z
1afae8ff 78 AliCorrectionMatrix2D* fTriggerCorrection; // handles the trigger efficiency efficiency, function of n_clustersITS and vtx_z
45e97e28 79
80 AliCorrectionMatrix2D* fTriggerBiasCorrection; // MB to desired sample
81
82 Long64_t fNEvents;
83 Long64_t fNTriggeredEvents;
55e05544 84
85 ClassDef(AlidNdEtaCorrection,0)
86};
87
88#endif