Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@
_fatjet_plots_106Xv1.append(plot)
(run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(nanoDQM.vplots.FatJet, plots = _fatjet_plots_106Xv1 )

_prefire_plots_nom = copy.deepcopy(nanoDQM.vplots.L1PreFiringWeight.plots)
_prefire_plots_106Xv1 = cms.VPSet()
for plot in _prefire_plots_nom:
if (not "Muon" in plot.name.value() and not "ECAL" in plot.name.value()):
_prefire_plots_106Xv1.append(plot)
(run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(nanoDQM.vplots.L1PreFiringWeight, plots = _prefire_plots_106Xv1 )



## MC
nanoDQMMC = nanoDQM.clone()
Expand Down
11 changes: 11 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,5 +809,16 @@
Plot1D('rawMVAoldDMdR032017v2', 'rawMVAoldDMdR032017v2', 20, -1, 1, 'byIsolationMVArun2017v2DBoldDMdR0p3wLT raw output discriminator (2017v2)'),
)
),
L1PreFiringWeight = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Plot1D('Nom', 'Nom', 21, 0.8, 1.01, 'L1 prefiring weight nominal'),
Plot1D('Up', 'Up', 21, 0.8, 1.01, 'L1 prefiring weight uncertainy up'),
Plot1D('Dn', 'Dn', 21, 0.8, 1.01, 'L1 prefiring weight uncertainty down'),
Plot1D('ECAL_Nom', 'ECAL_Nom', 21, 0.8, 1.01, 'L1 prefiring weight for ECAL objects nominal'),
Plot1D('Muon_Nom', 'Muon_Nom', 21, 0.8, 1.01, 'L1 prefiring weight for muons nominal'),
)

),
)
)
5 changes: 5 additions & 0 deletions PhysicsTools/NanoAOD/python/nano_eras_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
from Configuration.Eras.Modifier_run2_jme_2017_cff import run2_jme_2017
from Configuration.Eras.Modifier_run2_muon_2016_cff import run2_muon_2016
from Configuration.Eras.Modifier_run2_muon_2018_cff import run2_muon_2018

from Configuration.Eras.Modifier_run2_tau_ul_2016_cff import run2_tau_ul_2016
from Configuration.Eras.Modifier_run2_tau_ul_2018_cff import run2_tau_ul_2018

from Configuration.Eras.Modifier_run2_HLTconditions_2016_cff import run2_HLTconditions_2016
from Configuration.Eras.Modifier_run2_HLTconditions_2017_cff import run2_HLTconditions_2017
from Configuration.Eras.Modifier_run2_HLTconditions_2018_cff import run2_HLTconditions_2018

from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
from Configuration.Eras.Modifier_run2_nanoAOD_92X_cff import run2_nanoAOD_92X
from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv1_cff import run2_nanoAOD_94XMiniAODv1
Expand Down
47 changes: 37 additions & 10 deletions PhysicsTools/NanoAOD/python/triggerObjects_cff.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Modifier_run2_HLTconditions_2016_cff import run2_HLTconditions_2016
from Configuration.Eras.Modifier_run2_HLTconditions_2017_cff import run2_HLTconditions_2017
from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
from PhysicsTools.NanoAOD.common_cff import ExtVar
from PhysicsTools.NanoAOD.nano_eras_cff import *
from PhysicsTools.NanoAOD.common_cff import *
import copy

unpackedPatTrigger = cms.EDProducer("PATTriggerObjectStandAloneUnpacker",
Expand Down Expand Up @@ -218,19 +216,48 @@
selections = selections2016
)

from PhysicsTools.PatUtils.L1ECALPrefiringWeightProducer_cff import prefiringweight
run2_HLTconditions_2016.toModify(prefiringweight, DataEra = cms.string("2016BtoH"))
from PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff import prefiringweight
#Next lines are for UL2016 maps
(run2_muon_2016 & tracker_apv_vfp30_2016).toModify( prefiringweight, DataEraECAL = cms.string("UL2016preVFP"), DataEraMuon = cms.string("2016preVFP"))
(run2_muon_2016 & ~tracker_apv_vfp30_2016).toModify( prefiringweight, DataEraECAL = cms.string("UL2016postVFP"), DataEraMuon = cms.string("2016postVFP"))
#Next line is for UL2017 maps
run2_jme_2017.toModify( prefiringweight, DataEraECAL = cms.string("UL2017BtoF"), DataEraMuon = cms.string("20172018"))
#Next line is for UL2018 maps
run2_muon_2018.toModify( prefiringweight, DataEraECAL = cms.string("None"), DataEraMuon = cms.string("20172018"))

#For pre-UL 2017 reprocessing, one should use the original maps and no muon jet protection
for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
modifier.toModify( prefiringweight, DataEraECAL = cms.string("2017BtoF"), DataEraMuon = cms.string("20172018"))
modifier.toModify( prefiringweight, JetMaxMuonFraction = cms.double(-1.) )
#For pre-UL 2016 reprocessing, same thing
run2_nanoAOD_94X2016.toModify( prefiringweight, DataEraECAL = cms.string("2016BtoH"), DataEraMuon = cms.string("2016") )
run2_nanoAOD_94X2016.toModify( prefiringweight, JetMaxMuonFraction = cms.double(-1.) )

