Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double to int casting can cause precision issues #945

Open
GiacomoBoldrini opened this issue Apr 17, 2024 · 0 comments
Open

Double to int casting can cause precision issues #945

GiacomoBoldrini opened this issue Apr 17, 2024 · 0 comments

Comments

@GiacomoBoldrini
Copy link

When computing bin sums following Barlow-Beeston approach, a double -> int -> double cast is made to obtain the number of effective events here and here. In presence of large number of events in a bin with small associated error the values can easily exceed int 32 bits giving errors as reported

------------------------------------------------------------
210        5058.074707     0.084911        total sum                     
210        5058.074707     0.084911        excluding marked processes    
210        -2147483648.000000 -nan            Unweighted events, alpha=-0.000002
  => Number of weighted events is below poisson threshold
    sm_lin_quad_cHj1     5137.480469     0.081002                                      
                         -2147483648.000000 -nan            Unweighted events, alpha=-0.000002
Error in <ROOT::Math::Cephes::igami>: Wrong domain for parameter a (must be > 0)
Error in <ROOT::Math::Cephes::igami>: Wrong domain for parameter a (must be > 0)
      => Product of prop_bininclusive_all_bin210_sm_lin_quad_cHj1[-2147483648.00,0.00,0.00] and const [-0.0000] to be poisson constrained

Simply changing int to int64_t in both lines seems to solve the problem

210        5058.074707     0.084911        total sum                     
210        5058.074707     0.084911        excluding marked processes    
210        3548512580.000000 59569.392980    Unweighted events, alpha=0.000001
  => Total parameter prop_bininclusive_all_bin210[0.00,-7.00,7.00] to be gaussian constrained
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant