enhanced storing of last sucessfully processed run (alberto)
[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:
8b3563f4 29 AlidNdEtaCorrection();
30 AlidNdEtaCorrection(const Char_t* name, const Char_t* title);
55e05544 31
1afae8ff 32 // fVertexRecoCorrection, fTriggerCorrection
33 void FillEvent(Float_t vtx, Float_t n) {fTriggerCorrection->FillGene(vtx, n);}
34 void FillEventWithTrigger(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillGene(vtx, n); fTriggerCorrection->FillMeas(vtx, n);}
35 void FillEventWithTriggerWithReconstructedVertex(Float_t vtx, Float_t n) {fVertexRecoCorrection->FillMeas(vtx, n);}
55e05544 36
45e97e28 37 // fTrack2ParticleCorrection
38 void FillParticle(Float_t vtx, Float_t eta, Float_t pt) {fTrack2ParticleCorrection->FillGene(vtx, eta, pt);}
39 void FillParticleWhenMeasuredTrack(Float_t vtx, Float_t eta, Float_t pt) {fTrack2ParticleCorrection->FillMeas(vtx, eta, pt);}
55e05544 40
45e97e28 41 // fTriggerBiasCorrection
42 void FillParticleAllEvents(Float_t eta, Float_t pt) {fTriggerBiasCorrection->FillGene(eta, pt);}
43 void FillParticleWhenEventTriggered(Float_t eta, Float_t pt) {fTriggerBiasCorrection->FillMeas(eta, pt);}
44
45 void IncreaseEventCount() { fNEvents++; }
46 void IncreaseTriggeredEventCount() { fNTriggeredEvents++; }
47
48 void Finish();
49
50 AliCorrectionMatrix3D* GetTrack2ParticleCorrection() {return fTrack2ParticleCorrection;}
51 AliCorrectionMatrix2D* GetVertexRecoCorrection() {return fVertexRecoCorrection;}
52 AliCorrectionMatrix2D* GetTriggerBiasCorrection() {return fTriggerBiasCorrection;}
55e05544 53
54 virtual Long64_t Merge(TCollection* list);
55
56 void SaveHistograms();
57 Bool_t LoadHistograms(Char_t* fileName, Char_t* dir = "dndeta_correction");
8b3563f4 58 Bool_t LoadCorrection(Char_t* fileName, Char_t* dir = "dndeta_correction")
55e05544 59 {return LoadHistograms(fileName, dir);}
60
61 void DrawHistograms();
62
63 // void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
64
45e97e28 65 Float_t GetTrack2ParticleCorrection(Float_t vtx, Float_t eta, Float_t pt)
66 {return fTrack2ParticleCorrection->GetCorrection(vtx, eta, pt);}
847489f7 67
55e05544 68 Float_t GetVertexRecoCorrection(Float_t vtx, Float_t n) {return fVertexRecoCorrection->GetCorrection(vtx, n);}
69
1afae8ff 70 Float_t GetTriggerCorrection(Float_t vtx, Float_t n) {return fTriggerCorrection->GetCorrection(vtx, n);}
71
55e05544 72 Float_t GetTriggerBiasCorrection(Float_t eta, Float_t pt=0) {return fTriggerBiasCorrection->GetCorrection(eta, pt);}
45e97e28 73
847489f7 74 Float_t GetMeasuredFraction(Float_t ptCutOff, Float_t eta = -1, Bool_t debug = kFALSE);
75
8b3563f4 76 void SetNEvents(Long64_t events) { fNEvents = events; }
77
45e97e28 78protected:
8b3563f4 79 AliCorrectionMatrix3D* fTrack2ParticleCorrection; //-> handles the track-to-particle correction, function of vtx_z, eta, pt
80 AliCorrectionMatrix2D* fVertexRecoCorrection; //-> handles the vertex reconstruction efficiency, function of n_clustersITS and vtx_z
406eb63e 81 AliCorrectionMatrix2D* fTriggerCorrection; //-> handles the trigger efficiency, function of n_clustersITS and vtx_z
45e97e28 82
8b3563f4 83 AliCorrectionMatrix2D* fTriggerBiasCorrection; //-> MB to desired sample
45e97e28 84
85 Long64_t fNEvents;
86 Long64_t fNTriggeredEvents;
55e05544 87
8b3563f4 88 ClassDef(AlidNdEtaCorrection, 1)
55e05544 89};
90
91#endif