return *this;
}
+//____________________________________________________________________
+TH1F* CorrectionMatrix2D::Get1DCorrection(Char_t* opt) {
+ //
+ // integrate the correction over one variable
+ //
+
+ TH1D* meas1D;
+ TH1D* gene1D;
+
+ if (strcmp(opt,"x")==0) {
+ meas1D = fhMeas->ProjectionX();
+ gene1D = fhGene->ProjectionX();
+ }
+ if (strcmp(opt,"y")==0) {
+ meas1D = fhMeas->ProjectionY();
+ gene1D = fhGene->ProjectionY();
+ }
+ gene1D->Sumw2();
+
+ gene1D->SetName(Form("corr_1D_%s",fName.Data()));
+ gene1D->SetTitle(Form("corr_1D_%s",fName.Data()));
+
+ gene1D->Divide(gene1D, meas1D, 1, 1, "B");
+
+ return (TH1F*)gene1D;
+}
+
+
//____________________________________________________________________
void
CorrectionMatrix2D::Copy(TObject& c) const
//
// saves the histograms
//
-
+
gDirectory->mkdir(fName.Data());
gDirectory->cd(fName.Data());
// draws all the four histograms on one TCanvas
//
- TCanvas* canvas = new TCanvas("Correction", "Correction", 800, 800);
+ TCanvas* canvas = new TCanvas(Form("correction_%s",fName.Data()),
+ Form("correction_%s",fName.Data()), 800, 800);
canvas->Divide(2, 2);
-
+
canvas->cd(1);
if (fhMeas)
fhMeas->Draw("COLZ");
-
+
canvas->cd(2);
if (fhGene)
fhGene->Draw("COLZ");
if (fhCorr)
fhCorr->Draw("COLZ");
+ canvas->cd(4);
+
// add: draw here the stat. errors of the correction histogram
}
TH2F* GetGeneratedHistogram() { return fhGene; }
TH2F* GetMeasuredHistogram() { return fhMeas; }
+ TH1F* Get1DCorrection(Char_t* opt="x");
+
void SetGeneratedHistogram(TH2F* agene) { fhGene = agene; }
void SetMeasuredHistogram(TH2F* ameas) { fhMeas = ameas; }
Bool_t LoadHistograms(Char_t* fileName, Char_t* dir);
Bool_t LoadCorrection(Char_t* fileName, Char_t* dir) {return LoadHistograms(fileName, dir);}
- void RemoveEdges(Float_t cut=2, Int_t nBinsVtx=0, Int_t nBinsEta=0);
+ void RemoveEdges(Float_t cut=2, Int_t nBinsX=0, Int_t nBinsY=0);
Float_t GetCorrection(Float_t ax, Float_t ay) {return fhCorr->GetBinContent(fhCorr->FindBin(ax,ay));}