Significance bin by bin

Dear Expert,
Sorry if this is trivial,
I would like to calculate a significance as a function of mass using bin by bin.

for example each bin of mass I should calculate the significance and after that calculate the sum quadratic all of these significances.

What I will try to do :

my histogram declared by:
self.add(“m”, 60 , 0, 6000)
and I will calculate the number of bin by:
Numbin = (6000-0)/60 =100
Then I will calculate the significance for each bin, start by [0,100]; [100,200],[200,300],[300,400]…etc
and after that I will calculte the sum quadrqtic as:

Sig=(sig12 + sig22 + sig32+ ....... )½

Could you please confirm me if what I will do is right or no

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

It is not really correct. You can combine the bins if you know the distribution in each bins. Suppose it is Normal and you get a significance in each bin sig(i). Then you can sum the square of each bin as you are doing and the distribution is a Chi-square distribution with n-degree of freedom. Then from the obtained value you can compute a p-value which you can transform then in a significance.
For example, here is a code example, supposing each bin has a significance sig[i]

double chi2 = 0;
for (int i = 0; i < N; ++i)
  chi2 += sig[i]*sig[i]; 

double pvalue = ROOT::Math::chisquared_cdf_c(chi2, N);
double significance = ROOT::Math::normal_quantile_c(pvalue, 1);  


Thanks a lot Lorenzo for your reply :slightly_smiling_face:

Can you please explain me what do you mean about :
"You can combine the bins if you know the distribution in each bins"

I think you mean :
double significance = ROOT::Math::normal_quantile_c( pvalue, 1);


Yes you are right! I have corrected it.
Thank you!

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