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

Moving leptonSF code to compiled class #110

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

amagnan
Copy link

@amagnan amagnan commented Nov 26, 2018

  • the previous version, with a helper macro, was working fine interactively, but not in crab. Makes more sense to have properly compiled CppWorker.
  • Added possibility to produce loose or tight working points in the leptonSFProducer.py -> POG still needs to extend to other WP, and compute errors properly -> need source-by-source variations, how it is done now is incorrect I believe (but not saved in output branches at the moment anyway).

@amagnan
Copy link
Author

amagnan commented Nov 26, 2018

Related to issue #108

zhenbinwu pushed a commit to susy2015/nanoAOD-tools that referenced this pull request Mar 16, 2019
@arizzi
Copy link
Contributor

arizzi commented Mar 18, 2019

can you fix the conflicts so we may consider for merge? (apologies for the late feedback)

@amagnan
Copy link
Author

amagnan commented Mar 19, 2019

I fixed the merge error (removing the python helper code which was moved in proper compiled cpp class) and also I fixed the SF error to be returned by "type", up to the user then to combine properly the different errors in quadrature or keep as separate ....

@arizzi
Copy link
Contributor

arizzi commented Mar 19, 2019

@sroychow can you validate / cross check with the similar code you have?

@sroychow
Copy link
Contributor

@arizzi My code was updated only for Muons. I will check if the same will work for electrons and get back to you.

@sroychow
Copy link
Contributor

sroychow commented Apr 2, 2019

@arizzi
Please have a look at
https://github.com/sroychow/nanoAOD-tools/blob/a1cefbe44f496e4c95ce6e8157383f13c61a9311/python/postprocessing/modules/common/lepSFProducer_v2.py

The module takes as input histograms(depending on working points) to read SF and uncertainties from the MuonPOG trees. It only uses the WeightCalculater helper class. I have also checked the root files provided for electrons and the module can be used for egamma case as well.

if "/LeptonEfficiencyCorrector_cc.so" not in ROOT.gSystem.GetLibraries():
print "Load C++ Worker"
ROOT.gROOT.ProcessLine(".L %s/src/PhysicsTools/NanoAODTools/python/postprocessing/helpers/LeptonEfficiencyCorrector.cc+" % os.environ['CMSSW_BASE'])
for library in [ "libCondFormatsJetMETObjects", "libPhysicsToolsNanoAODTools" ]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we checking for METObjects?

rymuelle pushed a commit to rymuelle/nanoAOD-tools that referenced this pull request May 15, 2021
bainbrid pushed a commit to bainbrid/nanoAOD-tools that referenced this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants