Skip to content

Commit

Permalink
Merge pull request #34714 from mariadalfonso/PromptPart3
Browse files Browse the repository at this point in the history
NANO: rework for Prompt (part3)
  • Loading branch information
cmsbuild authored Sep 1, 2021
2 parents c7d4a31 + d69d83d commit e864342
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 59 deletions.
3 changes: 3 additions & 0 deletions Configuration/Eras/python/Modifier_run3_nanoAOD_devel_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

run3_nanoAOD_devel = cms.Modifier()
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
workflows[136.735] = ['',['RunNoBPTX2016B','HLTDR2_2016','RECODR2reHLTAlCaTkCosmics_HIPM','HARVESTDR2']]
# reminiAOD wf on 2016B input, mainly here for PPS testing
workflows[136.72411] = ['',['RunJetHT2016B_reminiaodUL','REMINIAOD_data2016UL_HIPM','HARVESTDR2_REMINIAOD_data2016UL_HIPM']]
workflows[136.72412] = ['',['RunJetHT2016B_reminiaodUL','REMININANO_data2016UL_HIPM','HARVESTDR2_REMININANO_data2016UL_HIPM']]
workflows[136.72413] = ['',['RunJetHT2016B_reminiaodUL','REMININANO_data2016UL_HIPM_met','HARVESTDR2_REMININANO_data2016UL_HIPM_met']]

### run 2016C ###
workflows[136.736] = ['',['RunHLTPhy2016C','HLTDR2_2016','RECODR2_2016reHLT_HIPM','HARVESTDR2']]
Expand Down
17 changes: 17 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2821,9 +2821,13 @@ def gen2021HiMix(fragment,howMuch):
steps['HARVESTDCEXPRUN3']=merge([{'--conditions':'auto:run3_data_express','--era':'Run3'},steps['HARVESTDC']])

steps['HARVESTDR2_REMINIAOD_data2016']=merge([{'--data':'', '-s':'HARVESTING:@miniAODDQM','--era':'Run2_2016,run2_miniAOD_80XLegacy'},steps['HARVESTDR2']])
steps['HARVESTDR2_REMININANO_data2016']=merge([{'--data':'', '-s':'HARVESTING:@miniAODDQM+@nanoAODDQM','--era':'Run2_2016'},steps['HARVESTDR2']])
steps['HARVESTDR2_REMINIAOD_data2016_HIPM']=merge([{'--era':'Run2_2016_HIPM,run2_miniAOD_80XLegacy'},steps['HARVESTDR2_REMINIAOD_data2016']])
steps['HARVESTDR2_REMINIAOD_data2016UL']=merge([{'--era':'Run2_2016', '--procModifiers':'run2_miniAOD_UL_preSummer20'},steps['HARVESTDR2_REMINIAOD_data2016']])
steps['HARVESTDR2_REMININANO_data2016UL']=merge([{'--era':'Run2_2016', '--procModifiers':'run2_miniAOD_UL_preSummer20'},steps['HARVESTDR2_REMININANO_data2016']])
steps['HARVESTDR2_REMINIAOD_data2016UL_HIPM']=merge([{'--era':'Run2_2016_HIPM'},steps['HARVESTDR2_REMINIAOD_data2016UL']])
steps['HARVESTDR2_REMININANO_data2016UL_HIPM']=merge([{'--era':'Run2_2016_HIPM,run2_nanoAOD_106Xv2,run3_nanoAOD_devel'},steps['HARVESTDR2_REMININANO_data2016UL']])
steps['HARVESTDR2_REMININANO_data2016UL_HIPM_met']=merge([{'--era':'Run2_2016_HIPM,run2_nanoAOD_106Xv1,run3_nanoAOD_devel'},steps['HARVESTDR2_REMININANO_data2016UL']])

steps['HARVEST2017_REMINIAOD_data2017']=merge([{'--era':'Run2_2017,run2_miniAOD_94XFall17'},steps['HARVESTDR2_REMINIAOD_data2016']])
steps['HARVEST2017_REMINIAOD_data2017UL']=merge([{'--era':'Run2_2017'},steps['HARVESTDR2_REMINIAOD_data2016UL']])
Expand Down Expand Up @@ -3105,9 +3109,22 @@ def gen2021HiMix(fragment,howMuch):
'--datatier' : 'MINIAOD,DQMIO'
},stepMiniAODDefaults])

