dsahoo
October 12, 2017, 5:23am
1
Dear Experts,
I am plotting comparison plot between data sideband and signal of MC for different variables. MC is having luminosity 36027.2/fb and data is having luminosity 35.9/fb. So, I need to normalise the luminosity of MC to data luminosity. Could you please tell me how to do it?
Thanks,
Deepak
couet
October 12, 2017, 6:35am
2
There is many operation you can do on histogram. See “Histogram operations” here . Scaling is one of them.
dsahoo
October 16, 2017, 7:15am
3
Hi Couet,
I tried with scale, but the plot looks as before(without scaling). I am attaching the macro and plot. Please have a look on it.
Thanks,
DeepakBvtxcl.cc (2.7 KB)
couet
October 16, 2017, 8:16am
4
I cannot try your macro as I do not have the files it refers to. I see you are scaling an histogram. The plot before and after scaling should be different (the Y axis should not be the same). See the help here:
https://root.cern/doc/master/classTH1.html#add929909dcb3745f6a52e9ae0860bfbd
I don’t understand what is your problem (i.e. I don’t understand what you expect).
In your macro, you scale “h1” and “h2” histograms, then you draw them and the shown plot seems to be fine.
See also:
Hi everyone,
I’m a new user of both ROOT and RootTalk so please pardon my ignorance. I’ve been trying to normalize several histograms, and when I search in RootTalk, a multitude of ways comes up. How do I know which one is “right”? What is the difference between the following methods?
Here are the 4 methods I tried:
Method 1:
Double_t num = h->GetBinContent(i);
Double_t den = h->GetBinWidth(i);
Double_t value = 0;
if (den!=0)
{
value = num/den;
h->SetBinContent(i,value);
}
Met…
system
Closed
October 30, 2017, 9:12am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.