3 #ifndef DNDETACORRECTION_H
4 #define DNDETACORRECTION_H
7 // ------------------------------------------------------
9 // Class to handle corrections for dN/dEta measurements
11 // ------------------------------------------------------
14 // - add documentation
15 // - add status: generate or use maps
16 // - add functionality to set the bin sizes
22 #include <CorrectionMatrix2D.h>
25 class dNdEtaCorrection : public TNamed
29 CorrectionMatrix2D* fNtrackToNparticleCorrection; // handles the track-to-vertex correction
30 CorrectionMatrix2D* fEventBiasCorrection; // handles the event bias correction
32 TH1F* fhVtxZAllEvents;
33 TH1F* fhVtxZUsedEvents;
36 dNdEtaCorrection(Char_t* name="dndeta_correction");
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);}
47 CorrectionMatrix2D* GetNtrackToNpraticleCorrection() {return fNtrackToNparticleCorrection;}
48 CorrectionMatrix2D* GetEventBiasCorrection() {return fEventBiasCorrection;}
50 TH1F* GetVertexZHistogramAllEvents() {return fhVtxZAllEvents;}
51 TH1F* GetVertexZHistogramUsedEvents() {return fhVtxZUsedEvents;}
53 virtual Long64_t Merge(TCollection* list);
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);}
60 void DrawHistograms();
62 void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
64 Float_t GetCorrection(Float_t vtx, Float_t eta)
65 {return fNtrackToNparticleCorrection->GetCorrection(vtx, eta) * fEventBiasCorrection->GetCorrection(vtx, eta);}
68 ClassDef(dNdEtaCorrection,0)