Replies: 2 comments 2 replies
-
As you point out - this is an analysis preference and in particular depends on the ntuple format being used, so assuming it within coffea is not the right place for it. Beyond that, there is another problem where the summary results (for negative event weights and such) in the Run tree of the NanoAOD is accumulated over all events in the file and the processing jobs are over subsets (chunks) and an individual chunk may fail. I forget if the per-event 1/-1 weight is available in NanoAOD itself. If it is that makes things much easier and obvious. The solution may simply to be alter nanoaod to have the event weight in a more suitable place for dask-based processing. |
Beta Was this translation helpful? Give feedback.
-
Provided the input file is not already filtered (skimmed), one can always re-sum the genWeight in the |
Beta Was this translation helpful? Give feedback.
-
This is a NanoAOD topic I'm interested in how others have solved it.
The issue is that you want to scale your MC according to some luminosity and cross section. The formula to get to the final weight w of an event is w = genWeight * L * 𝜎 / sum(genWeight of this process), where L is the luminosity and 𝜎 is the cross section of the process. However, this requires the sum(genWeight of this process). NanoAOD provides
genEventSumw
as a single number per file for this purpose. Now one can either get the sum after the Coffea processor has run over all events and then apply them in a manual postprocessing step, or do a manual preprocessing step that collects the sum. Both don't seem very advantageous.So is there a proper way of doing this in Coffea or am I missing something? The nicest way I could think of is having this done already in Coffea's preprocessing, where it also reads out the number of events per file.
Beta Was this translation helpful? Give feedback.
All reactions