From 5dd026ac971b7ced8132150a3816741b775311ec Mon Sep 17 00:00:00 2001 From: Dennis Roy Date: Mon, 31 Jul 2023 16:12:39 +0200 Subject: [PATCH 1/5] Changes for Tau-embedded samples --- .../crab/overseer_cfg_embeddedSamples.yaml | 45 +++++++++++++++++++ NanoProd/python/customize.py | 37 +++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 NanoProd/crab/overseer_cfg_embeddedSamples.yaml diff --git a/NanoProd/crab/overseer_cfg_embeddedSamples.yaml b/NanoProd/crab/overseer_cfg_embeddedSamples.yaml new file mode 100644 index 0000000..0b99959 --- /dev/null +++ b/NanoProd/crab/overseer_cfg_embeddedSamples.yaml @@ -0,0 +1,45 @@ +cmsswPython: RunKit/nanoProdWrapper.py +params: + customise: NanoProd/NanoProd/customize.customizeEmbedding + skimCfg: skim_htt.yaml + skimSetup: skim + skimSetupFailed: skim_failed + maxEvents: -1 + inputDBS: phys03 +splitting: FileBased +unitsPerJob: 8 +scriptExe: RunKit/crabJob.sh +outputFiles: + - nano.root +filesToTransfer: + - RunKit/crabJob.sh + - RunKit/crabJob.py + - RunKit/crabJob_nanoProd.py + - RunKit/skim_tree.py + - RunKit/sh_tools.py + - NanoProd/config/skim_htt.yaml + - NanoProd/python/customize.py +site: T2_CH_CERN +crabOutput: /store/group/phys_tau/irandreo/Run3_22_prod +finalOutput: /eos/cms/store/group/phys_tau/irandreo/Run3_22 +localCrabOutput: /eos/cms/store/group/phys_tau/irandreo/Run3_22_prod +maxMemory: 2500 +numCores: 1 +inputDBS: phys03 +allowNonValid: False +dryrun: False +maxRecoveryCount: 3 +updateInterval: 60 +localProcessing: + lawTask: ProdTask + workflow: htcondor + bootstrap: bootstrap.sh +# requirements: ( (OpSysAndVer =?= "CentOS7") || (OpSysAndVer =?= "CentOS8") ) +targetOutputFileSize: 2048 +renewKerberosTicket: True +whitelistFinalRecovery: + - T1_DE_KIT + - T2_CH_CERN + - T2_DE_DESY + - T2_IT_Legnaro + - T3_CH_PSI diff --git a/NanoProd/python/customize.py b/NanoProd/python/customize.py index 2a5bbd3..68dfff5 100644 --- a/NanoProd/python/customize.py +++ b/NanoProd/python/customize.py @@ -50,3 +50,40 @@ def customize(process): process = customizeGenParticles(process) process = customizeTaus(process) return process + +def customizeEmbedding(process): + process.nanoAOD_step = cms.Path( cms.Sequence( process.nanoSequenceCommon + process.nanoSequenceOnlyData + process.nanoSequenceOnlyFullSim + cms.Sequence(cms.Task(process.genParticleTask, process.particleLevelTask, process.jetMCTaskak4, process.muonMCTask, process.electronMCTask, process.photonMCTask, process.tauMCTask, process.boostedTauMCTask, process.ttbarCatMCProducersTask, process.globalTablesMCTask, process.genWeightsTableTask, process.genVertexTablesTask, process.genParticleTablesTask, process.particleLevelTablesTask)) ) ) + + process.linkedObjects.lowPtElectrons = cms.InputTag("finalElectrons") + process.jetMCTaskak4.remove(process.genJetFlavourTable) + process.nanoSequenceCommon.remove(process.lowPtElectronTablesTask) + process.globalTablesMCTask.remove(process.genFilterTable) + + # Get embedded data + process.unpackedPatTrigger.triggerResults = cms.InputTag("TriggerResults::SIMembeddingHLT") + process.NANOAODSIMoutput.outputCommands.append("keep edmTriggerResults_*_*_SIMembeddingHLT") + process.NANOAODSIMoutput.outputCommands.append("keep edmTriggerResults_*_*_MERGE") + process.NANOAODSIMoutput.outputCommands.remove("keep edmTriggerResults_*_*_*") + process.genParticles2HepMC.genEventInfo = cms.InputTag("generator", "", "SIMembeddingpreHLT") + process.puppiMetTable.src = cms.InputTag("slimmedMETsPuppi", "", "RERUNPUPPI") + process.rawPuppiMetTable.src = cms.InputTag("slimmedMETsPuppi", "", "RERUNPUPPI") + process.updatedJetsPuppi.jetSource = cms.InputTag("slimmedJetsPuppi", "", "MERGE") + process.jetPuppiCorrFactorsNano.src = cms.InputTag("slimmedJetsPuppi", "", "MERGE") + + # Add HF jet shape info (https://github.com/cms-sw/cmssw/blob/CMSSW_10_6_30/PhysicsTools/NanoAOD/python/jets_cff.py#L741-L759) + from RecoJets.JetProducers.hfJetShowerShape_cfi import hfJetShowerShape + process.hfJetShowerShapeforNanoAOD = hfJetShowerShape.clone(jets="updatedJets",vertices="offlineSlimmedPrimaryVertices") + process.updatedJetsWithUserData.userFloats.hfsigmaEtaEta = cms.InputTag('hfJetShowerShapeforNanoAOD:sigmaEtaEta') + process.updatedJetsWithUserData.userFloats.hfsigmaPhiPhi = cms.InputTag('hfJetShowerShapeforNanoAOD:sigmaPhiPhi') + process.updatedJetsWithUserData.userInts.hfcentralEtaStripSize = cms.InputTag('hfJetShowerShapeforNanoAOD:centralEtaStripSize') + process.updatedJetsWithUserData.userInts.hfadjacentEtaStripsSize = cms.InputTag('hfJetShowerShapeforNanoAOD:adjacentEtaStripsSize') + process.jetTable.variables.hfsigmaEtaEta = Var("userFloat('hfsigmaEtaEta')",float,doc="sigmaEtaEta for HF jets (noise discriminating variable)",precision=10) + process.jetTable.variables.hfsigmaPhiPhi = Var("userFloat('hfsigmaPhiPhi')",float,doc="sigmaPhiPhi for HF jets (noise discriminating variable)",precision=10) + process.jetTable.variables.hfcentralEtaStripSize = Var("userInt('hfcentralEtaStripSize')", int, doc="eta size of the central tower strip in HF (noise discriminating variable) ") + process.jetTable.variables.hfadjacentEtaStripsSize = Var("userInt('hfadjacentEtaStripsSize')", int, doc="eta size of the strips next to the central tower strip in HF (noise discriminating variable) ") + _jetTask_rerunHFshowershape = process.jetTask.copy() + _jetTask_rerunHFshowershape.add(process.hfJetShowerShapeforNanoAOD) + process.jetTask = _jetTask_rerunHFshowershape + + process = customize(process) + return process From 1a1971deeb6d2b303705ebc192dc5b3093059641 Mon Sep 17 00:00:00 2001 From: Dennis Roy Date: Wed, 16 Aug 2023 13:04:59 +0200 Subject: [PATCH 2/5] Add filelists for Run2 embedded samples --- NanoProd/crab/Run2_2016/Embedded.yaml | 24 ++++++++++ NanoProd/crab/Run2_2016_HIPM/Embedded.yaml | 32 +++++++++++++ NanoProd/crab/Run2_2017/Embedded.yaml | 32 +++++++++++++ NanoProd/crab/Run2_2018/Embedded.yaml | 28 ++++++++++++ .../crab/overseer_cfg_embeddedSamples.yaml | 45 ------------------- 5 files changed, 116 insertions(+), 45 deletions(-) create mode 100644 NanoProd/crab/Run2_2016/Embedded.yaml create mode 100644 NanoProd/crab/Run2_2016_HIPM/Embedded.yaml create mode 100644 NanoProd/crab/Run2_2017/Embedded.yaml create mode 100644 NanoProd/crab/Run2_2018/Embedded.yaml delete mode 100644 NanoProd/crab/overseer_cfg_embeddedSamples.yaml diff --git a/NanoProd/crab/Run2_2016/Embedded.yaml b/NanoProd/crab/Run2_2016/Embedded.yaml new file mode 100644 index 0000000..f7b572e --- /dev/null +++ b/NanoProd/crab/Run2_2016/Embedded.yaml @@ -0,0 +1,24 @@ +config: + params: + sampleType: data + era: Run2_2016 + storeFailed: False + customise: NanoProd/NanoProd/customize.customizeEmbedding + PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputDBS: phys03 + +Embed_MuTau_Run2017F: /EmbeddingRun2016_F/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2017G: /EmbeddingRun2016_G/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2017H: /EmbeddingRun2016_H/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElTau_Run2017F: /EmbeddingRun2016_F/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2017G: /EmbeddingRun2016_G/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2017H: /EmbeddingRun2016_H/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_TauTau_Run2017F: /EmbeddingRun2016_F/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2017G: /EmbeddingRun2016_G/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2017H: /EmbeddingRun2016_H/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElMu_Run2017F: /EmbeddingRun2016_F/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2017G: /EmbeddingRun2016_G/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2017H: /EmbeddingRun2016_H/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml b/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml new file mode 100644 index 0000000..37750e9 --- /dev/null +++ b/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml @@ -0,0 +1,32 @@ +config: + params: + sampleType: data + era: Run2_2016_HIPM + storeFailed: False + customise: NanoProd/NanoProd/customize.customizeEmbedding + PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputDBS: phys03 + +Embed_MuTau_Run2016B: /EmbeddingRun2016-HIPM_B_ver2/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016C: /EmbeddingRun2016-HIPM_C/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016D: /EmbeddingRun2016-HIPM_D/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016E: /EmbeddingRun2016-HIPM_E/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016F: /EmbeddingRun2016-HIPM_F/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElTau_Run2016B: /EmbeddingRun2016-HIPM_B_ver2/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016C: /EmbeddingRun2016-HIPM_C/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016D: /EmbeddingRun2016-HIPM_D/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016E: /EmbeddingRun2016-HIPM_E/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016F: /EmbeddingRun2016-HIPM_F/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_TauTau_Run2016B: /EmbeddingRun2016-HIPM_B_ver2/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016C: /EmbeddingRun2016-HIPM_C/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016D: /EmbeddingRun2016-HIPM_D/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016E: /EmbeddingRun2016-HIPM_E/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016F: /EmbeddingRun2016-HIPM_F/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElMu_Run2016B: /EmbeddingRun2016-HIPM_B_ver2/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016C: /EmbeddingRun2016-HIPM_C/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016D: /EmbeddingRun2016-HIPM_D/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016E: /EmbeddingRun2016-HIPM_E/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016F: /EmbeddingRun2016-HIPM_F/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/Run2_2017/Embedded.yaml b/NanoProd/crab/Run2_2017/Embedded.yaml new file mode 100644 index 0000000..2b4a2c7 --- /dev/null +++ b/NanoProd/crab/Run2_2017/Embedded.yaml @@ -0,0 +1,32 @@ +config: + params: + sampleType: data + era: Run2_2017 + storeFailed: False + customise: NanoProd/NanoProd/customize.customizeEmbedding + PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputDBS: phys03 + +Embed_MuTau_Run2017B: /EmbeddingRun2017B/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2017C: /EmbeddingRun2017C/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2017D: /EmbeddingRun2017D/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2017E: /EmbeddingRun2017E/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2017F: /EmbeddingRun2017F/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElTau_Run2017B: /EmbeddingRun2017B/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2017C: /EmbeddingRun2017C/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2017D: /EmbeddingRun2017D/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2017E: /EmbeddingRun2017E/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2017F: /EmbeddingRun2017F/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_TauTau_Run2017B: /EmbeddingRun2017B/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2017C: /EmbeddingRun2017C/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2017D: /EmbeddingRun2017D/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2017E: /EmbeddingRun2017E/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2017F: /EmbeddingRun2017F/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElMu_Run2017B: /EmbeddingRun2017B/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2017C: /EmbeddingRun2017C/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2017D: /EmbeddingRun2017D/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2017E: /EmbeddingRun2017E/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2017F: /EmbeddingRun2017F/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/Run2_2018/Embedded.yaml b/NanoProd/crab/Run2_2018/Embedded.yaml new file mode 100644 index 0000000..f4213c7 --- /dev/null +++ b/NanoProd/crab/Run2_2018/Embedded.yaml @@ -0,0 +1,28 @@ +config: + params: + sampleType: data + era: Run2_2018 + storeFailed: False + customise: NanoProd/NanoProd/customize.customizeEmbedding + PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputDBS: phys03 + +Embed_MuTau_Run2018A: /EmbeddingRun2018A/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2018B: /EmbeddingRun2018B/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2018C: /EmbeddingRun2018C/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2018D: /EmbeddingRun2018D/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElTau_Run2018A: /EmbeddingRun2018A/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2018B: /EmbeddingRun2018B/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2018C: /EmbeddingRun2018C/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2018D: /EmbeddingRun2018D/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_TauTau_Run2018A: /EmbeddingRun2018A/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2018B: /EmbeddingRun2018B/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2018C: /EmbeddingRun2018C/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2018D: /EmbeddingRun2018D/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER + +Embed_ElMu_Run2018A: /EmbeddingRun2018A/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2018B: /EmbeddingRun2018B/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2018C: /EmbeddingRun2018C/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2018D: /EmbeddingRun2018D/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/overseer_cfg_embeddedSamples.yaml b/NanoProd/crab/overseer_cfg_embeddedSamples.yaml deleted file mode 100644 index 0b99959..0000000 --- a/NanoProd/crab/overseer_cfg_embeddedSamples.yaml +++ /dev/null @@ -1,45 +0,0 @@ -cmsswPython: RunKit/nanoProdWrapper.py -params: - customise: NanoProd/NanoProd/customize.customizeEmbedding - skimCfg: skim_htt.yaml - skimSetup: skim - skimSetupFailed: skim_failed - maxEvents: -1 - inputDBS: phys03 -splitting: FileBased -unitsPerJob: 8 -scriptExe: RunKit/crabJob.sh -outputFiles: - - nano.root -filesToTransfer: - - RunKit/crabJob.sh - - RunKit/crabJob.py - - RunKit/crabJob_nanoProd.py - - RunKit/skim_tree.py - - RunKit/sh_tools.py - - NanoProd/config/skim_htt.yaml - - NanoProd/python/customize.py -site: T2_CH_CERN -crabOutput: /store/group/phys_tau/irandreo/Run3_22_prod -finalOutput: /eos/cms/store/group/phys_tau/irandreo/Run3_22 -localCrabOutput: /eos/cms/store/group/phys_tau/irandreo/Run3_22_prod -maxMemory: 2500 -numCores: 1 -inputDBS: phys03 -allowNonValid: False -dryrun: False -maxRecoveryCount: 3 -updateInterval: 60 -localProcessing: - lawTask: ProdTask - workflow: htcondor - bootstrap: bootstrap.sh -# requirements: ( (OpSysAndVer =?= "CentOS7") || (OpSysAndVer =?= "CentOS8") ) -targetOutputFileSize: 2048 -renewKerberosTicket: True -whitelistFinalRecovery: - - T1_DE_KIT - - T2_CH_CERN - - T2_DE_DESY - - T2_IT_Legnaro - - T3_CH_PSI From aff6fe31b0a0eb3c78530bc8d82e322e5050359f Mon Sep 17 00:00:00 2001 From: Dennis Roy Date: Mon, 11 Sep 2023 12:08:28 +0200 Subject: [PATCH 3/5] Add missing MET filters for embedded samples --- NanoProd/python/customize.py | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/NanoProd/python/customize.py b/NanoProd/python/customize.py index 68dfff5..7bd491a 100644 --- a/NanoProd/python/customize.py +++ b/NanoProd/python/customize.py @@ -52,6 +52,45 @@ def customize(process): return process def customizeEmbedding(process): + # Add missing "BadPFMuonDz" and "hfNoisyHits" MET filter + from RecoMET.METFilters.BadPFMuonDzFilter_cfi import BadPFMuonDzFilter + process.BadPFMuonFilterUpdateDz=BadPFMuonDzFilter.clone( + muons = cms.InputTag("slimmedMuons"), + vtx = cms.InputTag("offlineSlimmedPrimaryVertices"), + PFCandidates = cms.InputTag("packedPFCandidates"), + minDzBestTrack = cms.double(0.5), + taggingMode = cms.bool(True) + ) + process.BadPFMuonFilterUpdateDz_step = cms.Path(process.BadPFMuonFilterUpdateDz) + from RecoMET.METFilters.metFilters_cff import hfNoisyHitsFilter + process.hfNoisyHitsFilter=hfNoisyHitsFilter.clone( + hfrechits = cms.InputTag("slimmedHcalRecHits:reducedHcalRecHits") + ) + process.hfNoisyHitsFilter_step = cms.Path(process.hfNoisyHitsFilter) + process.schedule.insert(0,process.BadPFMuonFilterUpdateDz_step) + process.schedule.insert(1,process.hfNoisyHitsFilter_step) + process.extraFlagsTable = cms.EDProducer("GlobalVariablesTableProducer", + extension = cms.bool(False), + mightGet = cms.optional.untracked.vstring, + name = cms.string(''), + variables = cms.PSet( + Flag_BadPFMuonDzFilter = cms.PSet( + doc = cms.string('Bad PF muon Dz flag'), + precision = cms.int32(-1), + src = cms.InputTag("BadPFMuonFilterUpdateDz"), + type = cms.string('bool') + ), + Flag_hfNoisyHitsFilter = cms.PSet( + doc = cms.string('HF noisy hits flag'), + precision = cms.int32(-1), + src = cms.InputTag("hfNoisyHitsFilter"), + type = cms.string('bool') + ) + ) + ) + process.extraFlagsTableTask = cms.Task(process.extraFlagsTable) # This is already integrated in process.nanoSequenceCommon + + # Define sequence process.nanoAOD_step = cms.Path( cms.Sequence( process.nanoSequenceCommon + process.nanoSequenceOnlyData + process.nanoSequenceOnlyFullSim + cms.Sequence(cms.Task(process.genParticleTask, process.particleLevelTask, process.jetMCTaskak4, process.muonMCTask, process.electronMCTask, process.photonMCTask, process.tauMCTask, process.boostedTauMCTask, process.ttbarCatMCProducersTask, process.globalTablesMCTask, process.genWeightsTableTask, process.genVertexTablesTask, process.genParticleTablesTask, process.particleLevelTablesTask)) ) ) process.linkedObjects.lowPtElectrons = cms.InputTag("finalElectrons") From cfe914cdf55f3d9010d5ce5ef005f73c5cc7f941 Mon Sep 17 00:00:00 2001 From: Dennis Roy Date: Fri, 28 Jun 2024 10:46:24 +0200 Subject: [PATCH 4/5] Fix paths to embedded samples --- NanoProd/crab/Run2_2016/Embedded.yaml | 27 +++++++++++----------- NanoProd/crab/Run2_2016_HIPM/Embedded.yaml | 3 +-- NanoProd/crab/Run2_2017/Embedded.yaml | 3 +-- NanoProd/crab/Run2_2018/Embedded.yaml | 3 +-- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/NanoProd/crab/Run2_2016/Embedded.yaml b/NanoProd/crab/Run2_2016/Embedded.yaml index f7b572e..ff611b7 100644 --- a/NanoProd/crab/Run2_2016/Embedded.yaml +++ b/NanoProd/crab/Run2_2016/Embedded.yaml @@ -2,23 +2,22 @@ config: params: sampleType: data era: Run2_2016 - storeFailed: False customise: NanoProd/NanoProd/customize.customizeEmbedding - PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputPFNSprefix: root://cmsdcache-kit-disk.gridka.de:1094/ inputDBS: phys03 -Embed_MuTau_Run2017F: /EmbeddingRun2016_F/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_MuTau_Run2017G: /EmbeddingRun2016_G/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_MuTau_Run2017H: /EmbeddingRun2016_H/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016F: /EmbeddingRun2016_F/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016G: /EmbeddingRun2016_G/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_MuTau_Run2016H: /EmbeddingRun2016_H/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_ElTau_Run2017F: /EmbeddingRun2016_F/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_ElTau_Run2017G: /EmbeddingRun2016_G/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_ElTau_Run2017H: /EmbeddingRun2016_H/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016F: /EmbeddingRun2016_F/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016G: /EmbeddingRun2016_G/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElTau_Run2016H: /EmbeddingRun2016_H/ElTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_TauTau_Run2017F: /EmbeddingRun2016_F/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_TauTau_Run2017G: /EmbeddingRun2016_G/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_TauTau_Run2017H: /EmbeddingRun2016_H/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016F: /EmbeddingRun2016_F/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016G: /EmbeddingRun2016_G/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_TauTau_Run2016H: /EmbeddingRun2016_H/TauTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_ElMu_Run2017F: /EmbeddingRun2016_F/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_ElMu_Run2017G: /EmbeddingRun2016_G/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER -Embed_ElMu_Run2017H: /EmbeddingRun2016_H/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016F: /EmbeddingRun2016_F/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016G: /EmbeddingRun2016_G/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER +Embed_ElMu_Run2016H: /EmbeddingRun2016_H/ElMuFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml b/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml index 37750e9..4a09ceb 100644 --- a/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml +++ b/NanoProd/crab/Run2_2016_HIPM/Embedded.yaml @@ -2,9 +2,8 @@ config: params: sampleType: data era: Run2_2016_HIPM - storeFailed: False customise: NanoProd/NanoProd/customize.customizeEmbedding - PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputPFNSprefix: root://cmsdcache-kit-disk.gridka.de:1094/ inputDBS: phys03 Embed_MuTau_Run2016B: /EmbeddingRun2016-HIPM_B_ver2/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/Run2_2017/Embedded.yaml b/NanoProd/crab/Run2_2017/Embedded.yaml index 2b4a2c7..702928a 100644 --- a/NanoProd/crab/Run2_2017/Embedded.yaml +++ b/NanoProd/crab/Run2_2017/Embedded.yaml @@ -2,9 +2,8 @@ config: params: sampleType: data era: Run2_2017 - storeFailed: False customise: NanoProd/NanoProd/customize.customizeEmbedding - PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputPFNSprefix: root://cmsdcache-kit-disk.gridka.de:1094/ inputDBS: phys03 Embed_MuTau_Run2017B: /EmbeddingRun2017B/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER diff --git a/NanoProd/crab/Run2_2018/Embedded.yaml b/NanoProd/crab/Run2_2018/Embedded.yaml index f4213c7..7100763 100644 --- a/NanoProd/crab/Run2_2018/Embedded.yaml +++ b/NanoProd/crab/Run2_2018/Embedded.yaml @@ -2,9 +2,8 @@ config: params: sampleType: data era: Run2_2018 - storeFailed: False customise: NanoProd/NanoProd/customize.customizeEmbedding - PFNSprefix: root://cmsxrootd-kit.gridka.de/ + inputPFNSprefix: root://cmsdcache-kit-disk.gridka.de:1094/ inputDBS: phys03 Embed_MuTau_Run2018A: /EmbeddingRun2018A/MuTauFinalState-inputDoubleMu_106X_ULegacy_miniAOD-v1/USER From b4671def9b94e3c259b5d110b1b7e09ff61156cd Mon Sep 17 00:00:00 2001 From: Dennis Roy Date: Fri, 28 Jun 2024 10:46:51 +0200 Subject: [PATCH 5/5] Add trigger filter bits for embedded samples --- NanoProd/python/customize.py | 77 ++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/NanoProd/python/customize.py b/NanoProd/python/customize.py index a4b0599..2f2c7d3 100644 --- a/NanoProd/python/customize.py +++ b/NanoProd/python/customize.py @@ -166,6 +166,83 @@ def customizeEmbedding(process): process.updatedJetsPuppi.jetSource = cms.InputTag("slimmedJetsPuppi", "", "MERGE") process.jetPuppiCorrFactorsNano.src = cms.InputTag("slimmedJetsPuppi", "", "MERGE") + # Embedding filter bits + # e-leg: + ''' + process.triggerObjectTable.selections[0].qualityBits = cms.string( + "filter(’*CaloIdLTrackIdLIsoVL*TrackIso*Filter’) + " \ + "2*filter(’hltEle*WPTight*TrackIsoFilter*’) + " \ + "4*filter(’hltEle*WPLoose*TrackIsoFilter’) + " \ + "8*filter(’*OverlapFilter*IsoEle*PFTau*’) + " \ + "16*filter(’hltEle*Ele*CaloIdLTrackIdLIsoVL*Filter’) + " \ + "32*filter(’hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*’)+ " \ + "64*filter(’hltOverlapFilterIsoEle*PFTau*’) + " \ + "128*filter(’hltEle*Ele*Ele*CaloIdLTrackIdLDphiLeg*Filter’) + " \ + "256*max(filter(’hltL3fL1Mu*DoubleEG*Filtered*’),filter(’hltMu*DiEle*CaloIdLTrackIdLElectronleg* Filter’)) + " \ + "512*max(filter(’hltL3fL1DoubleMu*EG*Filter*’),filter(’hltDiMu*Ele*CaloIdLTrackIdLElectronleg* Filter’)) + " \ + "1024*min(filter(’hltEle32L1DoubleEGWPTightGsfTrackIsoFilter’),filter(’hltEGL1SingleEGOrFilter’) ) + " \ + "2048*filter(’hltEle*CaloIdVTGsfTrkIdTGsfDphiFilter’) + " \ + "4096*path(’HLT_Ele*PFJet*’) + " \ + "8192*max(filter(’hltEG175HEFilter’),filter(’hltEG200HEFilter’)) + " \ + "16384*filter(’hltEle27WPTightGsfTrackIsoFilter’) + " \ + "32768*filter(’hltEle32WPTightGsfTrackIsoFilter’) + " \ + "65536*filter(’hltEle32L1DoubleEGWPTightGsfTrackIsoFilter’) + " \ + "131072*filter(’hltEGL1SingleEGOrFilter’) + " \ + "262144*filter(’hltEle35noerWPTightGsfTrackIsoFilter’) + " \ + "524288*filter(’hltEle24erWPTightGsfTrackIsoFilterForTau’)" + ) + ''' + # mu-leg: + ''' + process.triggerObjectTable.selections[2].qualityBits = cms.string( + "filter(’*RelTrkIsoVVLFiltered0p4’) + " \ + "2*filter(’hltL3crIso*Filtered0p07’) + " \ + "4*filter(’*OverlapFilterIsoMu*PFTau*’) + " \ + "8*max(filter(’hltL3crIsoL1*SingleMu*Filtered0p07’),filter(’hltL3crIsoL1sMu*Filtered0p07’)) + " \ + "16*filter(’hltDiMuon*Filtered*’) + " \ + "32*filter(’hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*’) + " \ + "64*filter(’hltOverlapFilterIsoMu*PFTau*’) + " \ + "128*filter(’hltL3fL1TripleMu*’) + " \ + "256*max(filter(’hltL3fL1DoubleMu*EG*Filtered*’),filter(’hltDiMu*Ele*CaloIdLTrackIdLElectronleg* Filter’)) + " \ + "512*max(filter(’hltL3fL1Mu*DoubleEG*Filtered*’),filter(’hltMu*DiEle*CaloIdLTrackIdLElectronleg* Filter’)) + " \ + "1024*max(filter(’hltL3fL1sMu*L3Filtered50*’),filter(’hltL3fL1sMu*TkFiltered50*’)) + " \ + "2048*max(filter(’hltL3fL1sMu*L3Filtered100*’),filter(’hltL3fL1sMu*TkFiltered100*’)) + " \ + "4096*filter(’hltL3crIsoL1sSingleMu22L1f0L2f10QL3f24QL3trkIsoFiltered0p07’) + " \ + "8192*filter(’hltL3crIsoL1sMu22Or25L1f0L2f10QL3f27QL3trkIsoFiltered0p07’) + " \ + "16384*filter(’hltL3crIsoL1sMu18erTau24erIorMu20erTau24erL1f0L2f10QL3f20QL3trkIsoFiltered0p07’) + " \ + "32768*filter(’hltL3crIsoBigORMu18erTauXXer2p1L1f0L2f10QL3f20QL3trkIsoFiltered0p07’)" + ) + ''' + # tau-leg: + ''' + process.triggerObjectTable.selections[3].sel = cms.string( + "( type(84) || type(-100) ) && (pt > 5) && coll(’*Tau*’) && " \ + "( filter(’*LooseChargedIso*’) || filter(’*MediumChargedIso*’) || " \ + "filter(’*TightChargedIso*’) || filter(’*TightOOSCPhotons*’) || " \ + "filter(’hltL2TauIsoFilter’) || filter(’*OverlapFilterIsoMu*’) || " \ + "filter(’*OverlapFilterIsoEle*’) || filter(’*L1HLTMatched*’) || " \ + "filter(’*Dz02*’) || filter(’*DoublePFTau*’) || " \ + "filter(’*SinglePFTau*’) || filter(’hlt*SelectedPFTau’) || " \ + "filter(’*DisplPFTau*’) || filter(’*Tau*’) )" + ) + process.triggerObjectTable.selections[3].qualityBits = cms.string( + "filter(’*LooseChargedIso*’) + " \ + "2*filter(’*MediumChargedIso*’) + " \ + "4*filter(’*TightChargedIso*’) + " \ + "8*filter(’*TightOOSCPhotons*’) + " \ + "16*filter(’*Hps*’) + " \ + "32*filter(’hltSelectedPFTau*MediumChargedIsolationL1HLTMatched*’) + " \ + "64*filter(’hltDoublePFTau*TrackPt1*ChargedIsolation*Dz02Reg’) + " \ + "128*filter(’hltOverlapFilterIsoEle*PFTau*’) + " \ + "256*filter(’hltOverlapFilterIsoMu*PFTau*’) + " \ + "512*filter(’hltDoublePFTau*TrackPt1*ChargedIsolation*’) + " \ + "1024*filter(’hltL1sBigORLooseIsoEGXXerIsoTauYYerdRMin0p3’) + " \ + "2048*filter(’hltL1sMu18erTau24erIorMu20erTau24er’) + " \ + "4096*filter(’hltL1sBigORMu18erTauXXer2p1’) + " \ + "8192*filter(’hltDoubleL2IsoTau26eta2p2’)" + ) + ''' + # Add HF jet shape info (https://github.com/cms-sw/cmssw/blob/CMSSW_10_6_30/PhysicsTools/NanoAOD/python/jets_cff.py#L741-L759) from RecoJets.JetProducers.hfJetShowerShape_cfi import hfJetShowerShape process.hfJetShowerShapeforNanoAOD = hfJetShowerShape.clone(jets="updatedJets",vertices="offlineSlimmedPrimaryVertices")