-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add customizer for PUPPI tune v13 #28844
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a48173a
add customization to run PUPPI tune v13
ahinzmann a30dd52
add puppi multiplicities
ahinzmann b00e83d
fix v13 tune
ahinzmann f249c97
add customizer
ahinzmann 1119d97
puppi tune v13 in master
ahinzmann e432b35
review comments
ahinzmann 2cf7111
revert tune change
ahinzmann 7f8dd8b
remove space
ahinzmann 6975b12
adapt precision
ahinzmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
def UpdatePuppiTuneV13(process): | ||
# | ||
# Adapt for re-running PUPPI | ||
# | ||
print("customizePuppiTune_cff::UpdatePuppiTuneV13: Recomputing PUPPI with Tune v13, slimmedJetsPuppi and slimmedMETsPuppi") | ||
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask | ||
task = getPatAlgosToolsTask(process) | ||
from PhysicsTools.PatAlgos.slimming.puppiForMET_cff import makePuppiesFromMiniAOD | ||
makePuppiesFromMiniAOD(process,True) | ||
process.puppi.useExistingWeights = False | ||
process.puppiNoLep.useExistingWeights = False | ||
from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncFromMiniAOD | ||
runMetCorAndUncFromMiniAOD(process,isData=False,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi",recoMetFromPFCs=True,pfCandColl=cms.InputTag("puppiForMET")) | ||
from PhysicsTools.PatAlgos.patPuppiJetSpecificProducer_cfi import patPuppiJetSpecificProducer | ||
addToProcessAndTask('patPuppiJetSpecificProducer', patPuppiJetSpecificProducer.clone(src=cms.InputTag("patJetsPuppi")), process, task) | ||
from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection | ||
updateJetCollection( | ||
process, | ||
labelName = 'PuppiJetSpecific', | ||
jetSource = cms.InputTag('patJetsPuppi'), | ||
) | ||
process.updatedPatJetsPuppiJetSpecific.userData.userFloats.src = ['patPuppiJetSpecificProducer:puppiMultiplicity', 'patPuppiJetSpecificProducer:neutralPuppiMultiplicity', 'patPuppiJetSpecificProducer:neutralHadronPuppiMultiplicity', 'patPuppiJetSpecificProducer:photonPuppiMultiplicity', 'patPuppiJetSpecificProducer:HFHadronPuppiMultiplicity', 'patPuppiJetSpecificProducer:HFEMPuppiMultiplicity' ] | ||
addToProcessAndTask('slimmedJetsPuppi', process.updatedPatJetsPuppiJetSpecific.clone(), process, task) | ||
del process.updatedPatJetsPuppiJetSpecific | ||
process.puppiSequence = cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi+process.patPuppiJetSpecificProducer+process.slimmedJetsPuppi) | ||
# | ||
# Adapt for PUPPI tune V13 | ||
# | ||
process.puppi.UseFromPVLooseTight = False | ||
process.puppi.UseDeltaZCut = False | ||
process.puppi.PtMaxCharged = 20. | ||
process.puppi.EtaMaxCharged = 2.5 | ||
process.puppi.PtMaxNeutralsStartSlope = 20. | ||
process.puppiNoLep.UseFromPVLooseTight = False | ||
process.puppiNoLep.UseDeltaZCut = False | ||
process.puppiNoLep.PtMaxCharged = 20. | ||
process.puppiNoLep.EtaMaxCharged = 2.5 | ||
process.puppiNoLep.PtMaxNeutralsStartSlope = 20. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,6 +309,11 @@ def addTable(self, proc, recoJetInfo): | |
area = jetTable.variables.area, | ||
rawFactor = jetTable.variables.rawFactor, | ||
) | ||
elif "puppi" in recoJetInfo.jet: | ||
tableContents = JETVARS.clone( | ||
puppiMultiplicity = Var("userFloat('patPuppiJetSpecificProducer:puppiMultiplicity')",float,doc="Sum of PUPPI weights of particles in the jet"), | ||
neutralPuppiMultiplicity = Var("userFloat('patPuppiJetSpecificProducer:neutralPuppiMultiplicity')",float,doc="Sum of PUPPI weights of neutral particles in the jet") | ||
) | ||
else: | ||
tableContents = JETVARS.clone() | ||
|
||
|
@@ -392,7 +397,7 @@ def AddPileUpJetIDVars(proc): | |
proc.jetTable.variables.pull = Var("userFloat('pull')", float, doc="magnitude of pull vector", precision= 6) | ||
proc.jetTable.variables.jetR = Var("userFloat('jetR')", float, doc="fraction of jet pT carried by the leading constituent", precision= 6) | ||
proc.jetTable.variables.jetRchg = Var("userFloat('jetRchg')", float, doc="fraction of jet pT carried by the leading charged constituent", precision= 6) | ||
proc.jetTable.variables.nCharged = Var("userInt('nCharged')", float, doc="number of charged constituents", precision= 6) | ||
proc.jetTable.variables.nCharged = Var("userInt('nCharged')", int, doc="number of charged constituents", precision= 6) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove precision here, with integer type it makes no sense |
||
|
||
def PrepJMECustomNanoAOD(process): | ||
# | ||
|
@@ -481,4 +486,3 @@ def PrepJMECustomNanoAOD(process): | |
|
||
process.nanoSequenceMC += recoJA.getSequence(process) | ||
process.nanoSequenceMC += tableRecoJA.getSequence(process) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please evaluate whether you really want full precision for these float numbers