From d6cde9ca3866c9af06d0659bd2472e2e1ef462c9 Mon Sep 17 00:00:00 2001 From: Norraphat Date: Sun, 15 Dec 2024 19:42:37 +0100 Subject: [PATCH] Backport 45357 --- .../python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py | 12 ++++++++++++ .../python/ALCARECOTkAlDiMuonAndVertex_cff.py | 11 ++++++++++- .../python/ALCARECOTkAlJpsiMuMu_Output_cff.py | 12 ++++++++++++ .../python/ALCARECOTkAlJpsiMuMu_cff.py | 8 +++++++- .../python/ALCARECOTkAlUpsilonMuMu_Output_cff.py | 12 ++++++++++++ .../python/ALCARECOTkAlUpsilonMuMu_cff.py | 8 +++++++- .../python/ALCARECOTkAlZMuMu_Output_cff.py | 12 ++++++++++++ .../python/ALCARECOTkAlZMuMu_cff.py | 8 +++++++- 8 files changed, 79 insertions(+), 4 deletions(-) diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py index 95f6611592d29..323ce65d62e10 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py @@ -23,6 +23,18 @@ 'keep *_offlinePrimaryVertices_*_*') ) +# add branches for MC truth evaluation +from GeneratorInterface.Configuration.GeneratorInterface_EventContent_cff import GeneratorInterfaceAOD +from SimGeneral.Configuration.SimGeneral_EventContent_cff import SimGeneralAOD + +OutALCARECOTkAlDiMuonAndVertex_noDrop.outputCommands.extend(GeneratorInterfaceAOD.outputCommands) +_modifiedCommandsForGEN = OutALCARECOTkAlDiMuonAndVertex_noDrop.outputCommands.copy() +_modifiedCommandsForGEN.remove('keep *_genParticles_*_*') # full genParticles list is too heavy +_modifiedCommandsForGEN.append('keep *_TkAlDiMuonAndVertexGenMuonSelector_*_*') # Keep only the filtered gen muons +OutALCARECOTkAlDiMuonAndVertex_noDrop.outputCommands = _modifiedCommandsForGEN + +OutALCARECOTkAlDiMuonAndVertex_noDrop.outputCommands.extend(SimGeneralAOD.outputCommands) + # in Phase2, remove the SiStrip clusters and keep the OT ones instead _phase2_common_removedCommands = OutALCARECOTkAlDiMuonAndVertex_noDrop.outputCommands.copy() _phase2_common_removedCommands.remove('keep SiStripClusteredmNewDetSetVector_ALCARECOTkAlDiMuon_*_*') diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_cff.py index 9c71d6bade7c7..bfa77398d31e0 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_cff.py @@ -17,6 +17,14 @@ import Alignment.CommonAlignmentProducer.AlignmentTracksFromVertexSelector_cfi as TracksFromVertex ALCARECOTkAlDiMuonVertexTracks = TracksFromVertex.AlignmentTracksFromVertexSelector.clone() +################################################################## +# for the GEN level information +################################################################## +TkAlDiMuonAndVertexGenMuonSelector = cms.EDFilter("GenParticleSelector", + src = cms.InputTag("genParticles"), + cut = cms.string("abs(pdgId) == 13"), # Select only muons + filter = cms.bool(False)) + ################################################################## # The sequence ################################################################# @@ -25,7 +33,8 @@ ALCARECOTkAlDiMuonGoodMuons+ ALCARECOTkAlDiMuonRelCombIsoMuons+ ALCARECOTkAlDiMuon+ - ALCARECOTkAlDiMuonVertexTracks) + ALCARECOTkAlDiMuonVertexTracks+ + TkAlDiMuonAndVertexGenMuonSelector) ## customizations for the pp_on_AA eras from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py index 09895fb06e46b..f541e8c616257 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py @@ -18,6 +18,18 @@ 'keep *_offlinePrimaryVertices_*_*') ) +# add branches for MC truth evaluation +from GeneratorInterface.Configuration.GeneratorInterface_EventContent_cff import GeneratorInterfaceAOD +from SimGeneral.Configuration.SimGeneral_EventContent_cff import SimGeneralAOD + +OutALCARECOTkAlJpsiMuMu_noDrop.outputCommands.extend(GeneratorInterfaceAOD.outputCommands) +_modifiedCommandsForGEN = OutALCARECOTkAlJpsiMuMu_noDrop.outputCommands.copy() +_modifiedCommandsForGEN.remove('keep *_genParticles_*_*') # full genParticles list is too heavy +_modifiedCommandsForGEN.append('keep *_TkAlJpsiMuMuGenMuonSelector_*_*') # Keep only the filtered gen muons +OutALCARECOTkAlJpsiMuMu_noDrop.outputCommands = _modifiedCommandsForGEN + +OutALCARECOTkAlJpsiMuMu_noDrop.outputCommands.extend(SimGeneralAOD.outputCommands) + # in Run3, SCAL digis replaced by onlineMetaDataDigis import copy _run3_common_removedCommands = OutALCARECOTkAlJpsiMuMu_noDrop.outputCommands.copy() diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_cff.py index dfc5931527c90..2e6c3b7e6e4f1 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_cff.py @@ -49,7 +49,13 @@ ALCARECOTkAlJpsiMuMu.TwoBodyDecaySelector.acoplanarDistance = 1 ##radian ALCARECOTkAlJpsiMuMu.TwoBodyDecaySelector.numberOfCandidates = 1 -seqALCARECOTkAlJpsiMuMu = cms.Sequence(ALCARECOTkAlJpsiMuMuHLT+ALCARECOTkAlJpsiMuMuDCSFilter+ALCARECOTkAlJpsiMuMuGoodMuons+ALCARECOTkAlJpsiMuMu) +## for the GEN level information +TkAlJpsiMuMuGenMuonSelector = cms.EDFilter("GenParticleSelector", + src = cms.InputTag("genParticles"), + cut = cms.string("abs(pdgId) == 13"), # Select only muons + filter = cms.bool(False)) + +seqALCARECOTkAlJpsiMuMu = cms.Sequence(ALCARECOTkAlJpsiMuMuHLT+ALCARECOTkAlJpsiMuMuDCSFilter+ALCARECOTkAlJpsiMuMuGoodMuons+ALCARECOTkAlJpsiMuMu+TkAlJpsiMuMuGenMuonSelector) ## customizations for the pp_on_AA eras from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py index 10bc7b291015a..4b73524a97e15 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py @@ -18,6 +18,18 @@ 'keep *_offlinePrimaryVertices_*_*') ) +# add branches for MC truth evaluation +from GeneratorInterface.Configuration.GeneratorInterface_EventContent_cff import GeneratorInterfaceAOD +from SimGeneral.Configuration.SimGeneral_EventContent_cff import SimGeneralAOD + +OutALCARECOTkAlUpsilonMuMu_noDrop.outputCommands.extend(GeneratorInterfaceAOD.outputCommands) +_modifiedCommandsForGEN = OutALCARECOTkAlUpsilonMuMu_noDrop.outputCommands.copy() +_modifiedCommandsForGEN.remove('keep *_genParticles_*_*') # full genParticles list is too heavy +_modifiedCommandsForGEN.append('keep *_TkAlUpsilonMuMuGenMuonSelector_*_*') # Keep only the filtered gen muons +OutALCARECOTkAlUpsilonMuMu_noDrop.outputCommands = _modifiedCommandsForGEN + +OutALCARECOTkAlUpsilonMuMu_noDrop.outputCommands.extend(SimGeneralAOD.outputCommands) + # in Run3, SCAL digis replaced by onlineMetaDataDigis import copy _run3_common_removedCommands = OutALCARECOTkAlUpsilonMuMu_noDrop.outputCommands.copy() diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_cff.py index f2cd53f4b8f2f..a53c839c7dc18 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_cff.py @@ -54,7 +54,13 @@ ALCARECOTkAlUpsilonMuMu.TwoBodyDecaySelector.acoplanarDistance = 1 ##radian ALCARECOTkAlUpsilonMuMu.TwoBodyDecaySelector.numberOfCandidates = 1 -seqALCARECOTkAlUpsilonMuMu = cms.Sequence(ALCARECOTkAlUpsilonMuMuHLT+ALCARECOTkAlUpsilonMuMuDCSFilter+ALCARECOTkAlUpsilonMuMuGoodMuons+ALCARECOTkAlUpsilonMuMuRelCombIsoMuons+ALCARECOTkAlUpsilonMuMu) +## for the GEN level information +TkAlUpsilonMuMuGenMuonSelector = cms.EDFilter("GenParticleSelector", + src = cms.InputTag("genParticles"), + cut = cms.string("abs(pdgId) == 13"), # Select only muons + filter = cms.bool(False)) + +seqALCARECOTkAlUpsilonMuMu = cms.Sequence(ALCARECOTkAlUpsilonMuMuHLT+ALCARECOTkAlUpsilonMuMuDCSFilter+ALCARECOTkAlUpsilonMuMuGoodMuons+ALCARECOTkAlUpsilonMuMuRelCombIsoMuons+ALCARECOTkAlUpsilonMuMu+TkAlUpsilonMuMuGenMuonSelector) ## customizations for the pp_on_AA eras from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py index 9f85e8b1f368a..fc8dd02a65873 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py @@ -18,6 +18,18 @@ 'keep *_offlinePrimaryVertices_*_*') ) +# add branches for MC truth evaluation +from GeneratorInterface.Configuration.GeneratorInterface_EventContent_cff import GeneratorInterfaceAOD +from SimGeneral.Configuration.SimGeneral_EventContent_cff import SimGeneralAOD + +OutALCARECOTkAlZMuMu_noDrop.outputCommands.extend(GeneratorInterfaceAOD.outputCommands) +_modifiedCommandsForGEN = OutALCARECOTkAlZMuMu_noDrop.outputCommands.copy() +_modifiedCommandsForGEN.remove('keep *_genParticles_*_*') # full genParticles list is too heavy +_modifiedCommandsForGEN.append('keep *_TkAlZMuMuGenMuonSelector_*_*') # Keep only the filtered gen muons +OutALCARECOTkAlZMuMu_noDrop.outputCommands = _modifiedCommandsForGEN + +OutALCARECOTkAlZMuMu_noDrop.outputCommands.extend(SimGeneralAOD.outputCommands) + # in Run3, SCAL digis replaced by onlineMetaDataDigis import copy _run3_common_removedCommands = OutALCARECOTkAlZMuMu_noDrop.outputCommands.copy() diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_cff.py index 617d8c1bbb944..da4bbd5f9a997 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_cff.py @@ -51,7 +51,13 @@ ALCARECOTkAlZMuMu.TwoBodyDecaySelector.applyAcoplanarityFilter = False ALCARECOTkAlZMuMu.TwoBodyDecaySelector.numberOfCandidates = 1 -seqALCARECOTkAlZMuMu = cms.Sequence(ALCARECOTkAlZMuMuHLT+ALCARECOTkAlZMuMuDCSFilter+ALCARECOTkAlZMuMuGoodMuons+ALCARECOTkAlZMuMuRelCombIsoMuons+ALCARECOTkAlZMuMu) +## for the GEN level information +TkAlZMuMuGenMuonSelector = cms.EDFilter("GenParticleSelector", + src = cms.InputTag("genParticles"), + cut = cms.string("abs(pdgId) == 13"), # Select only muons + filter = cms.bool(False)) + +seqALCARECOTkAlZMuMu = cms.Sequence(ALCARECOTkAlZMuMuHLT+ALCARECOTkAlZMuMuDCSFilter+ALCARECOTkAlZMuMuGoodMuons+ALCARECOTkAlZMuMuRelCombIsoMuons+ALCARECOTkAlZMuMu+TkAlZMuMuGenMuonSelector) ## customizations for the pp_on_AA eras from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017