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/");
   TH1F *h = (TH1F*)gDirectory-> Get("counter_");

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

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

I am not getting the correct scale. Kindly check it


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.