l1PreFiringEventWeightTable = cms.EDProducer("GlobalVariablesTableProducer",
name = cms.string("L1PreFiringWeight"),
variables = cms.PSet(
L1PreFiringWeight_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProb"), "double", doc = "L1 pre-firing event correction weight (1-probability)", precision=8),
L1PreFiringWeight_Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbUp"), "double", doc = "L1 pre-firing event correction weight (1-probability), up var.", precision=8),
L1PreFiringWeight_Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbDown"), "double", doc = "L1 pre-firing event correction weight (1-probability), down var.", precision=8),
Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProb"), "double", doc = "L1 pre-firing event correction weight (1-probability)", precision=8),
Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbUp"), "double", doc = "L1 pre-firing event correction weight (1-probability), up var.", precision=8),
Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbDown"), "double", doc = "L1 pre-firing event correction weight (1-probability), down var.", precision=8),
Muon_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuon"), "double", doc = "Muon L1 pre-firing event correction weight (1-probability)", precision=8),
Muon_SystUp = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonSystUp"), "double", doc = "Muon L1 pre-firing event correction weight (1-probability), up var. syst.", precision=8),
Muon_SystDn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonSystDown"), "double", doc = "Muon L1 pre-firing event correction weight (1-probability), down var. syst.", precision=8),
Muon_StatUp = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonStatUp"), "double", doc = "Muon L1 pre-firing event correction weight (1-probability), up var. stat.", precision=8),
Muon_StatDn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonStatDown"), "double", doc = "Muon L1 pre-firing event correction weight (1-probability), down var. stat.", precision=8),
ECAL_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECAL"), "double", doc = "ECAL L1 pre-firing event correction weight (1-probability)", precision=8),
ECAL_Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECALUp"), "double", doc = "ECAL L1 pre-firing event correction weight (1-probability), up var.", precision=8),
ECAL_Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECALDown"), "double", doc = "ECAL L1 pre-firing event correction weight (1-probability), down var.", precision=8),
)
)

triggerObjectTables = cms.Sequence( unpackedPatTrigger + triggerObjectTable )

#protect nano V8 production from changes to prefiring weights introduce for V9
(run2_jme_2016 & run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(prefiringweight,DataEraECAL = cms.string("2016BtoH"))
(run2_jme_2017 & run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(prefiringweight,DataEraECAL = cms.string("2017BtoF"))
(run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(prefiringweight,DoMuons = cms.bool(False))
(run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(l1PreFiringEventWeightTable.variables , Muon_Nom = None, Muon_SystUp = None, Muon_SystDn = None, Muon_StatUp = None, Muon_StatDn = None, ECAL_Nom = None, ECAL_Up = None, ECAL_Dn = None)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mariadalfonso Here we remove the new prefiring weights from the nano event content for V8, so having empty histograms for them in DQM is expected. What I am a puzzled about is why the prefiring weight is 1, it should still reflect the ECAL prefiring. What workflow did you use for that test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhhh, now that we have the UL maps for ECAL, this might need a further protection for that year. @lathomas

_triggerObjectTables_withL1PreFiring = triggerObjectTables.copy()
_triggerObjectTables_withL1PreFiring.replace(triggerObjectTable, prefiringweight + l1PreFiringEventWeightTable + triggerObjectTable)
(run2_HLTconditions_2016 | run2_HLTconditions_2017).toReplaceWith(triggerObjectTables, _triggerObjectTables_withL1PreFiring)
(run2_HLTconditions_2016 | run2_HLTconditions_2017 | run2_HLTconditions_2018).toReplaceWith(triggerObjectTables, _triggerObjectTables_withL1PreFiring)
8 changes: 4 additions & 4 deletions PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,11 @@ def miniAOD_customizeCommon(process):

# L1 pre-firing weights for 2016 and 2017
from Configuration.Eras.Modifier_run2_L1prefiring_cff import run2_L1prefiring
from Configuration.Eras.Modifier_stage1L1Trigger_cff import stage1L1Trigger
from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017
process.load("PhysicsTools.PatUtils.L1ECALPrefiringWeightProducer_cff")
stage1L1Trigger.toModify(process.prefiringweight, DataEra = "2016BtoH")
stage2L1Trigger_2017.toModify(process.prefiringweight, DataEra = "2017BtoF")
process.load("PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff")
stage2L1Trigger.toModify(process.prefiringweight, DataEraECAL = "2017BtoF", JetMaxMuonFraction = -1, DoMuons = cms.bool(False) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the era correct here ("2017BtoF")?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to reproduce the configuration previous to this PR to comply with the rule forbidding changes to RECO, yes. (these 2017 maps were also mistakenly picked previously for 2016 ...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to reproduce the configuration previous to this PR to comply with the rule forbidding changes to RECO, yes. (these 2017 maps were also mistakenly picked previously for 2016 ...)

Ok, thank you!

stage2L1Trigger_2017.toModify(process.prefiringweight, DataEraECAL = "2017BtoF", JetMaxMuonFraction = -1, DoMuons = cms.bool(False))
Comment on lines -559 to +561
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this suppose to lead to any changes in the production miniAOD (especially UL)?
I see no differences in cms-bot reco comparisons, but we do not have UL miniAOD tests for 2016 and 2017 in these comparisons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is specifically set to prevent any changes to miniAOD by deactivating the new features and using the pre-UL ECAL maps.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to have something set for the stage2L1Trigger_2018?
this is what is done in master
https://github.com/cms-sw/cmssw/pull/33758/files#diff-c1409af99a0dfee10534eb0c4e985d3b4dd669b5c81cd302efdf760ee0ce5c41R550

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same rule of not changing the miniAOD output applies here, not thing was set for 2018 before, so we set nothing now.

run2_L1prefiring.toModify(task, func=lambda t: t.add(process.prefiringweight))

def miniAOD_customizeMC(process):
Expand Down
226 changes: 0 additions & 226 deletions PhysicsTools/PatUtils/plugins/L1ECALPrefiringWeightProducer.cc

This file was deleted.

Loading