]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/dNdEta/dNdEtaCorrection.h
class with static analysis helper functions
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / dNdEtaCorrection.h
1 /* $Id$ */
2
3 #ifndef DNDETACORRECTION_H
4 #define DNDETACORRECTION_H
5
6
7 // ------------------------------------------------------
8 //
9 // Class to handle corrections for dN/dEta measurements
10 //
11 // ------------------------------------------------------
12 //
13 // TODO:
14 // - add documentation
15 // - add status: generate or use maps
16 // - add functionality to set the bin sizes
17 // 
18
19 #include <TNamed.h>
20 #include <TFile.h>
21
22 #include <CorrectionMatrix2D.h>
23
24
25 class dNdEtaCorrection : public TNamed
26 {
27 protected:  
28   
29   CorrectionMatrix2D* fNtrackToNparticleCorrection; // handles the track-to-vertex correction
30   CorrectionMatrix2D* fEventBiasCorrection;         // handles the event bias correction
31
32   TH1F* fhVtxZAllEvents;
33   TH1F* fhVtxZUsedEvents;
34
35 public:
36   dNdEtaCorrection(Char_t* name="dndeta_correction");
37
38   void FillEvent(Float_t vtx)     {fhVtxZAllEvents->Fill(vtx);}
39   void FillUsedEvent(Float_t vtx) {fhVtxZUsedEvents->Fill(vtx);}
40   void FillParticleAllEvents(Float_t vtx, Float_t eta)         {fEventBiasCorrection->FillGene(vtx, eta);}
41   void FillParticleWhenUsedEvent(Float_t vtx, Float_t eta)     {fEventBiasCorrection->FillMeas(vtx, eta);
42                                                                 fNtrackToNparticleCorrection->FillGene(vtx, eta);}
43   void FillParticleWhenMeasuredTrack(Float_t vtx, Float_t eta) {fNtrackToNparticleCorrection->FillMeas(vtx, eta);}
44
45   void Finish();
46
47   CorrectionMatrix2D* GetNtrackToNpraticleCorrection() {return fNtrackToNparticleCorrection;}
48   CorrectionMatrix2D* GetEventBiasCorrection()         {return fEventBiasCorrection;}
49
50   TH1F* GetVertexZHistogramAllEvents()  {return fhVtxZAllEvents;}
51   TH1F* GetVertexZHistogramUsedEvents() {return fhVtxZUsedEvents;}
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 GetCorrection(Float_t vtx, Float_t eta) 
65     {return fNtrackToNparticleCorrection->GetCorrection(vtx, eta) * fEventBiasCorrection->GetCorrection(vtx, eta);}
66   
67
68   ClassDef(dNdEtaCorrection,0)
69 };
70
71 #endif