steps['REMININANO_data2016'] = merge([{'-s' : 'PAT,NANO,DQM:@miniAODDQM+@nanoAODDQM',
'--process' : 'PATnano',
'--era' : 'Run2_2016',
'--conditions' : 'auto:run2_data_relval',
'--data' : '',
'--scenario' : 'pp',
'--eventcontent' : 'MINIAOD,NANOEDMAOD,DQM',
'--datatier' : 'MINIAOD,NANOAOD,DQMIO'
}])

steps['REMINIAOD_data2016_HIPM'] = merge([{'--era' : 'Run2_2016_HIPM,run2_miniAOD_80XLegacy'},steps['REMINIAOD_data2016']])
steps['REMINIAOD_data2016UL'] = merge([{'--era' : 'Run2_2016', '--procModifiers' : 'run2_miniAOD_UL_preSummer20'},steps['REMINIAOD_data2016']])
steps['REMININANO_data2016UL'] = merge([{'--era' : 'Run2_2016', '--procModifiers' : 'run2_miniAOD_UL_preSummer20'},steps['REMININANO_data2016']])
steps['REMINIAOD_data2016UL_HIPM'] = merge([{'--era' : 'Run2_2016_HIPM'},steps['REMINIAOD_data2016UL']])
steps['REMININANO_data2016UL_HIPM'] = merge([{'--era' : 'Run2_2016_HIPM,run2_nanoAOD_106Xv2,run3_nanoAOD_devel'},steps['REMININANO_data2016UL']])
steps['REMININANO_data2016UL_HIPM_met'] = merge([{'--era' : 'Run2_2016_HIPM,run2_nanoAOD_106Xv1,run3_nanoAOD_devel'},steps['REMININANO_data2016UL']])

stepReMiniAODData17 = merge([{'--era' : 'Run2_2017,run2_miniAOD_94XFall17'},steps['REMINIAOD_data2016']])
steps['REMINIAOD_data2017'] = stepReMiniAODData17
Expand Down
2 changes: 1 addition & 1 deletion Configuration/StandardSequences/python/Eras.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self):
'trackingLowPU', 'trackingPhase1', 'ctpps', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2021', 'trackingPhase2PU140','highBetaStar_2018',
'tracker_apv_vfp30_2016', 'pf_badHcalMitigationOff', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X',
'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016',
'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'run2_nanoAOD_106Xv2',
'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'run2_nanoAOD_106Xv2', 'run3_nanoAOD_devel',
'hcalHardcodeConditions', 'hcalSkipPacker',
'run2_HLTconditions_2016','run2_HLTconditions_2017','run2_HLTconditions_2018',
'bParking']
Expand Down
32 changes: 32 additions & 0 deletions PhysicsTools/NanoAOD/python/electrons_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,38 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints):
electronTablesTask = cms.Task(electronMVATTH, electronTable)
electronMCTask = cms.Task(tautaggerForMatching, matchingElecPhoton, electronsMCMatchForTable, electronsMCMatchForTableAlt, electronMCTable)

## TEMPORARY as no ID for Run3 yet
(run3_nanoAOD_devel).toReplaceWith(electronTask, electronTask.copyAndExclude([bitmapVIDForEle,bitmapVIDForEleHEEP]))
(run3_nanoAOD_devel).toModify(slimmedElectronsWithUserData, userIntFromBools = cms.PSet())
(run3_nanoAOD_devel).toModify(slimmedElectronsWithUserData.userInts,
VIDNestedWPBitmap = None,
VIDNestedWPBitmapHEEP = None)
(run3_nanoAOD_devel).toModify(slimmedElectronsWithUserData.userFloats,
mvaFall17V1Iso = None,
mvaFall17V1noIso = None,
mvaFall17V2Iso = None,
mvaFall17V2noIso = None,
)
(run3_nanoAOD_devel).toModify(electronTable.variables,
mvaFall17V2Iso = None,
mvaFall17V2Iso_WP80 = None,
mvaFall17V2Iso_WP90 = None,
mvaFall17V2Iso_WPL = None,
mvaFall17V2noIso = None,
mvaFall17V2noIso_WP80 = None,
mvaFall17V2noIso_WP90 = None,
mvaFall17V2noIso_WPL = None,
vidNestedWPBitmapHEEP = None,
vidNestedWPBitmap = None,
cutBased = None,
cutBased_HEEP = None,
)

