Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "TProfile.h"
0002 #include "TCanvas.h"
0003 #include "TFile.h"
0004 #include <iostream>
0005 
0006 void CompareProb()
0007 {
0008   TFile * inputFile = new TFile("2_MuScleFit_DATA_triggercut.root");
0009   TProfile * probHisto = (TProfile*)inputFile->FindObjectAny("Mass_fine_PProf");
0010   TH1F * massHisto = (TH1F*)inputFile->FindObjectAny("hRecBestRes_Mass");
0011 
0012   TCanvas * newCanvas = new TCanvas();
0013   newCanvas->Draw();
0014 
0015   double xMin = 2.85;
0016   double xMax = 3.3;
0017 
0018   std::cout << probHisto << ", " << massHisto << std::endl;
0019 
0020   probHisto->Scale(1/probHisto->Integral(probHisto->FindBin(xMin), probHisto->FindBin(xMax), "width"));
0021   probHisto->SetLineColor(2);
0022   probHisto->SetMarkerColor(2);
0023   probHisto->SetMarkerStyle(2);
0024   probHisto->SetMarkerSize(0.2);
0025 
0026   massHisto->Scale(1/massHisto->Integral(massHisto->FindBin(xMin), massHisto->FindBin(xMax), "width"));
0027 
0028   massHisto->Draw();
0029   probHisto->Draw("same");
0030   // probHisto->Draw();
0031 
0032 }