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

SUSY branches on CMSSW 9_4_7 (not backward compatible with 940) #16

Open
wants to merge 3 commits into
base: CMSSW_9_4_X
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added JECs for SUSY ptRatio variables
  • Loading branch information
gzevi committed Jun 12, 2018
commit aa2780e7d85be677e9ec54716c92b1767cfff99b
1 change: 1 addition & 0 deletions python/TnPTreeProducer_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
setattr( process.tnpEleIDs.variables , 'el_miniIsoChg', cms.string("userFloat('miniIsoChg')") )
setattr( process.tnpEleIDs.variables , 'el_miniIsoAll', cms.string("userFloat('miniIsoAll')") )
setattr( process.tnpEleIDs.variables , 'el_ptRatio', cms.string("userFloat('ptRatio')") )
setattr( process.tnpEleIDs.variables , 'el_ptRatioUncorr', cms.string("userFloat('ptRatioUncorr')") )
setattr( process.tnpEleIDs.variables , 'el_ptRel', cms.string("userFloat('ptRel')") )
setattr( process.tnpEleIDs.variables , 'el_MVATTH', cms.InputTag("susyEleVarHelper:electronMVATTH") )
setattr( process.tnpEleIDs.variables , 'el_sip3d', cms.InputTag("susyEleVarHelper:sip3d") )
Expand Down
31 changes: 25 additions & 6 deletions python/electronsExtrasSUSY_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,27 @@ def addSusyIDs(process, options):
from PhysicsTools.NanoAOD.electrons_cff import slimmedElectronsWithUserData
from PhysicsTools.NanoAOD.electrons_cff import electronMVATTH

doJEC = True
if (doJEC):
from PhysicsTools.NanoAOD.jets_cff import updatedJets
from PhysicsTools.NanoAOD.jets_cff import jetCorrFactors # is this needed?
jetCorrFactors.src ='slimmedJets'
updatedJets.jetSource ='slimmedJets'
process.updatedJets = updatedJets
process.jetCorrFactors = jetCorrFactors
else:
ptRatioRelForEle.srcJet = cms.InputTag("slimmedJets")

process.isoForEle = isoForEle
process.ptRatioRelForEle = ptRatioRelForEle
process.slimmedElectronsWithUserData = slimmedElectronsWithUserData
process.electronMVATTH = electronMVATTH

ptRatioRelForEle.srcJet = cms.InputTag("slimmedJets")
# Also save the raw ptRatio, with the JECs from the miniAOD
ptRatioRelForEleUncorr = ptRatioRelForEle.clone()
ptRatioRelForEleUncorr.srcJet = cms.InputTag("slimmedJets")
process.ptRatioRelForEleUncorr = ptRatioRelForEleUncorr


# Make a new electron collection, with additional variables that are used for the LeptonMVA below
process.slimmedElectronsWithUserData.src = cms.InputTag(options['ELECTRON_COLL'])
Expand All @@ -45,6 +60,7 @@ def addSusyIDs(process, options):
PFIsoAll = cms.InputTag("isoForEle:PFIsoAll"),
PFIsoAll04 = cms.InputTag("isoForEle:PFIsoAll04"),
ptRatio = cms.InputTag("ptRatioRelForEle:ptRatio"),
ptRatioUncorr = cms.InputTag("ptRatioRelForEleUncorr:ptRatio"),
ptRel = cms.InputTag("ptRatioRelForEle:ptRel"),
jetNDauChargedMVASel = cms.InputTag("ptRatioRelForEle:jetNDauChargedMVASel"),
)
Expand Down Expand Up @@ -84,13 +100,16 @@ def addSusyIDs(process, options):
# The DataEmbedder (slimmedElectronsWithUserData) breaks the references, so we need to run VID and EleVarHelper after it --> Again, can never add VID results as userFloats
# Solution: make a temp electron collection with VID, use it to calculate the TTHMVA, and then teach the SusyElectronVariableHelper to load 2 electron collections, taking MVATTH from the temp one and adding it as a susyEleVarHelper variable. That way, the susyEleVarHelper re-establishes the link between TTHMVA and the main electron collection

process.susy_sequence = cms.Sequence()

if (doJEC) :
process.susy_sequence += process.jetCorrFactors
process.susy_sequence += process.updatedJets
process.susy_sequence += process.ptRatioRelForEleUncorr

process.susy_sequence = cms.Sequence(
process.isoForEle +
process.ptRatioRelForEle +
process.slimmedElectronsWithUserData
)
process.susy_sequence += process.isoForEle
process.susy_sequence += process.ptRatioRelForEle
process.susy_sequence += process.slimmedElectronsWithUserData

process.susy_sequence_requiresVID = cms.Sequence(
process.slimmedElectronsWithUserDataWithVID +
Expand Down