3 #include "dNdEtaCorrection.h"
7 //____________________________________________________________________
8 ClassImp(dNdEtaCorrection)
10 //____________________________________________________________________
11 dNdEtaCorrection::dNdEtaCorrection(Char_t* name)
17 fNtrackToNparticleCorrection = new CorrectionMatrix2D("nTrackToNPart", "nTrackToNPart",80,-20,20,120,-6,6);
18 fEventBiasCorrection = new CorrectionMatrix2D("EventBias", "EventBias ",80,-20,20,120,-6,6);
20 fNtrackToNparticleCorrection ->SetAxisTitles("vtx z [cm]", "#eta");
21 fEventBiasCorrection ->SetAxisTitles("vtx z [cm]", "#eta");
25 //____________________________________________________________________
27 dNdEtaCorrection::Finish() {
31 // divide the histograms in the CorrectionMatrix2D objects to get the corrections
34 fNtrackToNparticleCorrection->Divide();
35 fEventBiasCorrection ->Divide();
39 //____________________________________________________________________
41 dNdEtaCorrection::Merge(TCollection* list) {
42 // Merge a list of dNdEtaCorrection objects with this (needed for
44 // Returns the number of merged objects (including this).
52 TIterator* iter = list->MakeIterator();
55 // collections of measured and generated histograms
56 TList* collectionNtrackToNparticle = new TList;
57 TList* collectionEventBias = new TList;
60 while ((obj = iter->Next())) {
62 dNdEtaCorrection* entry = dynamic_cast<dNdEtaCorrection*> (obj);
66 collectionNtrackToNparticle ->Add(entry->GetNtrackToNpraticleCorrection());
67 collectionEventBias ->Add(entry->GetEventBiasCorrection());
71 fNtrackToNparticleCorrection ->Merge(collectionNtrackToNparticle);
72 fEventBiasCorrection ->Merge(collectionEventBias);
74 delete collectionNtrackToNparticle;
75 delete collectionEventBias;
83 //____________________________________________________________________
85 dNdEtaCorrection::RemoveEdges(Float_t cut, Int_t nBinsVtx, Int_t nBinsEta) {
87 // removes the edges of the correction maps
90 fNtrackToNparticleCorrection ->RemoveEdges(cut, nBinsVtx, nBinsEta);
91 fEventBiasCorrection ->RemoveEdges(cut, nBinsVtx, nBinsEta);
94 //____________________________________________________________________
96 dNdEtaCorrection::LoadHistograms(Char_t* fileName, Char_t* dir) {
98 // loads the histograms
101 fNtrackToNparticleCorrection ->LoadHistograms(fileName, dir);
102 fEventBiasCorrection ->LoadHistograms(fileName, dir);
108 //____________________________________________________________________
110 dNdEtaCorrection::SaveHistograms() {
112 // save the histograms
115 gDirectory->mkdir(fName.Data());
116 gDirectory->cd(fName.Data());
118 fNtrackToNparticleCorrection ->SaveHistograms();
119 fEventBiasCorrection ->SaveHistograms();
121 gDirectory->cd("../");
124 //____________________________________________________________________
125 void dNdEtaCorrection::DrawHistograms()
128 // call the draw histogram method of the two CorrectionMatrix2D objects
130 fNtrackToNparticleCorrection ->DrawHistograms();
131 fEventBiasCorrection ->DrawHistograms();
133 fEventBiasCorrection->Get1DCorrection("x")->Draw();