Open alesaggio opened 2 years ago
Hi,
Currently correctionlib does not accept jagged arrays even when they are broadcastable. This is a planned feature and will be available eventually. For now you can flatten and unflatten as done in this example: https://gist.github.com/nsmith-/8d3d41aaffda92148ebc7bfcc5c827f5 (in particular cell 7)
Not entirely self-contained within the original question, but if you are using coffea
to get jagged arrays, coffea has a coffea.lookup_tools.correctionlib_wrappers
[1] that you can use with something like:
lookup = correctionlib_wrapper.correctionlib_wrapper(
correctionlib.CorrectionSet.from_file(sf_file)['deepJet_shape'])
lookup('central', jets.hadronFlavor, np.abs(jets.eta), jets.pt, bscore)
[1] https://github.com/CoffeaTeam/coffea/blob/master/coffea/lookup_tools/correctionlib_wrapper.py
Dear experts,
I am trying to use the evaluate() method to evaluate btv scale factors. I work with jagged arrays and this method does not seem to work in this scenario. Below a minimal example:
This fails with:
Calling the method in a loop over the events is not an option when the number of events (or jets) is too high.
Is there a solution for this? Thank you in advance for any help.
Cheers, Alessia