cms-nanoAOD / nanoAOD-tools

Tools for working with NanoAOD (requiring only python + root, not CMSSW)
42 stars 328 forks source link

Creating duplicate output events #243

Open benkrikler opened 4 years ago

benkrikler commented 4 years ago

I'm about to start modifying the eventloop in my fork of NanoAODTools so that for a given input event, I will write out 100 (or any other arbitrary, fixed number) output events, where for each output event we smear the two leading jet Pt. The physics motivation is to over-sample and smear a statistically limited QCD control region.

I can see how to achieve this by modifying the eventloop function, but I'm curious if there's anything I need to be aware of in terms of additional book-keeping pieces, e.g. is there any place in the code that assumes each input event has a unique event number, etc.

Finally, does functionality like this seem more generally useful and worth a PR to contribute back once we're satisfied that it's working?

benkrikler commented 4 years ago

I've implemented this functionality in this commit on our forked version of NanoAODTools: https://github.com/cms-nanoAOD/nanoAOD-tools/commit/b9791fbc6b347414c6d90022da43e5a8526448d3.

I'd be happy to open a PR to push this back to the official master branch, but otherwise I will just leave this here as a reference for potential future users.