Handle wrong PU, related updates

Kevin Pedro requested to merge github/fork/kpedro88/HandleBadPU into Run2_2017

NeffFinder now produces a histogram of TrueNumInteractions in addition to counting negative weights. This can be used to do per-sample pileup reweighting for the 2017 MC that was produced with wrong PU input. The number of bins for this histogram is set to 1000, in order to provide flexibility if the data histograms get extended to a higher number of bins (vs. the default 50).

If a sample is divided into several chunks, the output histogram will need to be hadded. The scripts to do this are copied from https://github.com/kpedro88/Analysis with a few modifications. An additional script is provided to combine all the MC sample histograms into one file for easier distribution to jobs.

WeightProducer is modified to recompute PU weights with the MC histogram from NeffFinder and the data histograms from the usual source. The MCSample class now keeps track of whether or not a sample has the wrong PU, in order to activate this feature. pileupCorr.py can perform a similar operation in case the user wants to check interactively and keep a record of the pileup weight distribution.

The MC histogram is named based on the production output naming scheme (folder.sample), so the unit tests have been updated to use this naming scheme as well.

Other updates:

  • .gitignore, README.md updates
  • remove SkipEvent setting (caused large log files)
  • simplify handling of Zprime cross sections

@aperloff please take a look and test it out

Merge request reports