(run3_nanoAOD_devel).toReplaceWith(electronTablesTask, electronTablesTask.copyAndExclude([electronMVATTH]))
(run3_nanoAOD_devel).toModify(electronTable, externalVariables = None)
##### end TEMPORARY Run3


#for NANO from reminAOD, no need to run slimmedElectronsUpdated, other modules of electron sequence will run on slimmedElectrons
for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1:
modifier.toModify(bitmapVIDForEle, src = "slimmedElectronsUpdated")
Expand Down
39 changes: 24 additions & 15 deletions PhysicsTools/NanoAOD/python/jets_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,14 +719,19 @@
pileupJetId106XUL18=pileupJetId.clone(jets="updatedJets",algos = cms.VPSet(_chsalgos_106X_UL18),inputIsCorrected=True,applyJec=False,vertexes="offlineSlimmedPrimaryVertices")

#before cross linking
jetSequence = cms.Sequence(jetCorrFactorsNano+updatedJets+tightJetId+tightJetIdLepVeto+bJetVars+qgtagger+jercVars+pileupJetId94X+pileupJetId102X+pileupJetId106XUL16+pileupJetId106XUL16APV+pileupJetId106XUL17+pileupJetId106XUL18+updatedJetsWithUserData+jetCorrFactorsAK8+updatedJetsAK8+tightJetIdAK8+tightJetIdLepVetoAK8+updatedJetsAK8WithUserData+chsForSATkJets+softActivityJets+softActivityJets2+softActivityJets5+softActivityJets10+finalJets+finalJetsAK8)
jetUserDataTask = cms.Task(bJetVars, qgtagger, jercVars, tightJetId, tightJetIdLepVeto, pileupJetId94X, pileupJetId102X, pileupJetId106XUL16,pileupJetId106XUL16APV,pileupJetId106XUL17,pileupJetId106XUL18)
jetAK8UserDataTask = cms.Task(tightJetIdAK8,tightJetIdLepVetoAK8)

_jetUserDataTask2016 = jetUserDataTask.copy()
_jetUserDataTask2016.add(looseJetId)
_jetAK8UserDataTask2016 = jetAK8UserDataTask.copy()
_jetAK8UserDataTask2016.add(looseJetIdAK8)

_jetSequence_2016 = jetSequence.copy()
_jetSequence_2016.insert(_jetSequence_2016.index(tightJetId), looseJetId)
_jetSequence_2016.insert(_jetSequence_2016.index(tightJetIdAK8), looseJetIdAK8)
for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
modifier.toReplaceWith(jetSequence, _jetSequence_2016)
modifier.toReplaceWith(jetUserDataTask,_jetUserDataTask2016)
modifier.toReplaceWith(jetAK8UserDataTask,_jetAK8UserDataTask2016)

softActivityTask = cms.Task(chsForSATkJets,softActivityJets,softActivityJets2,softActivityJets5,softActivityJets10)

#HF shower shape recomputation
#Only run if needed (i.e. if default MINIAOD info is missing or outdated because of new JECs...)
Expand All @@ -745,22 +750,26 @@
modifier.toModify( jetTable.variables, hfsigmaPhiPhi = Var("userFloat('hfsigmaPhiPhi')",float,doc="sigmaPhiPhi for HF jets (noise discriminating variable)",precision=10))
modifier.toModify( jetTable.variables, hfcentralEtaStripSize = Var("userInt('hfcentralEtaStripSize')", int, doc="eta size of the central tower strip in HF (noise discriminating variable) "))
modifier.toModify( jetTable.variables, hfadjacentEtaStripsSize = Var("userInt('hfadjacentEtaStripsSize')", int, doc="eta size of the strips next to the central tower strip in HF (noise discriminating variable) "))
_jetSequence_rerunHFshowershape = jetSequence.copy()
_jetSequence_rerunHFshowershape.insert(_jetSequence_rerunHFshowershape.index(updatedJetsWithUserData), hfJetShowerShapeforNanoAOD)
modifier.toReplaceWith(jetSequence, _jetSequence_rerunHFshowershape)
modifier.toModify(jetUserDataTask, jetUserDataTask.add(hfJetShowerShapeforNanoAOD))

