implemented analysis using 3d information (vtx_z, eta, pt)
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / AlidNdEtaCorrection.h
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
22 #include <AliCorrectionMatrix2D.h>
23 #include <AliCorrectionMatrix3D.h>
24
25 class AlidNdEtaCorrection : public TNamed
26 {
27 public:
28   AlidNdEtaCorrection(Char_t* name="dndeta_correction");
29
30   // fVertexRecoCorrection
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);}
33
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);}
37
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;}
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   
62   Float_t GetTrack2ParticleCorrection(Float_t vtx, Float_t eta, Float_t pt) 
63     {return fTrack2ParticleCorrection->GetCorrection(vtx, eta, pt);}
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);}
68
69   Float_t GetMeasuredFraction(Float_t ptCutOff, Float_t eta = -1, Bool_t debug = kFALSE);
70
71 protected:
72   AliCorrectionMatrix3D* fTrack2ParticleCorrection; // handles the track-to-particle correction, function of vtx_z, eta, pt
73   AliCorrectionMatrix2D* fVertexRecoCorrection;     // handles the vertex reconstruction efficiency, function of n_clustersITS and vtx_z
74
75   AliCorrectionMatrix2D* fTriggerBiasCorrection;          // MB to desired sample
76
77   Long64_t fNEvents;
78   Long64_t fNTriggeredEvents;
79
80   ClassDef(AlidNdEtaCorrection,0)
81 };
82
83 #endif