Skip to content

Moving leptonSF code to compiled class - #110

Open
amagnan wants to merge 4 commits into
cms-nanoAOD:masterfrom
amagnan:master
Open

Moving leptonSF code to compiled class#110
amagnan wants to merge 4 commits into
cms-nanoAOD:masterfrom
amagnan:master

Conversation

@amagnan

@amagnan amagnan commented Nov 26, 2018

Copy link
Copy Markdown
  • 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

amagnan commented Nov 26, 2018

Copy link
Copy Markdown
Author

Related to issue #108

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

arizzi commented Mar 18, 2019

Copy link
Copy Markdown
Contributor

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

@amagnan

amagnan commented Mar 19, 2019

Copy link
Copy Markdown
Author

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

arizzi commented Mar 19, 2019

Copy link
Copy Markdown
Contributor

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

@sroychow

Copy link
Copy Markdown
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

sroychow commented Apr 2, 2019

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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