Skip to content

Commit

Permalink
Merge pull request #47069 from Parsifal-2045/hltMuonNtuples
Browse files Browse the repository at this point in the history
[NGT] Implement `NanoAOD` ntuples production for HLT Muon objects
  • Loading branch information
cmsbuild authored Feb 10, 2025
2 parents c7e8a06 + 1838003 commit 0308cd8
Show file tree
Hide file tree
Showing 9 changed files with 442 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Configuration/EventContent/python/EventContent_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,11 @@ def SwapKeepAndDrop(l):
'keep *_hltPhase2L3Muons_*_*'])

from Configuration.ProcessModifiers.phase2L2AndL3Muons_cff import phase2L2AndL3Muons
(phase2_muon & ~phase2L2AndL3Muons).toModify(FEVTDEBUGHLTEventContent,
outputCommands = FEVTDEBUGHLTEventContent.outputCommands + [
'keep *_hltL2OfflineMuonSeeds_*_*'
])

(phase2_muon & phase2L2AndL3Muons).toModify(FEVTDEBUGHLTEventContent,
outputCommands = FEVTDEBUGHLTEventContent.outputCommands + [
'keep *_hltPhase2L3MuonFilter_*_*'
Expand Down
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ The offsets currently in use are:
* 0.753: HLT phase-2 timing menu Alpaka, single tracking iteration variant
* 0.754: HLT phase-2 timing menu Alpaka, single tracking iteration, LST building variant
* 0.755: HLT phase-2 timing menu Alpaka, LST building variant
* 0.777 New Phase 2 Standalone Muon seeding, streamlined L3 Tracker Muons reconstruction (Inside-Out first), HLT Muon NanoAOD
* 0.778 New Phase 2 Standalone Muon seeding, streamlined L3 Tracker Muons reconstruction (Outside-In first), HLT Muon NanoAOD
* 0.78: Complete L1 workflow
* 0.8: BPH Parking (Run-2)
* 0.81: Running also HeavyFlavor DQM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,10 @@ def condition(self, fragment, stepList, key, hasHarvest):
suffix = '_phase2L2AndL3MuonsIOFirst',
offset = 0.777,
)
upgradeWFs['phase2L2AndL3Muons'].step2 = {'--procModifiers':'phase2L2AndL3Muons'}
upgradeWFs['phase2L2AndL3Muons'].step2 = {'-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:@relvalRun4,NANO:@MUHLT',
'--datatier':'GEN-SIM-DIGI-RAW,NANOAODSIM',
'--eventcontent':'FEVTDEBUGHLT,NANOAODSIM',
'--procModifiers':'phase2L2AndL3Muons'}
upgradeWFs['phase2L2AndL3Muons'].step3 = {'--procModifiers':'phase2L2AndL3Muons'}
upgradeWFs['phase2L2AndL3Muons'].step4 = {'--procModifiers':'phase2L2AndL3Muons'}

Expand Down Expand Up @@ -883,7 +886,10 @@ def condition(self, fragment, stepList, key, hasHarvest):
suffix = '_phase2L2AndL3MuonsOIFirst',
offset = 0.778,
)
upgradeWFs['phase2L3MuonsOIFirst'].step2 = {'--procModifiers':'phase2L2AndL3Muons,phase2L3MuonsOIFirst'}
upgradeWFs['phase2L3MuonsOIFirst'].step2 = {'-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:@relvalRun4,NANO:@MUHLT',
'--datatier':'GEN-SIM-DIGI-RAW,NANOAODSIM',
'--eventcontent':'FEVTDEBUGHLT,NANOAODSIM',
'--procModifiers':'phase2L2AndL3Muons,phase2L3MuonsOIFirst'}
upgradeWFs['phase2L3MuonsOIFirst'].step3 = {'--procModifiers':'phase2L2AndL3Muons,phase2L3MuonsOIFirst'}
upgradeWFs['phase2L3MuonsOIFirst'].step4 = {'--procModifiers':'phase2L2AndL3Muons,phase2L3MuonsOIFirst'}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

using DTSegmentFlatTableProducer = MuRecObjBaseProducer<DTChamberId, DTRecSegment4D, DTGeometry>;

#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"

using CSCSegmentFlatTableProducer = MuRecObjBaseProducer<CSCDetId, CSCSegment, CSCGeometry>;

#include "Geometry/RPCGeometry/interface/RPCGeometry.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
Expand All @@ -37,6 +43,7 @@ using GEMSegmentFlatTableProducer = MuRecObjBaseProducer<GEMDetId, GEMSegment, G
#include "FWCore/Framework/interface/MakerMacros.h"

DEFINE_FWK_MODULE(DTSegmentFlatTableProducer);
DEFINE_FWK_MODULE(CSCSegmentFlatTableProducer);
DEFINE_FWK_MODULE(RPCRecHitFlatTableProducer);
DEFINE_FWK_MODULE(GEMRecHitFlatTableProducer);
DEFINE_FWK_MODULE(GEMSegmentFlatTableProducer);
25 changes: 25 additions & 0 deletions DPGAnalysis/MuonTools/python/muNtupleProducerHlt_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import FWCore.ParameterSet.Config as cms

from PhysicsTools.NanoAOD.common_cff import *

from PhysicsTools.NanoAOD.genparticles_cff import *
from PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi import *
from DPGAnalysis.MuonTools.nano_mu_hlt_cff import *


hltMuNanoProducer = cms.Sequence(
prunedGenParticles + finalGenParticles + genParticleTable + hltMuonTriggerProducers
)


def hltMuNanoCustomize(process):

if hasattr(process, "NANOAODSIMoutput"):
process.prunedGenParticles.src = "genParticles"
process.genParticleTable.externalVariables = cms.PSet() # remove iso as external variable from PhysicsTools/NanoAOD/python/genparticles_cff.py:37 (hopefully temporarily)
process.NANOAODSIMoutput.outputCommands.append(
"keep nanoaodFlatTable_*Table*_*_*"
)
process.NANOAODSIMoutput.outputCommands.append("drop edmTriggerResults_*_*_*")

return process
Loading

0 comments on commit 0308cd8

Please sign in to comment.