Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:44

0001 {
0002   double xMin = 2.5;
0003   double xMax = 3.5;
0004 
0005   TFile * file = new TFile("3_MuScleFit.root");
0006 
0007   TProfile * probHisto = file->FindObjectAny("Mass_fine_PProf");
0008   TH1F * histo = file->FindObjectAny("hRecBestResAllEvents_Mass");
0009   histo->Rebin(4);
0010 
0011   // Compute integrals
0012   Int_t histoBinMin = histo->FindBin(xMin);
0013   Int_t histoBinMax = histo->FindBin(xMax);
0014   Int_t probBinMin = probHisto->FindBin(xMin);
0015   Int_t probBinMax = probHisto->FindBin(xMax);
0016   double histoIntegral = histo->Integral(histoBinMin, histoBinMax, "width");
0017   double probHistoIntegral = probHisto->Integral(probBinMin, probBinMax, "width");
0018 
0019   histo->Scale(1./histoIntegral);
0020   histo->Draw();
0021 
0022   probHisto->SetLineColor(kRed);
0023   probHisto->Scale(1./probHistoIntegral);
0024   probHisto->Draw("same");
0025 }