#before cross linking
jetTask = cms.Task(jetCorrFactorsNano,updatedJets,jetUserDataTask,updatedJetsWithUserData,jetCorrFactorsAK8,updatedJetsAK8,jetAK8UserDataTask,updatedJetsAK8WithUserData,softActivityTask,finalJets,finalJetsAK8)

#after lepton collections have been run
jetLepSequence = cms.Sequence(lepInJetVars)
jetLepTask = cms.Task(lepInJetVars)

#after cross linkining
jetTables = cms.Sequence(bjetNN+cjetNN+jetTable+fatJetTable+subJetTable+saJetTable+saTable)
jetTablesTask = cms.Task(bjetNN,cjetNN,jetTable,fatJetTable,subJetTable,saJetTable,saTable)

#MC only producers and tables
jetMC = cms.Sequence(jetMCTable+genJetTable+patJetPartonsNano+genJetFlavourTable+genJetAK8Table+genJetAK8FlavourAssociation+genJetAK8FlavourTable+fatJetMCTable+genSubJetAK8Table+subjetMCTable)
_jetMC_pre94X = jetMC.copy()
_jetMC_pre94X.insert(_jetMC_pre94X.index(genJetFlavourTable),genJetFlavourAssociation)
_jetMC_pre94X.remove(genSubJetAK8Table)
run2_miniAOD_80XLegacy.toReplaceWith(jetMC, _jetMC_pre94X)
jetMCTaskak4 = cms.Task(jetMCTable,genJetTable,patJetPartonsNano,genJetFlavourTable)
jetMCTaskak8 = cms.Task(genJetAK8Table,genJetAK8FlavourAssociation,genJetAK8FlavourTable,fatJetMCTable,genSubJetAK8Table,subjetMCTable)
jetMCTask = jetMCTaskak4.copy()
jetMCTask.add(jetMCTaskak8)

_jetMCTaskak8 = jetMCTaskak8.copyAndExclude([genSubJetAK8Table])

_jetMC_pre94XTask = jetMCTaskak4.copy()
_jetMC_pre94XTask.add(genJetFlavourAssociation)
_jetMC_pre94XTask.add(_jetMCTaskak8)
run2_miniAOD_80XLegacy.toReplaceWith(jetMCTask, _jetMC_pre94XTask)
12 changes: 5 additions & 7 deletions PhysicsTools/NanoAOD/python/met_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,9 @@
)



metTables = cms.Sequence( metTable + rawMetTable + caloMetTable + puppiMetTable + rawPuppiMetTable+ tkMetTable + chsMetTable)
deepMetTables = cms.Sequence( deepMetResolutionTuneTable + deepMetResponseTuneTable )
_withFixEE2017_sequence = cms.Sequence(metTables.copy() + metFixEE2017Table)
metTablesTask = cms.Task( metTable, rawMetTable, caloMetTable, puppiMetTable, rawPuppiMetTable, tkMetTable, chsMetTable)
deepMetTablesTask = cms.Task( deepMetResolutionTuneTable, deepMetResponseTuneTable )
_withFixEE2017_task = cms.Task(metTablesTask.copy(), metFixEE2017Table)
for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
modifier.toReplaceWith(metTables,_withFixEE2017_sequence) # only in old miniAOD, the new ones will come from the UL rereco
metMC = cms.Sequence( metMCTable )

modifier.toReplaceWith(metTablesTask,_withFixEE2017_task) # only in old miniAOD, the new ones will come from the UL rereco
metMCTask = cms.Task( metMCTable )
3 changes: 3 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,7 @@
verboseQT = cms.untracked.bool(True)
)

(run3_nanoAOD_devel).toModify(nanoDQM.vplots, Electron = None)
(run3_nanoAOD_devel).toModify(nanoDQMMC.vplots, Electron = None)

nanoHarvest = cms.Sequence( nanoDQMQTester )
Loading

0 comments on commit e864342

Please sign in to comment.