-
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
Switch to heavy-ion jets in HI miniAOD #30898
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0e0c004
Switch to HI jets in PAT
mandrenguyen 3705cca
Use addJetCollection
mandrenguyen 9ee8b6c
Remove getattr and customizeHeavyIon function
mandrenguyen 2c61949
moved customization to source configs, changed pfNoPileUpJMEHI to pfE…
mandrenguyen 66c8f06
protect against missing slimmedJets collection
mandrenguyen c0b3282
Overwrite patjets instead of alias, various cleanups
mandrenguyen 80e6f4c
more cleanup/reorganization
mandrenguyen 5870179
modify patJets directly, rather than using addJetCollection
mandrenguyen 0900429
use lowercase for names, use < 0 rather than > 9999
mandrenguyen 3ae3fdd
Move patJet setup to producersLayer1 and deal with consequences in mi…
mandrenguyen ba9ab3a
add ES for self-consistency; remove updates of basicJetsForMetPuppi a…
slava77devel 819db91
drop type specs
slava77devel d309260
fixed tabs
mandrenguyen d225fa1
define _hiGeneral = pp_on_AA_2018 | pp_on_PbPb_run3 for HI miniAOD; w…
slava77devel 9f40285
disable puppi for packed cands in HI miniAOD
slava77devel 9910559
fix missing addJetCollection
slava77devel 7dda511
Cherry pick Slava's commits + address style comments
mandrenguyen 81364a3
remove jet algo/radius for gen collections
mandrenguyen 10ed6c8
Undo cloning of b-tagging sequences and other cleaning
mandrenguyen 0fcdc06
use era for a few more parameters
mandrenguyen 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
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
13 changes: 13 additions & 0 deletions
13
PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py
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,13 @@ | ||
def removeL1FastJetJECs(process): | ||
for label in process.producerNames().split(): | ||
module = getattr(process, label) | ||
if module.type_() == "PATPFJetMETcorrInputProducer": | ||
module.offsetCorrLabel = '' | ||
|
||
def removeJECsForMC(process): | ||
for label in process.producerNames().split(): | ||
module = getattr(process, label) | ||
if module.type_() == "PATPFJetMETcorrInputProducer": | ||
module.jetCorrLabel = 'Uncorrected' | ||
|
||
process.basicJetsForMet.jetCorrLabel = 'Uncorrected' |
71 changes: 59 additions & 12 deletions
71
PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py
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 |
---|---|---|
@@ -1,19 +1,66 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff import * | ||
from RecoHI.HiJetAlgos.HiGenCleaner_cff import * | ||
heavyIonCleaned = cms.Sequence(genPartons*hiPartons+heavyIonCleanedGenJets) | ||
from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets | ||
from RecoHI.HiJetAlgos.HiGenCleaner_cff import hiPartons | ||
from RecoHI.HiJetAlgos.HiGenJets_cff import ak4HiGenJets | ||
from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets | ||
|
||
makeHeavyIonJets = cms.Sequence( | ||
patJetCorrections * | ||
|
||
# pat and HI specifics | ||
heavyIonCleaned * | ||
patJetGenJetMatch * | ||
patJetPartonMatch * | ||
allPartons = cms.EDProducer( | ||
"PartonSelector", | ||
src = cms.InputTag('genParticles'), | ||
withLeptons = cms.bool(False), | ||
) | ||
|
||
# object production | ||
patJets | ||
cleanedPartons = hiPartons.clone( | ||
src = 'allPartons', | ||
) | ||
|
||
ak4HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets") | ||
|
||
cleanedGenJetsTask = cms.Task( | ||
genParticlesForJets, | ||
cleanedPartons, | ||
ak4HiGenJets, | ||
ak4HiCleanedGenJets | ||
) | ||
|
||
from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfEmptyCollection, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation, akCs4PFJets | ||
from RecoHI.HiTracking.highPurityGeneralTracks_cfi import highPurityGeneralTracks | ||
from RecoJets.JetAssociationProducers.ak5JTA_cff import * | ||
from RecoBTag.Configuration.RecoBTag_cff import impactParameterTagInfos, trackCountingHighEffBJetTags, trackCountingHighPurBJetTags, jetProbabilityBJetTags, jetBProbabilityBJetTags, secondaryVertexTagInfos, combinedSecondaryVertexV2BJetTags, simpleSecondaryVertexHighEffBJetTags, simpleSecondaryVertexHighPurBJetTags | ||
ak5JetTracksAssociatorAtVertex | ||
from RecoBTag.SecondaryVertex.simpleSecondaryVertex2TrkComputer_cfi import * | ||
from RecoBTag.SecondaryVertex.simpleSecondaryVertex3TrkComputer_cfi import * | ||
from RecoBTag.SecondaryVertex.combinedSecondaryVertexV2Computer_cfi import * | ||
from RecoBTag.ImpactParameter.jetBProbabilityComputer_cfi import * | ||
from RecoBTag.ImpactParameter.jetProbabilityComputer_cfi import * | ||
from RecoBTag.ImpactParameter.trackCounting3D2ndComputer_cfi import * | ||
from RecoBTag.ImpactParameter.trackCounting3D3rdComputer_cfi import * | ||
from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * | ||
|
||
recoPFJetsHIpostAODTask = cms.Task( | ||
PFTowers, | ||
pfEmptyCollection, | ||
ak4PFJetsForFlow, | ||
hiFJRhoFlowModulation, | ||
hiPuRho, | ||
highPurityGeneralTracks, | ||
akCs4PFJets, | ||
ak5JetTracksAssociatorAtVertex, | ||
impactParameterTagInfos, | ||
trackCountingHighEffBJetTags, | ||
trackCountingHighPurBJetTags, | ||
jetProbabilityBJetTags, | ||
jetBProbabilityBJetTags, | ||
secondaryVertexTagInfos, | ||
combinedSecondaryVertexV2BJetTags, | ||
simpleSecondaryVertexHighEffBJetTags, | ||
simpleSecondaryVertexHighPurBJetTags, | ||
patJetCorrFactors | ||
) | ||
|
||
recoJetsHIpostAODTask = cms.Task( | ||
recoPFJetsHIpostAODTask, | ||
allPartons, | ||
cleanedGenJetsTask, | ||
) |
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -25,14 +25,15 @@ def applySubstructure( process, postfix="" ) : | |
_run2_miniAOD_ANY = (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | run2_miniAOD_UL) | ||
from Configuration.Eras.Modifier_pA_2016_cff import pA_2016 | ||
from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 | ||
from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 | ||
if postfix=='': | ||
# Avoid recomputing the PUPPI collections that are present in AOD | ||
_rerun_puppijets_task = task.copy() | ||
_rerun_puppijets_task.add(getattr(process,'ak8PFJetsPuppi'), | ||
getattr(process,'ak8PFJetsPuppiConstituents'), | ||
getattr(process,'ak8PFJetsPuppiSoftDrop'), | ||
getattr(process,'ak8PFJetsPuppiSoftDropMass')) | ||
(_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018).toReplaceWith(task, _rerun_puppijets_task) | ||
(_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(task, _rerun_puppijets_task) | ||
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. now that a call to |
||
else: | ||
task.add(getattr(process,'ak8PFJetsPuppi'+postfix), | ||
getattr(process,'ak8PFJetsPuppiConstituents'+postfix), | ||
|
@@ -53,6 +54,8 @@ def applySubstructure( process, postfix="" ) : | |
dropSpecific = cms.bool(True), # Save space | ||
), process, task ) | ||
|
||
(pp_on_AA_2018 | pp_on_PbPb_run3).toModify( getattr(process,'slimmedGenJetsAK8SoftDropSubJets'), cut = 'pt<0', nLoose = 0) | ||
|
||
## PATify puppi soft drop fat jets | ||
addJetCollection( | ||
process, | ||
|
@@ -88,10 +91,9 @@ def applySubstructure( process, postfix="" ) : | |
addToProcessAndTask('nb2AK8PuppiSoftDrop'+postfix, process.ecfNbeta2.clone(src = cms.InputTag("ak8PFJetsPuppiSoftDrop"+postfix), cuts = cms.vstring('', '', 'pt > 250')), process, task) | ||
|
||
#too slow now ==> disable | ||
from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 | ||
from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 | ||
from Configuration.Eras.Modifier_phase2_common_cff import phase2_common | ||
for e in [pp_on_XeXe_2017, pp_on_AA_2018, phase2_common]: | ||
for e in [pp_on_XeXe_2017, pp_on_AA_2018, pp_on_PbPb_run3, phase2_common]: | ||
e.toModify(getattr(process,'nb1AK8PuppiSoftDrop'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) | ||
e.toModify(getattr(process,'nb2AK8PuppiSoftDrop'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) | ||
|
||
|
@@ -106,7 +108,7 @@ def applySubstructure( process, postfix="" ) : | |
getattr(process,"patJetsAK8PFPuppiSoftDropSubjets"+postfix).userData.userFloats.src += ['nb2AK8PuppiSoftDropSubjets'+postfix+':ecfN2','nb2AK8PuppiSoftDropSubjets'+postfix+':ecfN3'] | ||
getattr(process,"patJetsAK8PFPuppiSoftDropSubjets"+postfix).userData.userFloats.src += ['NjettinessAK8Subjets'+postfix+':tau1','NjettinessAK8Subjets'+postfix+':tau2','NjettinessAK8Subjets'+postfix+':tau3','NjettinessAK8Subjets'+postfix+':tau4'] | ||
|
||
for e in [pp_on_XeXe_2017, pp_on_AA_2018, phase2_common]: | ||
for e in [pp_on_XeXe_2017, pp_on_AA_2018, pp_on_PbPb_run3, phase2_common]: | ||
e.toModify(getattr(process,'nb1AK8PuppiSoftDropSubjets'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) | ||
e.toModify(getattr(process,'nb2AK8PuppiSoftDropSubjets'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) | ||
|
||
|
Oops, something went wrong.
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.
the PhysicsTools/PatAlgos/python/producersHeavyIons apparently had some other support/development goals.
From a quick look (mostly in the commit history) it looks like it was built for support of data built with HI scenario,
with developments apparently stopped in 2010.
Is it appropriate to just locally replace some methods/files in this directory for the specific needs of pp_on_AA miniAOD?
BTW, for this file in particular, the added task names are rather different from the file name itself.
(without too much more in depth analysis) I'd suggest to make a new file.
If it were a general PAT case, the post-AOD module definitions would go to PhysicsTools/PatAlgos/python/recoLayer0
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.
there was no follow up to my comment here.
Please check/comment.
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.
Sorry, I don't have an answer to this. If the previous use of this file is deprecated, it seems ok to re-purpose it.