Problem in 2D histogram normalization

Dear developers,

I want to normalize a 2D histogram with lumi = all_events/ tzq_xsec. Adter that I want to store this histogram.
what i am doing is

         double tzq_xsec    = 0.09418; //0.0758;   //pb-1
   TFile *f1 = new TFile("/afs/cern.ch/work/n/nmajeed/private/CMSSW_7_3_0/my_work/kiran_files/MC13TeV_tZq_ll.root");
   TH1F *h = (TH1F*)gDirectory-> Get("counter_");

         double all_events = h->GetBinContent(2);
         double lumi = all_events/tzq_xsec;
//         cout<<"lumi : "<< lumi<<endl;
//nt2_pt_eta->Integral();
//cout<<" : "<< lumi<<endl;

         double scale = lumi/nt2_pt_eta->Integral();
cout<<"scale : "<< scale<<endl;
    nt2_pt_eta->Scale(scale);
TH2D *norm_nt2_pt_eta = (TH2D*)nt2_pt_eta->Clone();

I am not getting the correct scale. Kindly check it

Cheers,
Nab

Try: TH2D *norm_nt2_pt_eta = new TH2D(*nt2_pt_eta); norm_nt2_pt_eta->SetNameTitle("norm_nt2_pt_eta", "normalized nt2_pt_eta"); norm_nt2_pt_eta->Scale(scale);

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.