diff --git a/Configuration/ProcessModifiers/python/nano_l1_hlt_cff.py b/Configuration/ProcessModifiers/python/nano_l1_hlt_cff.py new file mode 100644 index 0000000000000..488307b5e43ec --- /dev/null +++ b/Configuration/ProcessModifiers/python/nano_l1_hlt_cff.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + +# This modifier is for running NANOAOD production from L1 and HLT steps, +# whitout running RECO and PAT steps. +# It excludes all GEN sequences that depend on PAT collections. + +nano_l1_hlt = cms.Modifier() diff --git a/Configuration/PyReleaseValidation/README.md b/Configuration/PyReleaseValidation/README.md index ef50a51ea34d4..ebe7f63f10623 100644 --- a/Configuration/PyReleaseValidation/README.md +++ b/Configuration/PyReleaseValidation/README.md @@ -74,6 +74,7 @@ The offsets currently in use are: * 0.771: HLT phase-2 NGT Scouting menu, Alpaka, TICL-v5, TICL-Barrel * 0.772: HLT phase-2 NGT Scouting menu, with NANO:@NGTScouting * 0.773: HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal +* 0.774: HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal+@Phase2L1DPGwithGen (L1+HLT objects) * 0.775: HLT phase-2 NGT Scouting menu with Pixeltracks CA Extension + LST T5s as GeneralTracks * 0.778 L3 Tracker Muons reconstruction Outside-In first, HLT Muon NanoAOD * 0.78: Complete L1 workflow diff --git a/Configuration/PyReleaseValidation/python/relval_Run4.py b/Configuration/PyReleaseValidation/python/relval_Run4.py index 62b24cfc76e54..e9ac315865dd6 100644 --- a/Configuration/PyReleaseValidation/python/relval_Run4.py +++ b/Configuration/PyReleaseValidation/python/relval_Run4.py @@ -76,6 +76,7 @@ numWFIB.extend([prefixDet+34.771]) # NGTScouting + alpaka + TICL-v5 + TICL-Barrel numWFIB.extend([prefixDet+34.772]) # NGTScouting + NANO numWFIB.extend([prefixDet+34.773]) # NGTScouting + NANO (including validation) +numWFIB.extend([prefixDet+34.774]) # NGTScouting + NANO containing both L1 and HLT objects (including validation) numWFIB.extend([prefixDet+34.775]) # NGTScouting + Phase2CAExtension&LSTT5 as GeneralTracks for numWF in numWFIB: diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 1887169482d37..519d19e9bc0d2 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -2205,7 +2205,7 @@ def condition(self, fragment, stepList, key, hasHarvest): } upgradeWFs['NGTScoutingWithNanoValid'] = deepcopy(upgradeWFs['HLTPhase2WithNano']) -upgradeWFs['NGTScoutingWithNanoValid'].suffix = '_NGTScoutingWithNanoVal' +upgradeWFs['NGTScoutingWithNanoValid'].suffix = '_NGTScoutingWithNanoValid' upgradeWFs['NGTScoutingWithNanoValid'].offset = 0.773 upgradeWFs['NGTScoutingWithNanoValid'].step2 = { '-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:NGTScouting,VALIDATION:@hltValidation,NANO:@NGTScoutingVal', @@ -2214,6 +2214,16 @@ def condition(self, fragment, stepList, key, hasHarvest): '--eventcontent':'FEVTDEBUGHLT,NANOAODSIM' } +upgradeWFs['L1NGTScoutingWithNano'] = deepcopy(upgradeWFs['HLTPhase2WithNano']) +upgradeWFs['L1NGTScoutingWithNano'].suffix = '_L1NGTScoutingWithNanoValid' +upgradeWFs['L1NGTScoutingWithNano'].offset = 0.774 +upgradeWFs['L1NGTScoutingWithNano'].step2 = { + '-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:NGTScouting,VALIDATION:@hltValidation,NANO:@NGTScoutingVal+@Phase2L1DPGwithGen', + '--datatier':'GEN-SIM-DIGI-RAW,NANOAODSIM', + '--procModifiers': 'ngtScouting,nano_l1_hlt', + '--eventcontent':'FEVTDEBUGHLT,NANOAODSIM' +} + class UpgradeWorkflow_HLTwDIGI75e33(UpgradeWorkflow): def setup_(self, step, stepName, stepDict, k, properties): if 'DigiTrigger' in step: diff --git a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py index a193472b562c4..7571122baac46 100755 --- a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py +++ b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py @@ -176,6 +176,7 @@ def runSelected(opt): prefixDet+34.771, # HLT phase-2 NGT Scouting menu, Alpaka, TICL-v5, TICL-Barrel prefixDet+34.772, # HLT phase-2 NGT Scouting menu, with NANO:@NGTScouting prefixDet+34.773, # HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal + prefixDet+34.774, # HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal+@Phase2L1DPGwithGen prefixDet+34.775], # HLT phase-2 NGT Scouting menu, Phase2CAExtension&LSTT5 as GeneralTracks } diff --git a/DPGAnalysis/Phase2L1TNanoAOD/python/l1tPh2Nano_cff.py b/DPGAnalysis/Phase2L1TNanoAOD/python/l1tPh2Nano_cff.py index 2ef1223482280..d5ac9b5d0d237 100644 --- a/DPGAnalysis/Phase2L1TNanoAOD/python/l1tPh2Nano_cff.py +++ b/DPGAnalysis/Phase2L1TNanoAOD/python/l1tPh2Nano_cff.py @@ -14,6 +14,12 @@ def addPh2GTObjects(process): from DPGAnalysis.Phase2L1TNanoAOD.l1tPh2Nanotables_cff import * def addPh2L1Objects(process): process.l1tPh2NanoTask.add(p2L1TablesTask) + + # This modifier excludes the hpsTauTable, which is based on the l1tHPSPFTauProducerPuppi collection, no longer available in the L1 menu. + # This allows to run the NANOAOD production from L1 and HLT steps, whitout requiring old inputs from the Spring24 datasets. + from Configuration.ProcessModifiers.nano_l1_hlt_cff import nano_l1_hlt + nano_l1_hlt.toReplaceWith(p2L1TablesTask, p2L1TablesTask.copyAndExclude([hpsTauTable])) + return process #### GENERATOR INFO @@ -25,6 +31,8 @@ def addPh2L1Objects(process): from PhysicsTools.NanoAOD.taus_cff import * ## for Gen taus def addGenObjects(process): + process.genNanoTask = cms.Task() + ## add more GenVariables # from L1Ntuple Gen: https://github.com/artlbv/cmssw/blob/94a5ec13b8ce76afb8ea4f157bb92fb547fadee2/L1Trigger/L1TNtuples/plugins/L1GenTreeProducer.cc#L203 genParticleTable.variables.vertX = Var("vertex.x", float, "vertex X") @@ -45,22 +53,35 @@ def addGenObjects(process): process.prunedGenParticleTable = genParticleTable.clone() process.prunedGenParticleTable.src = "prunedGenParticles" process.prunedGenParticleTable.name = "prunedGenPart" - process.l1tPh2NanoTask.add(process.prunedGenParticleTable) + process.genNanoTask.add(process.prunedGenParticleTable) # lower genVisTau pt threshold process.genVisTauTable.cut = "pt > 1" # lower AK8 gen jet threshold process.genJetAK8Table.cut = "pt > 10" - process.l1tPh2NanoTask.add( + process.genNanoTask.add( puTable, metMCTable, genParticleTask, genParticleTablesTask, genTauTask, ) # add all GenJets: AK4 and AK8 - process.l1tPh2NanoTask.add(genJetTable,patJetPartonsNano,genJetFlavourTable) - process.l1tPh2NanoTask.add(genJetAK8Table,genJetAK8FlavourAssociation,genJetAK8FlavourTable) + process.genNanoTask.add(genJetTable,patJetPartonsNano,genJetFlavourTable) + process.genNanoTask.add(genJetAK8Table,genJetAK8FlavourAssociation,genJetAK8FlavourTable) + + process.l1tPh2NanoTask.add(process.genNanoTask) + + # This modifier excludes all GEN sequences that depend on PAT collections. + # This allows to run the NANOAOD production from L1 and HLT steps, whitout requiring PAT inputs. + from Configuration.ProcessModifiers.nano_l1_hlt_cff import nano_l1_hlt + nano_l1_hlt.toReplaceWith(process.genNanoTask, + process.genNanoTask.copyAndExclude( + [puTable, + metMCTable, + genJetAK8Table, + genJetAK8FlavourAssociation, + genJetAK8FlavourTable])) return process diff --git a/HLTrigger/NGTScouting/python/HLTNanoProducer_cff.py b/HLTrigger/NGTScouting/python/HLTNanoProducer_cff.py index 7b408a3f847bf..6f058dc998978 100644 --- a/HLTrigger/NGTScouting/python/HLTNanoProducer_cff.py +++ b/HLTrigger/NGTScouting/python/HLTNanoProducer_cff.py @@ -132,6 +132,9 @@ + NanoPixelTables ) +from Configuration.ProcessModifiers.nano_l1_hlt_cff import nano_l1_hlt +nano_l1_hlt.toReplaceWith(dstValidationNanoFlavour, dstValidationNanoFlavour.copyAndExclude([dstTriggerAcceptFilter])) + ###################################### # Customization ###################################### @@ -151,4 +154,10 @@ def hltNanoCustomize(process): ) ) + # disable SelectEvents for nano_l1_hlt + nano_l1_hlt.toModify( + process.NANOAODSIMoutput, + SelectEvents = cms.untracked.PSet() + ) + return process diff --git a/PhysicsTools/NanoAOD/plugins/TrackingAssocValueMapsProducer.cc b/PhysicsTools/NanoAOD/plugins/TrackingAssocValueMapsProducer.cc index 5cb81de4d261d..410370e308800 100644 --- a/PhysicsTools/NanoAOD/plugins/TrackingAssocValueMapsProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/TrackingAssocValueMapsProducer.cc @@ -143,6 +143,10 @@ void TrackingAssocValueMapsProducer::produce(edm::Event& iEvent, const edm::Even iEvent.getByToken(trackAssociatorToken_, associatorH); inputsValid = inputsValid && associatorH.isValid(); } + } else { + LogDebug(metname) << "Invalid handles: Track handle valid: " << tracksH.isValid() + << ", TP handle valid: " << tpH.isValid(); + return; } const size_t nTracks = tracksH->size();