Weighting histogram

Hi Experts,

i need some help, i have a root file having some histograms like pt, eta, phi, energy, mass etc. i want to apply weight to these histograms. the weight (scaling factor) is determined in different eta and pt bins. i stored the scaling factors in a 2D histogram i.e at different pt bins (x axis) and eta bins (y axis) shown in figure [1]. Now my confusion is how to extract the weight (scaling factor) from 2D hist and reweight for example mass histogram [2].

[1]

[2]

Hi,
do you have a TTree with pT, eta, and mass, which you could re-analyze and apply the weights? If not, and if all you have is the final histograms, then I’m afraid reweighting a histogram the way you described is not possible.

initially these pT, eta, and mass etc were in a ttree and i normalize them as XS*lumi/nEvents and stored them as histograms.

When you analyze the TTree, you can retrieve the weight based on pT and eta with something like

const double weight = histogramWithPtVsEta->GetBinContent(pT, eta);

and apply this weight when histogramming the mass:

histogramWithMass->Fill(mass, weight);

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