Protection aginst 0 returned by rndm as argument to log function
[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
45e97e28 18//
55e05544 19
20#include <TNamed.h>
55e05544 21
45e97e28 22#include <AliCorrectionMatrix2D.h>
23#include <AliCorrectionMatrix3D.h>
55e05544 24
25class AlidNdEtaCorrection : public TNamed
26{
55e05544 27public:
28 AlidNdEtaCorrection(Char_t* name="dndeta_correction");
29
45e97e28 30 // fVertexRecoCorrection
55e05544 31 void FillEvent(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillGene(vtx, n);}
32 void FillEventWithReconstructedVertex(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillMeas(vtx, n);}
55e05544 33
45e97e28 34 // fTrack2ParticleCorrection
35 void FillParticle(Float_t vtx, Float_t eta, Float_t pt) {fTrack2ParticleCorrection->FillGene(vtx, eta, pt);}
36 void FillParticleWhenMeasuredTrack(Float_t vtx, Float_t eta, Float_t pt) {fTrack2ParticleCorrection->FillMeas(vtx, eta, pt);}
55e05544 37
45e97e28 38 // fTriggerBiasCorrection
39 void FillParticleAllEvents(Float_t eta, Float_t pt) {fTriggerBiasCorrection->FillGene(eta, pt);}
40 void FillParticleWhenEventTriggered(Float_t eta, Float_t pt) {fTriggerBiasCorrection->FillMeas(eta, pt);}
41
42 void IncreaseEventCount() { fNEvents++; }
43 void IncreaseTriggeredEventCount() { fNTriggeredEvents++; }
44
45 void Finish();
46
47 AliCorrectionMatrix3D* GetTrack2ParticleCorrection() {return fTrack2ParticleCorrection;}
48 AliCorrectionMatrix2D* GetVertexRecoCorrection() {return fVertexRecoCorrection;}
49 AliCorrectionMatrix2D* GetTriggerBiasCorrection() {return fTriggerBiasCorrection;}
55e05544 50
51 virtual Long64_t Merge(TCollection* list);
52
53 void SaveHistograms();
54 Bool_t LoadHistograms(Char_t* fileName, Char_t* dir = "dndeta_correction");
55 Bool_t LoadCorrection(Char_t* fileName, Char_t* dir = "dndeta_correction")
56 {return LoadHistograms(fileName, dir);}
57
58 void DrawHistograms();
59
60 // void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
61
45e97e28 62 Float_t GetTrack2ParticleCorrection(Float_t vtx, Float_t eta, Float_t pt)
63 {return fTrack2ParticleCorrection->GetCorrection(vtx, eta, pt);}
55e05544 64
65 Float_t GetVertexRecoCorrection(Float_t vtx, Float_t n) {return fVertexRecoCorrection->GetCorrection(vtx, n);}
66
67 Float_t GetTriggerBiasCorrection(Float_t eta, Float_t pt=0) {return fTriggerBiasCorrection->GetCorrection(eta, pt);}
45e97e28 68
69protected:
70 AliCorrectionMatrix3D* fTrack2ParticleCorrection; // handles the track-to-particle correction, function of vtx_z, eta, pt
71 AliCorrectionMatrix2D* fVertexRecoCorrection; // handles the vertex reconstruction efficiency, function of n_clustersITS and vtx_z
72
73 AliCorrectionMatrix2D* fTriggerBiasCorrection; // MB to desired sample
74
75 Long64_t fNEvents;
76 Long64_t fNTriggeredEvents;
55e05544 77
78 ClassDef(AlidNdEtaCorrection,0)
79};
80
81#endif