From 9295c9a8b4d82ccb6a3d9fb2fabe14e11b03e3b2 Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 27 Jun 2024 22:47:36 +0200 Subject: [PATCH 1/2] Tracker Alignment ALCARECO producers: add GEN-SIM branches for MC truth evaluation --- .../python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py | 7 +++++++ .../python/ALCARECOTkAlJpsiMuMu_Output_cff.py | 7 +++++++ .../python/ALCARECOTkAlUpsilonMuMu_Output_cff.py | 7 +++++++ .../python/ALCARECOTkAlZMuMu_Output_cff.py | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py index 95f6611592d29..6c083586990c1 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py @@ -23,6 +23,13 @@ '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) +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/ALCARECOTkAlJpsiMuMu_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py index 09895fb06e46b..a2fb401a844a6 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py @@ -18,6 +18,13 @@ '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) +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/ALCARECOTkAlUpsilonMuMu_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py index 10bc7b291015a..911f4924d0337 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py @@ -18,6 +18,13 @@ '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) +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/ALCARECOTkAlZMuMu_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py index 9f85e8b1f368a..98b872dd3ebf5 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py @@ -18,6 +18,13 @@ '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) +OutALCARECOTkAlZMuMu_noDrop.outputCommands.extend(SimGeneralAOD.outputCommands) + # in Run3, SCAL digis replaced by onlineMetaDataDigis import copy _run3_common_removedCommands = OutALCARECOTkAlZMuMu_noDrop.outputCommands.copy() From 107d8e964734962b38ded35ee3ce7b9c22a3e098 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 2 Jul 2024 12:18:28 +0200 Subject: [PATCH 2/2] save only muon genParticles in ALCARECOTkAl[*] producers --- .../python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py | 5 +++++ .../python/ALCARECOTkAlDiMuonAndVertex_cff.py | 11 ++++++++++- .../python/ALCARECOTkAlJpsiMuMu_Output_cff.py | 5 +++++ .../python/ALCARECOTkAlJpsiMuMu_cff.py | 8 +++++++- .../python/ALCARECOTkAlUpsilonMuMu_Output_cff.py | 5 +++++ .../python/ALCARECOTkAlUpsilonMuMu_cff.py | 8 +++++++- .../python/ALCARECOTkAlZMuMu_Output_cff.py | 5 +++++ .../python/ALCARECOTkAlZMuMu_cff.py | 8 +++++++- 8 files changed, 51 insertions(+), 4 deletions(-) diff --git a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py index 6c083586990c1..323ce65d62e10 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlDiMuonAndVertex_Output_cff.py @@ -28,6 +28,11 @@ 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 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 a2fb401a844a6..f541e8c616257 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlJpsiMuMu_Output_cff.py @@ -23,6 +23,11 @@ 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 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 911f4924d0337..4b73524a97e15 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlUpsilonMuMu_Output_cff.py @@ -23,6 +23,11 @@ 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 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 98b872dd3ebf5..fc8dd02a65873 100644 --- a/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py +++ b/Alignment/CommonAlignmentProducer/python/ALCARECOTkAlZMuMu_Output_cff.py @@ -23,6 +23,11 @@ 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 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