From 32ae7bc18023a1de71236937155e801dca00d808 Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Fri, 10 Mar 2023 22:54:39 +0100 Subject: [PATCH 1/6] Split TrackSelection and TrackVertexAssociation, Triplicate for GTT, Propagate new workflow to central L1T and GTT configurations, fix l1t broken tags l1t naming for GTTFileWriter Remove track vertex association from track selection module. Separated off track-vertex association into separate plugin. Partial update to GTT Emulation workflow, switch geometry to D88 which is the Phase2 Baseline in 12_5. add Alexx's updates to TTTrack_TrackWord.h, update to CMSSW_13 l1t tracks tag, update l1tVertexProducer default Update GTTFileReader to l1t naming. Update L1TrackJetEmulatorProducer.cc to accept TVA tracks from l1tTrackVertexAssociationProducer, unify some typedefs with other GTT modules, update l1tTrackJetsEmulation_cfi.py accordingly. Create separate copies of TS and TVA for the vertex finding, jet finding, and Missing Et. Update names to match VertexFinder configs commonly used. Add l1tVertexFinderSim and l1tVertexFinderEmu with fastHisto and fastHistoEmulation algorithms, and proper default input tags for easy process.load calls Update createFirmwareInputFiles_cfg.py for new TS, TVA, VF, JF workflow with new defaults. VertexFinderEmu to VertexFinderEmulator to sync with common usage Switch back to L1 in typedef's, update l1tTrackJets_cif.py PV input tag. l1t naming for L1Trigger/L1TTrackMatch/plugins/L1FastTrackingJetProducer.cc and L1Trigger/L1TTrackMatch/python/l1tFastTrackingJetProducer_cfi.py fixup l1t naming for GTTFileWriter TS and TVA split update, split part 1 of commit b17fb0ea9960e0c08750603f47627448611bc589 Multiple fixes for data flow of consumes and produces for the non-emulator GTT modules. Try to disable JF internal track selection for firmware inputs. fixup TrackJet types. fixup more fixup l1tTrackJetsEmulation_cfi.py Simplify configurations for track selection and vertex association through usage of clone. Remove debugging code from createFirmwareInputFiles_cfg.py First attempt at update to SimL1Emulator_cff.py based on new TS+VF+TVA workflow and default configurations for GTT. Fix runTheMatrix.py errors, SimL1Emulator_cff.py Update to new default on track selection and vertex association for jets, disabling external modules and keeping internal selection active Port note: file not present in master: L1Trigger/L1TNtuples/python/l1PhaseIITreeStep1Producer_cfi.py --- .../Configuration/python/SimL1Emulator_cff.py | 39 +- ...eReader_cff.py => l1tGTTFileReader_cfi.py} | 4 +- ...eWriter_cff.py => l1tGTTFileWriter_cfi.py} | 2 +- .../test/gtt/createFirmwareInputFiles_cfg.py | 92 +++- .../test/gtt/verifyFirmwareOutput_cfg.py | 8 +- .../plugins/L1TrackJetEmulatorProducer.cc | 9 +- .../plugins/L1TrackJetProducer.cc | 8 +- .../plugins/L1TrackSelectionProducer.cc | 183 +------ .../L1TrackVertexAssociationProducer.cc | 449 ++++++++++++++++++ .../python/L1TkMETAnalyser_cfi.py | 2 +- .../python/l1tTrackFastJets_cfi.py | 4 +- .../python/l1tTrackJetsEmulation_cfi.py | 7 +- .../L1TTrackMatch/python/l1tTrackJets_cfi.py | 22 +- .../python/l1tTrackSelectionProducer_cfi.py | 43 +- .../l1tTrackVertexAssociationProducer_cfi.py | 67 +++ .../python/l1tTrackerEmuEtMiss_cfi.py | 6 +- .../python/l1tTrackerEtMiss_cfi.py | 12 +- .../python/l1tTrackerHTMiss_cfi.py | 6 +- .../test/L1TrackObjectNtupleMaker_cfg.py | 2 +- .../python/l1tVertexProducer_cfi.py | 15 +- .../VertexFinder/test/vertexNTupler_cfg.py | 6 +- 21 files changed, 712 insertions(+), 274 deletions(-) rename L1Trigger/DemonstratorTools/python/{GTTFileReader_cff.py => l1tGTTFileReader_cfi.py} (73%) rename L1Trigger/DemonstratorTools/python/{GTTFileWriter_cff.py => l1tGTTFileWriter_cfi.py} (96%) create mode 100644 L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc create mode 100644 L1Trigger/L1TTrackMatch/python/l1tTrackVertexAssociationProducer_cfi.py diff --git a/L1Trigger/Configuration/python/SimL1Emulator_cff.py b/L1Trigger/Configuration/python/SimL1Emulator_cff.py index 80b9d1fc07b97..99c9ded41520e 100644 --- a/L1Trigger/Configuration/python/SimL1Emulator_cff.py +++ b/L1Trigger/Configuration/python/SimL1Emulator_cff.py @@ -122,16 +122,19 @@ # ######################################################################## # Phase-2 L1T - TrackTrigger dependent modules # ######################################################################## + from L1Trigger.L1TTrackMatch.l1tGTTInputProducer_cfi import * +from L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi import * +from L1Trigger.L1TTrackMatch.l1tTrackVertexAssociationProducer_cfi import * from L1Trigger.VertexFinder.l1tVertexProducer_cfi import * -l1tVertexFinder = l1tVertexProducer.clone() -l1tVertexFinderEmulator = l1tVertexProducer.clone() -l1tVertexFinderEmulator.VertexReconstruction.Algorithm = "fastHistoEmulation" -l1tVertexFinderEmulator.l1TracksInputTag = ("l1tGTTInputProducer","Level1TTTracksConverted") -_phase2_siml1emulator.add(l1tVertexFinder) -_phase2_siml1emulator.add(l1tVertexProducer) + +# Track Conversion, Track Selection, Vertex Finding _phase2_siml1emulator.add(l1tGTTInputProducer) _phase2_siml1emulator.add(l1tGTTInputProducerExtended) +_phase2_siml1emulator.add(l1tTrackSelectionProducer) +_phase2_siml1emulator.add(l1tTrackSelectionProducerExtended) +_phase2_siml1emulator.add(l1tVertexFinder) +_phase2_siml1emulator.add(l1tVertexProducer) _phase2_siml1emulator.add(l1tVertexFinderEmulator) # Emulated GMT Muons (Tk + Stub, Tk + MuonTFT, StandaloneMuon) @@ -157,30 +160,32 @@ from L1Trigger.L1TTrackMatch.l1tTrackFastJets_cfi import * from L1Trigger.L1TTrackMatch.l1tTrackerEtMiss_cfi import * from L1Trigger.L1TTrackMatch.l1tTrackerHTMiss_cfi import * -# make the input tags consistent with the choice L1VertexFinder above -l1tTrackJets.L1PVertexInputTag = ("l1tVertexFinderEmulator","l1verticesEmulation") -l1tTrackFastJets.L1PrimaryVertexTag = ("l1tVertexFinder", "l1vertices") -l1tTrackJetsExtended.L1PVertexInputTag = ("l1tVertexFinderEmulator","l1verticesEmulation") -#l1tTrackerEtMiss.L1VertexInputTag = ("l1tVertexFinder", "l1vertices") -#l1tTrackerEtMissExtended.L1VertexInputTag = ("l1tVertexFinder", "l1vertices") -from L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi import * -_phase2_siml1emulator.add(l1tTrackSelectionProducer) -_phase2_siml1emulator.add(l1tTrackSelectionProducerExtended) +#Selected and Associated tracks for Jets and Emulated Jets +_phase2_siml1emulator.add(l1tTrackSelectionProducerForJets) +_phase2_siml1emulator.add(l1tTrackSelectionProducerExtendedForJets) +_phase2_siml1emulator.add(l1tTrackVertexAssociationProducerForJets) +_phase2_siml1emulator.add(l1tTrackVertexAssociationProducerExtendedForJets) + +#Selected and Associated tracks for EtMiss and Emulated EtMiss +_phase2_siml1emulator.add(l1tTrackSelectionProducerForEtMiss) +_phase2_siml1emulator.add(l1tTrackSelectionProducerExtendedForEtMiss) +_phase2_siml1emulator.add(l1tTrackVertexAssociationProducerForEtMiss) +_phase2_siml1emulator.add(l1tTrackVertexAssociationProducerExtendedForEtMiss) +#Track Jets, Track Only Et Miss, Track Only HT Miss _phase2_siml1emulator.add(l1tTrackJets) _phase2_siml1emulator.add(l1tTrackJetsExtended) _phase2_siml1emulator.add(l1tTrackFastJets) _phase2_siml1emulator.add(l1tTrackerEtMiss) _phase2_siml1emulator.add(l1tTrackerHTMiss) -#Emulated tracker objects +#Emulated Track Jets, Track Only Et Miss, Track Only HT Miss from L1Trigger.L1TTrackMatch.l1tTrackJetsEmulation_cfi import * _phase2_siml1emulator.add(l1tTrackJetsEmulation) _phase2_siml1emulator.add(l1tTrackJetsExtendedEmulation) from L1Trigger.L1TTrackMatch.l1tTrackerEmuEtMiss_cfi import * -l1tTrackerEmuEtMiss.L1VertexInputTag = ("l1tVertexFinderEmulator","l1verticesEmulation") _phase2_siml1emulator.add(l1tTrackerEmuEtMiss) from L1Trigger.L1TTrackMatch.l1tTrackerEmuHTMiss_cfi import * diff --git a/L1Trigger/DemonstratorTools/python/GTTFileReader_cff.py b/L1Trigger/DemonstratorTools/python/l1tGTTFileReader_cfi.py similarity index 73% rename from L1Trigger/DemonstratorTools/python/GTTFileReader_cff.py rename to L1Trigger/DemonstratorTools/python/l1tGTTFileReader_cfi.py index 0a5c25c0f714f..10033c8fb738b 100644 --- a/L1Trigger/DemonstratorTools/python/GTTFileReader_cff.py +++ b/L1Trigger/DemonstratorTools/python/l1tGTTFileReader_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -GTTFileReader = cms.EDProducer('GTTFileReader', +l1tGTTFileReader = cms.EDProducer('GTTFileReader', files = cms.vstring("gttOutput_0.txt"), #, "gttOutput_1.txt"), format = cms.untracked.string("APx") -) \ No newline at end of file +) diff --git a/L1Trigger/DemonstratorTools/python/GTTFileWriter_cff.py b/L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py similarity index 96% rename from L1Trigger/DemonstratorTools/python/GTTFileWriter_cff.py rename to L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py index c859d23bd5b45..2f4298e20923c 100644 --- a/L1Trigger/DemonstratorTools/python/GTTFileWriter_cff.py +++ b/L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -GTTFileWriter = cms.EDAnalyzer('GTTFileWriter', +l1tGTTFileWriter = cms.EDAnalyzer('GTTFileWriter', tracks = cms.untracked.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), convertedTracks = cms.untracked.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted"), vertices = cms.untracked.InputTag("l1tVertexProducer", "l1verticesEmulation"), diff --git a/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py b/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py index 40ab8aa46a115..002ea74c5dfbf 100644 --- a/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py +++ b/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py @@ -2,7 +2,6 @@ import FWCore.Utilities.FileUtils as FileUtils import FWCore.ParameterSet.VarParsing as VarParsing - # PART 1 : PARSE ARGUMENTS options = VarParsing.VarParsing ('analysis') @@ -63,25 +62,57 @@ ) process.load('L1Trigger.L1TTrackMatch.l1tGTTInputProducer_cfi') +process.load('L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi') process.load('L1Trigger.VertexFinder.l1tVertexProducer_cfi') -process.load("L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi") -process.load("L1Trigger.L1TTrackMatch.l1tTrackJetsEmulation_cfi") -process.load("L1Trigger.L1TTrackMatch.l1tTrackerEmuHTMiss_cfi") -process.load("L1Trigger.L1TTrackMatch.l1tTrackerEmuEtMiss_cfi") -process.load('L1Trigger.DemonstratorTools.GTTFileWriter_cff') - +process.load('L1Trigger.L1TTrackMatch.l1tTrackVertexAssociationProducer_cfi') +process.load('L1Trigger.L1TTrackMatch.l1tTrackJetsEmulation_cfi') +process.load('L1Trigger.L1TTrackMatch.l1tTrackerEmuHTMiss_cfi') +process.load('L1Trigger.L1TTrackMatch.l1tTrackerEmuEtMiss_cfi') +process.load('L1Trigger.DemonstratorTools.l1tGTTFileWriter_cfi') + process.l1tGTTInputProducer.debug = cms.int32(options.debug) -process.l1tVertexProducer.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted") -process.l1tVertexProducer.VertexReconstruction.Algorithm = cms.string("fastHistoEmulation") -process.l1tVertexProducer.VertexReconstruction.VxMinTrackPt = cms.double(0.0) -process.l1tVertexProducer.debug = options.debug + process.l1tTrackSelectionProducer.processSimulatedTracks = cms.bool(False) -process.l1tTrackSelectionProducer.l1VerticesEmulationInputTag = cms.InputTag("l1tVertexProducer", "l1verticesEmulation") -process.l1tTrackSelectionProducer.debug = options.debug -process.l1tTrackJetsEmulation.VertexInputTag = cms.InputTag("l1tVertexProducer", "l1verticesEmulation") -process.l1tTrackerEmuEtMiss.L1VertexInputTag = cms.InputTag("l1tVertexProducer", "l1verticesEmulation") +process.l1tVertexFinderEmulator.VertexReconstruction.VxMinTrackPt = cms.double(0.0) +process.l1tVertexFinderEmulator.debug = options.debug +process.l1tTrackVertexAssociationProducer.processSimulatedTracks = cms.bool(False) + +process.l1tTrackSelectionProducerForEtMiss.processSimulatedTracks = cms.bool(False) +process.l1tTrackVertexAssociationProducerForEtMiss.processSimulatedTracks = cms.bool(False) process.l1tTrackerEmuEtMiss.debug = options.debug +process.l1tTrackSelectionProducerForJets.processSimulatedTracks = cms.bool(False) +process.l1tTrackSelectionProducerForJets.cutSet = cms.PSet( + ptMin = cms.double(2.0), # pt must be greater than this value, [GeV] + absEtaMax = cms.double(2.4), # absolute value of eta must be less than this value + absZ0Max = cms.double(15.0), # z0 must be less than this value, [cm] + nStubsMin = cms.int32(4), # number of stubs must be greater than or equal to this value + nPSStubsMin = cms.int32(0), # the number of stubs in the PS Modules must be greater than or equal to this value + + reducedBendChi2Max = cms.double(2.25), # bend chi2 must be less than this value + reducedChi2RZMax = cms.double(5.0), # chi2rz/dof must be less than this value + reducedChi2RPhiMax = cms.double(20.0), # chi2rphi/dof must be less than this value +) +process.l1tTrackVertexAssociationProducerForJets.processSimulatedTracks = cms.bool(False) +process.l1tTrackVertexAssociationProducerForJets.cutSet = cms.PSet( + #deltaZMaxEtaBounds = cms.vdouble(0.0, absEtaMax.value), # these values define the bin boundaries in |eta| + #deltaZMax = cms.vdouble(0.5), # delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, [cm] + deltaZMaxEtaBounds = cms.vdouble(0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4), # these values define the bin boundaries in |eta| + deltaZMax = cms.vdouble(0.37, 0.50, 0.60, 0.75, 1.00, 1.60), # delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, [cm] +) +process.l1tTrackerEmuHTMiss.debug = (options.debug > 0) + +#Disable internal track selection +process.l1tTrackJetsEmulation.MaxDzTrackPV = cms.double(10000.0) +process.l1tTrackJetsEmulation.trk_zMax = cms.double(10000.0) # maximum track z +process.l1tTrackJetsEmulation.trk_ptMax = cms.double(10000.0) # maximumum track pT before saturation [GeV] +process.l1tTrackJetsEmulation.trk_ptMin = cms.double(0.0) # minimum track pt [GeV] +process.l1tTrackJetsEmulation.trk_etaMax = cms.double(10000.0) # maximum track eta +process.l1tTrackJetsEmulation.nStubs4PromptChi2=cms.double(10000.0) #Prompt track quality flags for loose/tight +process.l1tTrackJetsEmulation.nStubs4PromptBend=cms.double(10000.0) +process.l1tTrackJetsEmulation.nStubs5PromptChi2=cms.double(10000.0) +process.l1tTrackJetsEmulation.nStubs5PromptBend=cms.double(10000.0) + if options.debug: process.MessageLogger.cerr.INFO.limit = cms.untracked.int32(1000000000) process.MessageLogger.suppressInfo = cms.untracked.vstring('CondDBESSource', 'PoolDBESSource') @@ -89,10 +120,35 @@ limit = cms.untracked.int32(0) ) -process.GTTFileWriter.format = cms.untracked.string(options.format) -# process.GTTFileWriter.outputFilename = cms.untracked.string("myOutputFile.txt") +process.l1tGTTFileWriter.format = cms.untracked.string(options.format) #FIXME Put all this into the default GTTFileWriter +process.l1tGTTFileWriter.tracks = cms.untracked.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks") +process.l1tGTTFileWriter.convertedTracks = cms.untracked.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted") +process.l1tGTTFileWriter.selectedTracks = cms.untracked.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation") +process.l1tGTTFileWriter.vertices = cms.untracked.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation") +process.l1tGTTFileWriter.vertexAssociatedTracks = cms.untracked.InputTag("l1tTrackVertexAssociationProducer", "Level1TTTracksSelectedAssociatedEmulation") +process.l1tGTTFileWriter.jets = cms.untracked.InputTag("l1tTrackJetsEmulation","L1TrackJets") +process.l1tGTTFileWriter.htmiss = cms.untracked.InputTag("l1tTrackerEmuHTMiss", "L1TrackerEmuHTMiss") +process.l1tGTTFileWriter.etmiss = cms.untracked.InputTag("l1tTrackerEmuEtMiss", "L1TrackerEmuEtMiss") +process.l1tGTTFileWriter.outputCorrelatorFilename = cms.untracked.string("L1GTTOutputToCorrelatorFile") +process.l1tGTTFileWriter.outputGlobalTriggerFilename = cms.untracked.string("L1GTTOutputToGlobalTriggerFile") +process.l1tGTTFileWriter.selectedTracksFilename = cms.untracked.string("L1GTTSelectedTracksFile") +process.l1tGTTFileWriter.vertexAssociatedTracksFilename = cms.untracked.string("L1GTTVertexAssociatedTracksFile") process.MessageLogger.cerr.FwkReport.reportEvery = 1 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) -process.p = cms.Path(process.l1tGTTInputProducer * process.l1tVertexProducer * process.l1tTrackSelectionProducer * process.l1tTrackJetsEmulation * process.l1tTrackerEmuHTMiss * process.l1tTrackerEmuEtMiss * process.GTTFileWriter) + +process.p = cms.Path(process.l1tGTTFileWriter) +process.p.associate(cms.Task(process.l1tGTTInputProducer, + process.l1tTrackSelectionProducer, + process.l1tVertexFinderEmulator, + process.l1tTrackVertexAssociationProducer, + process.l1tTrackSelectionProducerForJets, + process.l1tTrackVertexAssociationProducerForJets, + process.l1tTrackJetsEmulation, + process.l1tTrackerEmuHTMiss, + process.l1tTrackSelectionProducerForEtMiss, + process.l1tTrackVertexAssociationProducerForEtMiss, + process.l1tTrackerEmuEtMiss, + ) + ) diff --git a/L1Trigger/DemonstratorTools/test/gtt/verifyFirmwareOutput_cfg.py b/L1Trigger/DemonstratorTools/test/gtt/verifyFirmwareOutput_cfg.py index 132953bc08de7..f393086e4477f 100644 --- a/L1Trigger/DemonstratorTools/test/gtt/verifyFirmwareOutput_cfg.py +++ b/L1Trigger/DemonstratorTools/test/gtt/verifyFirmwareOutput_cfg.py @@ -38,11 +38,11 @@ process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) ) process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff") -process.load('L1Trigger.DemonstratorTools.GTTFileReader_cff') -process.GTTFileReader.files = cms.vstring("test/gtt/example_vertex_apx.txt") -process.GTTFileReader.format = cms.untracked.string(options.format) +process.load('L1Trigger.DemonstratorTools.l1tGTTFileReader_cfi') +process.l1tGTTFileReader.files = cms.vstring("test/gtt/example_vertex_apx.txt") +process.l1tGTTFileReader.format = cms.untracked.string(options.format) process.MessageLogger.cerr.FwkReport.reportEvery = 1 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) -process.p = cms.Path(process.L1HybridTracks * process.GTTFileReader) # vertex emulator & FW-emulator comparsion module need to be added here +process.p = cms.Path(process.L1HybridTracks * process.l1tGTTFileReader) # vertex emulator & FW-emulator comparsion module need to be added here diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc index 96ce847d7efa5..f13218a2b6468 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc @@ -25,6 +25,7 @@ #include "DataFormats/L1Trigger/interface/VertexWord.h" // system include files +#include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" @@ -34,6 +35,7 @@ #include "FWCore/Utilities/interface/StreamID.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/RefVector.h" //own headers #include "L1TrackJetClustering.h" @@ -52,6 +54,7 @@ class L1TrackJetEmulatorProducer : public stream::EDProducer<> { ~L1TrackJetEmulatorProducer() override = default; typedef TTTrack L1TTTrackType; typedef vector L1TTTrackCollectionType; + typedef edm::RefVector L1TTTrackRefCollectionType; static void fillDescriptions(ConfigurationDescriptions &descriptions); private: @@ -96,7 +99,7 @@ class L1TrackJetEmulatorProducer : public stream::EDProducer<> { TTTrack_TrackWord trackword; edm::ESGetToken tTopoToken_; - const EDGetTokenT>> trackToken_; + const EDGetTokenT trackToken_; const EDGetTokenT PVtxToken_; }; @@ -129,7 +132,7 @@ L1TrackJetEmulatorProducer::L1TrackJetEmulatorProducer(const ParameterSet &iConf nDisplacedTracks_(iConfig.getParameter("nDisplacedTracks")), dzPVTrk_(iConfig.getParameter("MaxDzTrackPV")), tTopoToken_(esConsumes(edm::ESInputTag("", ""))), - trackToken_(consumes>>(iConfig.getParameter("L1TrackInputTag"))), + trackToken_(consumes(iConfig.getParameter("L1TrackInputTag"))), PVtxToken_(consumes(iConfig.getParameter("L1PVertexInputTag"))) { zStep_ = 2.0 * trkZMax_ / (zBins_ + 1); // added +1 in denom etaStep_ = glbeta_intern(2.0 * trkEtaMax_ / etaBins_); //etaStep is the width of an etabin @@ -148,7 +151,7 @@ void L1TrackJetEmulatorProducer::produce(Event &iEvent, const EventSetup &iSetup // Read inputs const TrackerTopology &tTopo = iSetup.getData(tTopoToken_); - edm::Handle>> TTTrackHandle; + edm::Handle TTTrackHandle; iEvent.getByToken(trackToken_, TTTrackHandle); edm::Handle PVtx; diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc index 9a93ddb686ea6..d76ab4dfca649 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc @@ -17,6 +17,7 @@ // system include files #include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/RefVector.h" #include "DataFormats/L1TCorrelator/interface/TkJet.h" #include "DataFormats/L1TCorrelator/interface/TkJetFwd.h" #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" @@ -47,6 +48,7 @@ class L1TrackJetProducer : public stream::EDProducer<> { ~L1TrackJetProducer() override = default; typedef TTTrack L1TTTrackType; typedef vector L1TTTrackCollectionType; + typedef edm::RefVector L1TTTrackRefCollectionType; static void fillDescriptions(ConfigurationDescriptions &descriptions); private: @@ -87,7 +89,7 @@ class L1TrackJetProducer : public stream::EDProducer<> { const float dzPVTrk_; edm::ESGetToken tTopoToken_; - const EDGetTokenT>> trackToken_; + const EDGetTokenT trackToken_; const EDGetTokenT PVtxToken_; }; @@ -119,7 +121,7 @@ L1TrackJetProducer::L1TrackJetProducer(const ParameterSet &iConfig) nDisplacedTracks_(iConfig.getParameter("nDisplacedTracks")), dzPVTrk_(iConfig.getParameter("MaxDzTrackPV")), tTopoToken_(esConsumes(edm::ESInputTag("", ""))), - trackToken_(consumes>>(iConfig.getParameter("L1TrackInputTag"))), + trackToken_(consumes(iConfig.getParameter("L1TrackInputTag"))), PVtxToken_(consumes(iConfig.getParameter("L1PVertexInputTag"))) { zStep_ = 2.0 * trkZMax_ / (zBins_ + 1); // added +1 in denom etaStep_ = 2.0 * trkEtaMax_ / etaBins_; //etaStep is the width of an etabin @@ -137,7 +139,7 @@ void L1TrackJetProducer::produce(Event &iEvent, const EventSetup &iSetup) { // Read inputs const TrackerTopology &tTopo = iSetup.getData(tTopoToken_); - edm::Handle>> TTTrackHandle; + edm::Handle TTTrackHandle; iEvent.getByToken(trackToken_, TTTrackHandle); edm::Handle PVtx; diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackSelectionProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackSelectionProducer.cc index 993c3b2b2fdab..aa8fcc97752f8 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackSelectionProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackSelectionProducer.cc @@ -89,9 +89,7 @@ class L1TrackSelectionProducer : public edm::global::EDProducer<> { // ----------member functions ---------------------- void printDebugInfo(const TTTrackCollectionHandle& l1TracksHandle, const TTTrackRefCollectionUPtr& vTTTrackOutput, - const TTTrackRefCollectionUPtr& vTTTrackEmulationOutput, - const TTTrackRefCollectionUPtr& vTTTrackAssociatedOutput, - const TTTrackRefCollectionUPtr& vTTTrackAssociatedEmulationOutput) const; + const TTTrackRefCollectionUPtr& vTTTrackEmulationOutput) const; void printTrackInfo(edm::LogInfo& log, const L1Track& track, bool printEmulation = false) const; void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -257,50 +255,6 @@ class L1TrackSelectionProducer : public edm::global::EDProducer<> { private: double reducedChi2RPhiMax_; }; - struct TTTrackDeltaZMaxSelector { - TTTrackDeltaZMaxSelector(const std::vector& deltaZMaxEtaBounds, const std::vector& deltaZMax) - : deltaZMaxEtaBounds_(deltaZMaxEtaBounds), deltaZMax_(deltaZMax) {} - TTTrackDeltaZMaxSelector(const edm::ParameterSet& cfg) - : deltaZMaxEtaBounds_(cfg.template getParameter("deltaZMaxEtaBounds")), - deltaZMax_(cfg.template getParameter("deltaZMax")) {} - bool operator()(const L1Track& t, const l1t::Vertex& v) const { - size_t etaIndex = - std::upper_bound(deltaZMaxEtaBounds_.begin(), deltaZMaxEtaBounds_.end(), std::abs(t.momentum().eta())) - - deltaZMaxEtaBounds_.begin() - 1; - if (etaIndex > deltaZMax_.size() - 1) - etaIndex = deltaZMax_.size() - 1; - return std::abs(v.z0() - t.z0()) <= deltaZMax_[etaIndex]; - } - - private: - std::vector deltaZMaxEtaBounds_; - std::vector deltaZMax_; - }; - struct TTTrackWordDeltaZMaxSelector { - TTTrackWordDeltaZMaxSelector(const std::vector& deltaZMaxEtaBounds, const std::vector& deltaZMax) - : deltaZMaxEtaBounds_(deltaZMaxEtaBounds), deltaZMax_(deltaZMax) {} - TTTrackWordDeltaZMaxSelector(const edm::ParameterSet& cfg) - : deltaZMaxEtaBounds_(cfg.template getParameter("deltaZMaxEtaBounds")), - deltaZMax_(cfg.template getParameter("deltaZMax")) {} - bool operator()(const L1Track& t, const l1t::VertexWord& v) const { - TTTrack_TrackWord::tanl_t etaEmulationBits = t.getTanlWord(); - ap_fixed etaEmulation; - etaEmulation.V = etaEmulationBits.range(); - size_t etaIndex = - std::upper_bound(deltaZMaxEtaBounds_.begin(), deltaZMaxEtaBounds_.end(), std::abs(etaEmulation.to_double())) - - deltaZMaxEtaBounds_.begin() - 1; - if (etaIndex > deltaZMax_.size() - 1) - etaIndex = deltaZMax_.size() - 1; - l1t::VertexWord::vtxz0_t fixedTkZ0 = t.undigitizeSignedValue( - t.getZ0Bits(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0, 0.0); - - return std::abs(v.z0() - fixedTkZ0.to_double()) <= deltaZMax_[etaIndex]; - } - - private: - std::vector deltaZMaxEtaBounds_; - std::vector deltaZMax_; - }; typedef AndSelector TTTrackPtMinEtaMaxZ0MaxNStubsMinSelector; @@ -316,16 +270,12 @@ class L1TrackSelectionProducer : public edm::global::EDProducer<> { // ----------member data --------------------------- const edm::EDGetTokenT l1TracksToken_; - edm::EDGetTokenT l1VerticesToken_; - edm::EDGetTokenT l1VerticesEmulationToken_; edm::ESGetToken tTopoToken_; const std::string outputCollectionName_; const edm::ParameterSet cutSet_; const double ptMin_, absEtaMax_, absZ0Max_, bendChi2Max_, reducedChi2RZMax_, reducedChi2RPhiMax_; const int nStubsMin_, nPSStubsMin_; - std::vector deltaZMaxEtaBounds_, deltaZMax_; - const double useDisplacedTracksDeltaZOverride_; - bool processSimulatedTracks_, processEmulatedTracks_, doDeltaZCutSim_, doDeltaZCutEmu_; + bool processSimulatedTracks_, processEmulatedTracks_; int debug_; }; @@ -346,10 +296,6 @@ L1TrackSelectionProducer::L1TrackSelectionProducer(const edm::ParameterSet& iCon reducedChi2RPhiMax_(cutSet_.getParameter("reducedChi2RPhiMax")), nStubsMin_(cutSet_.getParameter("nStubsMin")), nPSStubsMin_(cutSet_.getParameter("nPSStubsMin")), - deltaZMaxEtaBounds_(cutSet_.getParameter>("deltaZMaxEtaBounds")), - deltaZMax_(cutSet_.getParameter>("deltaZMax")), - - useDisplacedTracksDeltaZOverride_(iConfig.getParameter("useDisplacedTracksDeltaZOverride")), processSimulatedTracks_(iConfig.getParameter("processSimulatedTracks")), processEmulatedTracks_(iConfig.getParameter("processEmulatedTracks")), debug_(iConfig.getParameter("debug")) { @@ -358,33 +304,11 @@ L1TrackSelectionProducer::L1TrackSelectionProducer(const edm::ParameterSet& iCon throw cms::Exception("You must process at least one of the track collections (simulated or emulated)."); } - if (deltaZMax_.size() != deltaZMaxEtaBounds_.size() - 1) { - throw cms::Exception("The number of deltaZ cuts does not match the number of eta bins!"); - } - - if (useDisplacedTracksDeltaZOverride_ >= 0) { - deltaZMax_ = std::vector(deltaZMax_.size(), useDisplacedTracksDeltaZOverride_); - } - - // Get additional input tags and define the EDM output based on the previous configuration parameters - doDeltaZCutSim_ = false; - doDeltaZCutEmu_ = false; if (processSimulatedTracks_) { produces(outputCollectionName_); - if (iConfig.exists("l1VerticesInputTag")) { - l1VerticesToken_ = consumes(iConfig.getParameter("l1VerticesInputTag")); - doDeltaZCutSim_ = true; - produces(outputCollectionName_ + "Associated"); - } } if (processEmulatedTracks_) { produces(outputCollectionName_ + "Emulation"); - if (iConfig.exists("l1VerticesEmulationInputTag")) { - l1VerticesEmulationToken_ = - consumes(iConfig.getParameter("l1VerticesEmulationInputTag")); - doDeltaZCutEmu_ = true; - produces(outputCollectionName_ + "AssociatedEmulation"); - } } } @@ -396,9 +320,7 @@ L1TrackSelectionProducer::~L1TrackSelectionProducer() {} void L1TrackSelectionProducer::printDebugInfo(const TTTrackCollectionHandle& l1TracksHandle, const TTTrackRefCollectionUPtr& vTTTrackOutput, - const TTTrackRefCollectionUPtr& vTTTrackEmulationOutput, - const TTTrackRefCollectionUPtr& vTTTrackAssociatedOutput, - const TTTrackRefCollectionUPtr& vTTTrackAssociatedEmulationOutput) const { + const TTTrackRefCollectionUPtr& vTTTrackEmulationOutput) const { edm::LogInfo log("L1TrackSelectionProducer"); log << "The original track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are ... \n"; for (const auto& track : *l1TracksHandle) { @@ -446,49 +368,6 @@ void L1TrackSelectionProducer::printDebugInfo(const TTTrackCollectionHandle& l1T } log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n"; } - if (processSimulatedTracks_) { - log << "The selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, " - "chi2rphi, z0) values are ... \n"; - for (const auto& track : *vTTTrackAssociatedOutput) { - printTrackInfo(log, *track, debug_ >= 4); - } - log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedOutput->size() << "\n\n"; - } - if (processEmulatedTracks_) { - log << "The emulation selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, " - "chi2rz, chi2rphi, z0) values are " - "... \n"; - for (const auto& track : *vTTTrackAssociatedEmulationOutput) { - printTrackInfo(log, *track, debug_ >= 4); - } - log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedEmulationOutput->size() << "\n\n"; - } - if (processSimulatedTracks_ && processEmulatedTracks_) { - TTTrackRefCollection inSimButNotEmu; - TTTrackRefCollection inEmuButNotSim; - std::set_difference(vTTTrackAssociatedOutput->begin(), - vTTTrackAssociatedOutput->end(), - vTTTrackAssociatedEmulationOutput->begin(), - vTTTrackAssociatedEmulationOutput->end(), - std::back_inserter(inSimButNotEmu)); - std::set_difference(vTTTrackAssociatedEmulationOutput->begin(), - vTTTrackAssociatedEmulationOutput->end(), - vTTTrackAssociatedOutput->begin(), - vTTTrackAssociatedOutput->end(), - std::back_inserter(inEmuButNotSim)); - log << "The set of tracks selected via cuts on the simulated values which are not in the set of tracks selected " - "by cutting on the emulated values ... \n"; - for (const auto& track : inSimButNotEmu) { - printTrackInfo(log, *track, debug_ >= 3); - } - log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n" - << "The set of tracks selected via cuts on the emulated values which are not in the set of tracks selected " - "by cutting on the simulated values ... \n"; - for (const auto& track : inEmuButNotSim) { - printTrackInfo(log, *track, debug_ >= 3); - } - log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n"; - } } void L1TrackSelectionProducer::printTrackInfo(edm::LogInfo& log, const L1Track& track, bool printEmulation) const { @@ -517,51 +396,26 @@ void L1TrackSelectionProducer::printTrackInfo(edm::LogInfo& log, const L1Track& // ------------ method called to produce the data ------------ void L1TrackSelectionProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { auto vTTTrackOutput = std::make_unique(); - auto vTTTrackAssociatedOutput = std::make_unique(); auto vTTTrackEmulationOutput = std::make_unique(); - auto vTTTrackAssociatedEmulationOutput = std::make_unique(); // Tracker Topology const TrackerTopology& tTopo = iSetup.getData(tTopoToken_); TTTrackCollectionHandle l1TracksHandle; - edm::Handle l1VerticesHandle; - edm::Handle l1VerticesEmulationHandle; - - l1t::Vertex leadingVertex; - l1t::VertexWord leadingEmulationVertex; iEvent.getByToken(l1TracksToken_, l1TracksHandle); size_t nOutputApproximate = l1TracksHandle->size(); if (processSimulatedTracks_) { - if (doDeltaZCutSim_) { - iEvent.getByToken(l1VerticesToken_, l1VerticesHandle); - leadingVertex = l1VerticesHandle->at(0); - if (debug_ >= 2) { - edm::LogInfo("L1TrackSelectionProducer") << "leading vertex z0 = " << leadingVertex.z0(); - } - } vTTTrackOutput->reserve(nOutputApproximate); - vTTTrackAssociatedOutput->reserve(nOutputApproximate); } if (processEmulatedTracks_) { - if (doDeltaZCutEmu_) { - iEvent.getByToken(l1VerticesEmulationToken_, l1VerticesEmulationHandle); - leadingEmulationVertex = l1VerticesEmulationHandle->at(0); - if (debug_ >= 2) { - edm::LogInfo("L1TrackSelectionProducer") << "leading emulation vertex z0 = " << leadingEmulationVertex.z0(); - } - } vTTTrackEmulationOutput->reserve(nOutputApproximate); - vTTTrackAssociatedEmulationOutput->reserve(nOutputApproximate); } TTTrackPtMinEtaMaxZ0MaxNStubsMinSelector kinSel(ptMin_, absEtaMax_, absZ0Max_, nStubsMin_); TTTrackWordPtMinEtaMaxZ0MaxNStubsMinSelector kinSelEmu(ptMin_, absEtaMax_, absZ0Max_, nStubsMin_); TTTrackBendChi2Chi2RZChi2RPhiMaxSelector chi2Sel(bendChi2Max_, reducedChi2RZMax_, reducedChi2RPhiMax_); TTTrackWordBendChi2Chi2RZChi2RPhiMaxSelector chi2SelEmu(bendChi2Max_, reducedChi2RZMax_, reducedChi2RPhiMax_); - TTTrackDeltaZMaxSelector deltaZSel(deltaZMaxEtaBounds_, deltaZMax_); - TTTrackWordDeltaZMaxSelector deltaZSelEmu(deltaZMaxEtaBounds_, deltaZMax_); TTTrackNPSStubsMinSelector nPSStubsSel(nPSStubsMin_, tTopo); for (size_t i = 0; i < nOutputApproximate; i++) { @@ -570,40 +424,24 @@ void L1TrackSelectionProducer::produce(edm::StreamID, edm::Event& iEvent, const // Select tracks based on the floating point TTTrack if (processSimulatedTracks_ && kinSel(track) && nPSStubsSel(track) && chi2Sel(track)) { vTTTrackOutput->push_back(TTTrackRef(l1TracksHandle, i)); - if (doDeltaZCutSim_ && deltaZSel(track, leadingVertex)) { - vTTTrackAssociatedOutput->push_back(TTTrackRef(l1TracksHandle, i)); - } } // Select tracks based on the bitwise accurate TTTrack_TrackWord if (processEmulatedTracks_ && kinSelEmu(track) && chi2SelEmu(track)) { vTTTrackEmulationOutput->push_back(TTTrackRef(l1TracksHandle, i)); - if (doDeltaZCutEmu_ && deltaZSelEmu(track, leadingEmulationVertex)) { - vTTTrackAssociatedEmulationOutput->push_back(TTTrackRef(l1TracksHandle, i)); - } } } if (debug_ >= 2) { - printDebugInfo(l1TracksHandle, - vTTTrackOutput, - vTTTrackEmulationOutput, - vTTTrackAssociatedOutput, - vTTTrackAssociatedEmulationOutput); + printDebugInfo(l1TracksHandle, vTTTrackOutput, vTTTrackEmulationOutput); } // Put the outputs into the event if (processSimulatedTracks_) { iEvent.put(std::move(vTTTrackOutput), outputCollectionName_); - if (doDeltaZCutSim_) { - iEvent.put(std::move(vTTTrackAssociatedOutput), outputCollectionName_ + "Associated"); - } } if (processEmulatedTracks_) { iEvent.put(std::move(vTTTrackEmulationOutput), outputCollectionName_ + "Emulation"); - if (doDeltaZCutEmu_) { - iEvent.put(std::move(vTTTrackAssociatedEmulationOutput), outputCollectionName_ + "AssociatedEmulation"); - } } } @@ -611,10 +449,7 @@ void L1TrackSelectionProducer::produce(edm::StreamID, edm::Event& iEvent, const void L1TrackSelectionProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { //L1TrackSelectionProducer edm::ParameterSetDescription desc; - desc.add("l1TracksInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks")); - desc.addOptional("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "l1vertices")); - desc.addOptional("l1VerticesEmulationInputTag", - edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")); + desc.add("l1TracksInputTag", edm::InputTag("TTTracksFromTrackletEmulation", "Level1TTTracks")); desc.add("outputCollectionName", "Level1TTTracksSelected"); { edm::ParameterSetDescription descCutSet; @@ -629,16 +464,8 @@ void L1TrackSelectionProducer::fillDescriptions(edm::ConfigurationDescriptions& descCutSet.add("reducedChi2RZMax", 5.0)->setComment("chi2rz/dof must be less than this value"); descCutSet.add("reducedChi2RPhiMax", 20.0)->setComment("chi2rphi/dof must be less than this value"); - descCutSet.add>("deltaZMaxEtaBounds", {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4}) - ->setComment("these values define the bin boundaries in |eta|"); - descCutSet.add>("deltaZMax", {0.37, 0.50, 0.60, 0.75, 1.00, 1.60}) - ->setComment( - "delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, " - "[cm]"); desc.add("cutSet", descCutSet); } - desc.add("useDisplacedTracksDeltaZOverride", -1.0) - ->setComment("override the deltaZ cut value for displaced tracks"); desc.add("processSimulatedTracks", true) ->setComment("return selected tracks after cutting on the floating point values"); desc.add("processEmulatedTracks", true) diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc new file mode 100644 index 0000000000000..8d3ce322c5885 --- /dev/null +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc @@ -0,0 +1,449 @@ +// -*- C++ -*- +// +// Package: L1Trigger/L1TTrackMatch +// Class: L1TrackVertexAssociationProducer +// +/**\class L1TrackVertexAssociationProducer L1TrackVertexAssociationProducer.cc L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc + + Description: Selects a set of L1Tracks based on a set of predefined criteria. + + Implementation: + Inputs: + std::vector - Each floating point TTTrack inside this collection inherits from + a bit-accurate TTTrack_TrackWord, used for emulation purposes. + Outputs: + std::vector - A collection of TTTracks selected from cuts on the TTTrack properties + std::vector - A collection of TTTracks selected from cuts on the TTTrack_TrackWord properties +*/ +// +// Original Author: Alexx Perloff +// Created: Thu, 16 Dec 2021 19:02:50 GMT +// Derivative Author: Nick Manganelli +// Created: Thu, 16 Feb 2023 16:03:32 GMT +// +// + +// system include files +#include +#include +#include +#include + +// Xilinx HLS includes +#include +#include + +// user include files +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/RefVector.h" +#include "DataFormats/Common/interface/RefToPtr.h" +#include "DataFormats/Common/interface/Ptr.h" +#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" +#include "DataFormats/L1Trigger/interface/Vertex.h" +#include "DataFormats/L1Trigger/interface/VertexWord.h" +#include "L1Trigger/VertexFinder/interface/L1Track.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "CommonTools/Utils/interface/AndSelector.h" +#include "CommonTools/Utils/interface/EtaRangeSelector.h" +#include "CommonTools/Utils/interface/MinSelector.h" +#include "CommonTools/Utils/interface/MinFunctionSelector.h" +#include "CommonTools/Utils/interface/MinNumberSelector.h" +#include "CommonTools/Utils/interface/PtMinSelector.h" +#include "CommonTools/Utils/interface/Selection.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/EDMException.h" +#include "FWCore/Utilities/interface/StreamID.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" + +// +// class declaration +// + +class L1TrackVertexAssociationProducer : public edm::global::EDProducer<> { +public: + explicit L1TrackVertexAssociationProducer(const edm::ParameterSet&); + ~L1TrackVertexAssociationProducer() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + // ----------constants, enums and typedefs --------- + // Relevant constants for the converted track word + enum TrackBitWidths { + kPtSize = TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, // Width of pt + kPtMagSize = 9, // Width of pt magnitude (unsigned) + kEtaSize = TTTrack_TrackWord::TrackBitWidths::kTanlSize, // Width of eta + kEtaMagSize = 3, // Width of eta magnitude (signed) + }; + + typedef TTTrack TTTrackType; + typedef std::vector TTTrackCollectionType; + typedef edm::Handle TTTrackCollectionHandle; + typedef edm::RefVector TTTrackRefCollectionType; + typedef std::unique_ptr TTTrackRefCollectionUPtr; + + // ----------member functions ---------------------- + void printDebugInfo(const edm::Handle& l1SelectedTracksHandle, + const edm::Handle& l1SelectedTracksEmulationHandle, + const TTTrackRefCollectionUPtr& vTTTrackAssociatedOutput, + const TTTrackRefCollectionUPtr& vTTTrackAssociatedEmulationOutput) const; + void printTrackInfo(edm::LogInfo& log, const TTTrackType& track, bool printEmulation = false) const; + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + + // ----------selectors ----------------------------- + // Based on recommendations from https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideGenericSelectors + struct TTTrackDeltaZMaxSelector { + TTTrackDeltaZMaxSelector(const std::vector& deltaZMaxEtaBounds, const std::vector& deltaZMax) + : deltaZMaxEtaBounds_(deltaZMaxEtaBounds), deltaZMax_(deltaZMax) {} + TTTrackDeltaZMaxSelector(const edm::ParameterSet& cfg) + : deltaZMaxEtaBounds_(cfg.template getParameter("deltaZMaxEtaBounds")), + deltaZMax_(cfg.template getParameter("deltaZMax")) {} + bool operator()(const TTTrackType& t, const l1t::Vertex& v) const { + size_t etaIndex = + std::upper_bound(deltaZMaxEtaBounds_.begin(), deltaZMaxEtaBounds_.end(), std::abs(t.momentum().eta())) - + deltaZMaxEtaBounds_.begin() - 1; + if (etaIndex > deltaZMax_.size() - 1) + etaIndex = deltaZMax_.size() - 1; + return std::abs(v.z0() - t.z0()) <= deltaZMax_[etaIndex]; + } + + private: + std::vector deltaZMaxEtaBounds_; + std::vector deltaZMax_; + }; + struct TTTrackWordDeltaZMaxSelector { + TTTrackWordDeltaZMaxSelector(const std::vector& deltaZMaxEtaBounds, const std::vector& deltaZMax) + : deltaZMaxEtaBounds_(deltaZMaxEtaBounds), deltaZMax_(deltaZMax) {} + TTTrackWordDeltaZMaxSelector(const edm::ParameterSet& cfg) + : deltaZMaxEtaBounds_(cfg.template getParameter("deltaZMaxEtaBounds")), + deltaZMax_(cfg.template getParameter("deltaZMax")) {} + bool operator()(const TTTrackType& t, const l1t::VertexWord& v) const { + TTTrack_TrackWord::tanl_t etaEmulationBits = t.getTanlWord(); + ap_fixed etaEmulation; + etaEmulation.V = etaEmulationBits.range(); + size_t etaIndex = + std::upper_bound(deltaZMaxEtaBounds_.begin(), deltaZMaxEtaBounds_.end(), std::abs(etaEmulation.to_double())) - + deltaZMaxEtaBounds_.begin() - 1; + if (etaIndex > deltaZMax_.size() - 1) + etaIndex = deltaZMax_.size() - 1; + l1t::VertexWord::vtxz0_t fixedTkZ0 = t.undigitizeSignedValue( + t.getZ0Bits(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0, 0.0); + + ap_uint ptEmulationBits = t.getTrackWord()( + TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB); + ap_ufixed ptEmulation; + ptEmulation.V = ptEmulationBits.range(); + return std::abs(v.z0() - fixedTkZ0.to_double()) <= deltaZMax_[etaIndex]; + } + + private: + std::vector deltaZMaxEtaBounds_; + std::vector deltaZMax_; + }; + + // ----------member data --------------------------- + const edm::EDGetTokenT l1VerticesToken_; + const edm::EDGetTokenT l1SelectedTracksToken_; + const edm::EDGetTokenT l1VerticesEmulationToken_; + const edm::EDGetTokenT l1SelectedTracksEmulationToken_; + const std::string outputCollectionName_; + const edm::ParameterSet cutSet_; + std::vector deltaZMaxEtaBounds_, deltaZMax_; + const double useDisplacedTracksDeltaZOverride_; + bool processSimulatedTracks_, processEmulatedTracks_, doDeltaZCutSim_, doDeltaZCutEmu_; + int debug_; +}; + +// +// constructors and destructor +// +L1TrackVertexAssociationProducer::L1TrackVertexAssociationProducer(const edm::ParameterSet& iConfig) + : l1VerticesToken_(iConfig.getParameter("processSimulatedTracks") + ? consumes(iConfig.getParameter("l1VerticesInputTag")) + : edm::EDGetTokenT()), + l1SelectedTracksToken_( + iConfig.getParameter("processSimulatedTracks") + ? consumes(iConfig.getParameter("l1SelectedTracksInputTag")) + : edm::EDGetTokenT()), + l1VerticesEmulationToken_( + iConfig.getParameter("processEmulatedTracks") + ? consumes(iConfig.getParameter("l1VerticesEmulationInputTag")) + : edm::EDGetTokenT()), + l1SelectedTracksEmulationToken_(iConfig.getParameter("processEmulatedTracks") + ? consumes(iConfig.getParameter( + "l1SelectedTracksEmulationInputTag")) + : edm::EDGetTokenT()), + outputCollectionName_(iConfig.getParameter("outputCollectionName")), + cutSet_(iConfig.getParameter("cutSet")), + + deltaZMaxEtaBounds_(cutSet_.getParameter>("deltaZMaxEtaBounds")), + deltaZMax_(cutSet_.getParameter>("deltaZMax")), + useDisplacedTracksDeltaZOverride_(iConfig.getParameter("useDisplacedTracksDeltaZOverride")), + processSimulatedTracks_(iConfig.getParameter("processSimulatedTracks")), + processEmulatedTracks_(iConfig.getParameter("processEmulatedTracks")), + debug_(iConfig.getParameter("debug")) { + // Confirm the the configuration makes sense + if (!processSimulatedTracks_ && !processEmulatedTracks_) { + throw cms::Exception("You must process at least one of the track collections (simulated or emulated)."); + } + + if (deltaZMax_.size() != deltaZMaxEtaBounds_.size() - 1) { + throw cms::Exception("The number of deltaZ cuts does not match the number of eta bins!"); + } + + if (useDisplacedTracksDeltaZOverride_ >= 0) { + deltaZMax_ = std::vector(deltaZMax_.size(), useDisplacedTracksDeltaZOverride_); + } + + // Get additional input tags and define the EDM output based on the previous configuration parameters + doDeltaZCutSim_ = false; + doDeltaZCutEmu_ = false; + if (processSimulatedTracks_) { + if (iConfig.exists("l1VerticesInputTag")) { + // l1SelectedTracksToken_ = consumes(iConfig.getParameter("l1SelectedTracksInputTag")); + // l1VerticesToken_ = consumes(iConfig.getParameter("l1VerticesInputTag")); + doDeltaZCutSim_ = true; + produces(outputCollectionName_); + } + } + if (processEmulatedTracks_) { + if (iConfig.exists("l1VerticesEmulationInputTag")) { + // l1SelectedTracksEmulationToken_ = + // consumes(iConfig.getParameter("l1SelectedTracksEmulationInputTag")); + // l1VerticesEmulationToken_ = + // consumes(iConfig.getParameter("l1VerticesEmulationInputTag")); + doDeltaZCutEmu_ = true; + produces(outputCollectionName_ + "Emulation"); + } + } +} + +L1TrackVertexAssociationProducer::~L1TrackVertexAssociationProducer() {} + +// +// member functions +// + +void L1TrackVertexAssociationProducer::printDebugInfo( + const edm::Handle& l1SelectedTracksHandle, + const edm::Handle& l1SelectedTracksEmulationHandle, + const TTTrackRefCollectionUPtr& vTTTrackAssociatedOutput, + const TTTrackRefCollectionUPtr& vTTTrackAssociatedEmulationOutput) const { + edm::LogInfo log("L1TrackVertexAssociationProducer"); + if (processSimulatedTracks_) { + log << "The original selected track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are " + "... \n"; + for (const auto& track : *l1SelectedTracksHandle) { + printTrackInfo(log, *track, debug_ >= 4); + } + log << "\t---\n\tNumber of tracks in this selection = " << l1SelectedTracksHandle->size() << "\n\n"; + } + if (processEmulatedTracks_) { + log << "The original selected emulated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) " + "values are ... \n"; + for (const auto& track : *l1SelectedTracksEmulationHandle) { + printTrackInfo(log, *track, debug_ >= 4); + } + log << "\t---\n\tNumber of tracks in this selection = " << l1SelectedTracksEmulationHandle->size() << "\n\n"; + } + if (processSimulatedTracks_ && processEmulatedTracks_) { + TTTrackRefCollectionType inSimButNotEmu; + TTTrackRefCollectionType inEmuButNotSim; + std::set_difference(l1SelectedTracksHandle->begin(), + l1SelectedTracksHandle->end(), + l1SelectedTracksEmulationHandle->begin(), + l1SelectedTracksEmulationHandle->end(), + std::back_inserter(inSimButNotEmu)); + std::set_difference(l1SelectedTracksEmulationHandle->begin(), + l1SelectedTracksEmulationHandle->end(), + l1SelectedTracksHandle->begin(), + l1SelectedTracksHandle->end(), + std::back_inserter(inEmuButNotSim)); + log << "The set of tracks selected via cuts on the simulated values which are not in the set of tracks selected " + "by cutting on the emulated values ... \n"; + for (const auto& track : inSimButNotEmu) { + printTrackInfo(log, *track, debug_ >= 3); + } + log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n" + << "The set of tracks selected via cuts on the emulated values which are not in the set of tracks selected " + "by cutting on the simulated values ... \n"; + for (const auto& track : inEmuButNotSim) { + printTrackInfo(log, *track, debug_ >= 3); + } + log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n"; + } + if (processSimulatedTracks_) { + log << "The selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, " + "chi2rphi, z0) values are ... \n"; + for (const auto& track : *vTTTrackAssociatedOutput) { + printTrackInfo(log, *track, debug_ >= 4); + } + log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedOutput->size() << "\n\n"; + } + if (processEmulatedTracks_) { + log << "The emulation selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, " + "chi2rz, chi2rphi, z0) values are " + "... \n"; + for (const auto& track : *vTTTrackAssociatedEmulationOutput) { + printTrackInfo(log, *track, debug_ >= 4); + } + log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedEmulationOutput->size() << "\n\n"; + } + if (processSimulatedTracks_ && processEmulatedTracks_) { + TTTrackRefCollectionType inSimButNotEmu; + TTTrackRefCollectionType inEmuButNotSim; + std::set_difference(vTTTrackAssociatedOutput->begin(), + vTTTrackAssociatedOutput->end(), + vTTTrackAssociatedEmulationOutput->begin(), + vTTTrackAssociatedEmulationOutput->end(), + std::back_inserter(inSimButNotEmu)); + std::set_difference(vTTTrackAssociatedEmulationOutput->begin(), + vTTTrackAssociatedEmulationOutput->end(), + vTTTrackAssociatedOutput->begin(), + vTTTrackAssociatedOutput->end(), + std::back_inserter(inEmuButNotSim)); + log << "The set of vertex associated tracks selected via cuts on the simulated values which are not in the set of " + "tracks selected " + "by cutting on the emulated values ... \n"; + for (const auto& track : inSimButNotEmu) { + printTrackInfo(log, *track, debug_ >= 3); + } + log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n" + << "The set of vertex associated tracks selected via cuts on the emulated values which are not in the set of " + "tracks selected " + "by cutting on the simulated values ... \n"; + for (const auto& track : inEmuButNotSim) { + printTrackInfo(log, *track, debug_ >= 3); + } + log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n"; + } +} + +void L1TrackVertexAssociationProducer::printTrackInfo(edm::LogInfo& log, + const TTTrackType& track, + bool printEmulation) const { + log << "\t(" << track.momentum().perp() << ", " << track.momentum().eta() << ", " << track.momentum().phi() << ", " + << track.getStubRefs().size() << ", " << track.stubPtConsistency() << ", " << track.chi2ZRed() << ", " + << track.chi2XYRed() << ", " << track.z0() << ")\n"; + + if (printEmulation) { + ap_uint ptEmulationBits = track.getTrackWord()( + TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB); + ap_ufixed ptEmulation; + ptEmulation.V = ptEmulationBits.range(); + TTTrack_TrackWord::tanl_t etaEmulationBits = track.getTanlWord(); + ap_fixed etaEmulation; + etaEmulation.V = etaEmulationBits.range(); + double floatTkZ0 = track.undigitizeSignedValue( + track.getZ0Bits(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0, 0.0); + double floatTkPhi = track.undigitizeSignedValue( + track.getPhiBits(), TTTrack_TrackWord::TrackBitWidths::kPhiSize, TTTrack_TrackWord::stepPhi0, 0.0); + log << "\t\t(" << ptEmulation.to_double() << ", " << etaEmulation.to_double() << ", " << floatTkPhi << ", " + << track.getNStubs() << ", " << track.getBendChi2() << ", " << track.getChi2RZ() << ", " << track.getChi2RPhi() + << ", " << floatTkZ0 << ")\n"; + } +} + +// ------------ method called to produce the data ------------ +void L1TrackVertexAssociationProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { + auto vTTTrackAssociatedOutput = std::make_unique(); + auto vTTTrackAssociatedEmulationOutput = std::make_unique(); + + // TTTrackCollectionHandle l1TracksHandle; + edm::Handle l1SelectedTracksHandle; + edm::Handle l1SelectedTracksEmulationHandle; + edm::Handle l1VerticesHandle; + edm::Handle l1VerticesEmulationHandle; + + l1t::Vertex leadingVertex; + l1t::VertexWord leadingEmulationVertex; + + TTTrackDeltaZMaxSelector deltaZSel(deltaZMaxEtaBounds_, deltaZMax_); + TTTrackWordDeltaZMaxSelector deltaZSelEmu(deltaZMaxEtaBounds_, deltaZMax_); + + if (processSimulatedTracks_ && doDeltaZCutSim_) { + iEvent.getByToken(l1SelectedTracksToken_, l1SelectedTracksHandle); + iEvent.getByToken(l1VerticesToken_, l1VerticesHandle); + size_t nOutputApproximate = l1SelectedTracksHandle->size(); + leadingVertex = l1VerticesHandle->at(0); + if (debug_ >= 2) { + edm::LogInfo("L1TrackVertexAssociationProducer") << "leading vertex z0 = " << leadingVertex.z0(); + } + vTTTrackAssociatedOutput->reserve(nOutputApproximate); + for (const auto& trackword : *l1SelectedTracksHandle) { + auto track = l1tVertexFinder::L1Track(edm::refToPtr(trackword)); + // Select tracks based on the floating point TTTrack + if (deltaZSel(*trackword, leadingVertex)) { + vTTTrackAssociatedOutput->push_back(trackword); + } + } + iEvent.put(std::move(vTTTrackAssociatedOutput), outputCollectionName_); + } + if (processEmulatedTracks_ && doDeltaZCutEmu_) { + iEvent.getByToken(l1SelectedTracksEmulationToken_, l1SelectedTracksEmulationHandle); + iEvent.getByToken(l1VerticesEmulationToken_, l1VerticesEmulationHandle); + size_t nOutputApproximateEmulation = l1SelectedTracksEmulationHandle->size(); + leadingEmulationVertex = l1VerticesEmulationHandle->at(0); + if (debug_ >= 2) { + edm::LogInfo("L1TrackVertexAssociationProducer") + << "leading emulation vertex z0 = " << leadingEmulationVertex.z0(); + } + vTTTrackAssociatedEmulationOutput->reserve(nOutputApproximateEmulation); + for (const auto& trackword : *l1SelectedTracksEmulationHandle) { + // Select tracks based on the bitwise accurate TTTrack_TrackWord + if (deltaZSelEmu(*trackword, leadingEmulationVertex)) { + vTTTrackAssociatedEmulationOutput->push_back(trackword); + } + } + iEvent.put(std::move(vTTTrackAssociatedEmulationOutput), outputCollectionName_ + "Emulation"); + } + + if (processSimulatedTracks_ && processEmulatedTracks_ && debug_ >= 2) { + printDebugInfo(l1SelectedTracksHandle, + l1SelectedTracksEmulationHandle, + vTTTrackAssociatedOutput, + vTTTrackAssociatedEmulationOutput); + } +} + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void L1TrackVertexAssociationProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("l1SelectedTracksInputTag", + edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected")); + desc.add("l1SelectedTracksEmulationInputTag", + edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation")); + desc.add("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "l1vertices")); + desc.add("l1VerticesEmulationInputTag", + edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")); + desc.add("outputCollectionName", "Level1TTTracksSelectedAssociated"); + { + edm::ParameterSetDescription descCutSet; + descCutSet.add>("deltaZMaxEtaBounds", {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4}) + ->setComment("these values define the bin boundaries in |eta|"); + descCutSet.add>("deltaZMax", {0.37, 0.50, 0.60, 0.75, 1.00, 1.60}) + ->setComment( + "delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, " + "[cm]"); + desc.add("cutSet", descCutSet); + } + desc.add("useDisplacedTracksDeltaZOverride", -1.0) + ->setComment("override the deltaZ cut value for displaced tracks"); + desc.add("processSimulatedTracks", true) + ->setComment("return selected tracks after cutting on the floating point values"); + desc.add("processEmulatedTracks", true) + ->setComment("return selected tracks after cutting on the bitwise emulated values"); + desc.add("debug", 0)->setComment("Verbosity levels: 0, 1, 2, 3"); + descriptions.addWithDefaultLabel(desc); +} + +//define this as a plug-in +DEFINE_FWK_MODULE(L1TrackVertexAssociationProducer); diff --git a/L1Trigger/L1TTrackMatch/python/L1TkMETAnalyser_cfi.py b/L1Trigger/L1TTrackMatch/python/L1TkMETAnalyser_cfi.py index 5c36564b50c06..ba1ae0ea3eb1f 100644 --- a/L1Trigger/L1TTrackMatch/python/L1TkMETAnalyser_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/L1TkMETAnalyser_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms L1TkMETAnalyser = cms.EDAnalyzer('L1TkMETAnalyser', - TrackMETInputTag = cms.InputTag("l1tTrackerEtMiss","l1tTrackerEtMiss"), + TrackMETInputTag = cms.InputTag("l1tTrackerEtMiss","L1TrackerEtMiss"), TrackMETEmuInputTag = cms.InputTag("l1tTrackerEmuEtMiss","L1TrackerEmuEtMiss"), TrackMETHWInputTag = cms.InputTag("GTTOutputFileReader"), HW_Analysis = cms.bool(False) diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py index 70f71f9ef6299..b105fbfca9b24 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py @@ -2,7 +2,7 @@ l1tTrackFastJets = cms.EDProducer("L1TrackFastJetProducer", L1TrackInputTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), - L1PrimaryVertexTag=cms.InputTag("l1tVertexProducer", "l1vertices"), + L1PrimaryVertexTag=cms.InputTag("l1tVertexFinder", "l1vertices"), trk_zMax = cms.double(15.), # max track z0 [cm] trk_chi2dofMax = cms.double(10.), # max track chi2/dof trk_bendChi2Max = cms.double(2.2),# max bendChi2 cut @@ -20,7 +20,7 @@ l1tTrackFastJetsExtended = cms.EDProducer("L1TrackFastJetProducer", L1TrackInputTag = cms.InputTag("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"), - L1PrimaryVertexTag=cms.InputTag("l1tVertexProducer", "l1vertices"), + L1PrimaryVertexTag=cms.InputTag("l1tVertexFinder", "l1vertices"), trk_zMax = cms.double(15.), # max track z0 [cm] trk_chi2dofMax = cms.double(40.), # max track chi2 for extended tracks trk_bendChi2Max = cms.double(2.4),#Bendchi2 cut for extended tracks diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py index 9276870a56a70..33e9db5c045f2 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py @@ -1,8 +1,8 @@ import FWCore.ParameterSet.Config as cms l1tTrackJetsEmulation = cms.EDProducer('L1TrackJetEmulatorProducer', - L1TrackInputTag= cms.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted"), - L1PVertexInputTag= cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + L1TrackInputTag= cms.InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociatedEmulation"), + L1PVertexInputTag=cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), MaxDzTrackPV = cms.double(1.0), trk_zMax = cms.double (15.) , # maximum track z trk_ptMax = cms.double(200.), # maximumum track pT before saturation [GeV] @@ -32,7 +32,8 @@ ) l1tTrackJetsExtendedEmulation = l1tTrackJetsEmulation.clone( - L1TrackInputTag= ("l1tGTTInputProducerExtended", "Level1TTTracksExtendedConverted"), + L1TrackInputTag= cms.InputTag("l1tTrackVertexAssociationProducerExtendedForJets", "Level1TTTracksExtendedSelectedAssociatedEmulation"), + L1PVertexInputTag=cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), minTrkJetpT= 5.0, # minimum track pt to be considered for track jet MaxDzTrackPV = 5.0, d0_cutNStubs4= -1, # -1 excludes nstub=4 from disp tag diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py index 173907323a35b..164682c867295 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py @@ -2,8 +2,8 @@ #prompt jet selection l1tTrackJets = cms.EDProducer('L1TrackJetProducer', - L1TrackInputTag= cms.InputTag("l1tTTTracksFromTrackletEmulation","Level1TTTracks"), - L1PVertexInputTag = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + L1TrackInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociated"), + L1PVertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), MaxDzTrackPV = cms.double( 1.0 ), #max distance from PV;negative=no cut trk_zMax = cms.double (15.) , # maximum track z trk_ptMax = cms.double(200.), # maximumum track pT before saturation [GeV] @@ -34,16 +34,16 @@ #displaced jets l1tTrackJetsExtended = l1tTrackJets.clone( - L1TrackInputTag= ("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"), + L1TrackInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtendedForJets", "Level1TTTracksExtendedSelectedAssociated"), MaxDzTrackPV = 5.0 , # tracks with dz(trk,PV)>cut excluded - minTrkJetpT= 5., # min track jet pt to be considered for most energetic zbin finding - d0_cutNStubs5= 0.22, # -1 excludes nstub>4 from disp tag process - displaced=True, #Flag for displaced tracks - nStubs4DisplacedChi2= 3.3, #Disp tracks selection [trk4 from disp tag process + displaced = True, #Flag for displaced tracks + nStubs4DisplacedChi2 = 3.3, #Disp tracks selection [trk 0, tracks with PT above maxPt are considered as # mismeasured and are treated according to highPtTracks below. # When maxPt < 0, no special treatment is done for high PT tracks. @@ -14,7 +14,7 @@ ) l1tTrackerEtMissExtended = l1tTrackerEtMiss.clone( #NOT OPTIMIZED, STUDIED, OR USED - L1TrackInputTag = ("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelected"), - L1TrackAssociatedInputTag = ("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelectedAssociated"), - L1MetCollectionName = "l1tTrackerExtendedEtMiss", + L1TrackInputTag = ("l1tTrackSelectionProducerExtendedForEtMiss", "Level1TTTracksExtendedSelected"), + L1TrackAssociatedInputTag = ("l1tTrackVertexAssociationProducerExtendedForEtMiss", "Level1TTTracksExtendedSelectedAssociated"), + L1MetCollectionName = "L1TrackerExtendedEtMiss", ) diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py index b7a19f27cc159..6b71a59da2db1 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py @@ -2,7 +2,7 @@ l1tTkCaloHTMiss = cms.EDProducer("L1TkHTMissProducer", L1TkJetInputTag = cms.InputTag("l1tTkCaloJets", "L1TkCaloJets"), - L1VertexInputTag = cms.InputTag("l1tVertexProducer", "l1vertices"), + L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), jet_maxEta = cms.double(2.2), # maximum eta of jets for HT jet_minPt = cms.double(15.0), # minimum pt of jets for HT [GeV] jet_minNtracksHighPt=cms.int32(0), #Add track jet quality criteria pT>100 @@ -20,7 +20,7 @@ l1tTrackerHTMiss = cms.EDProducer("L1TkHTMissProducer", L1TkJetInputTag = cms.InputTag("l1tTrackJets", "L1TrackJets"), - L1VertexInputTag = cms.InputTag("l1tVertexProducer", "l1vertices"), + L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), jet_maxEta = cms.double(2.4), jet_minPt = cms.double(5.0), jet_minNtracksLowPt=cms.int32(2), @@ -36,7 +36,7 @@ l1tTrackerHTMissExtended = cms.EDProducer("L1TkHTMissProducer", L1TkJetInputTag = cms.InputTag("l1tTrackJetsExtended", "L1TrackJetsExtended"), - L1VertexInputTag = cms.InputTag("l1tVertexProducer", "l1vertices"), + L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), jet_maxEta = cms.double(2.4), jet_minPt = cms.double(5.0), jet_minNtracksLowPt=cms.int32(2), diff --git a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py index f4f0ea8e8d126..fec76b17dc647 100644 --- a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py +++ b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py @@ -213,7 +213,7 @@ TrackMETInputTag = cms.InputTag("l1tTrackerEtMiss","L1TrackerEtMiss"), TrackMETExtendedInputTag = cms.InputTag("l1tTrackerEtMissExtended","L1TrackerExtendedEtMiss"), TrackMETEmuInputTag = cms.InputTag("l1tTrackerEmuEtMiss","L1TrackerEmuEtMiss"), - TrackMHTInputTag = cms.InputTag("L1TrackerHTMiss","L1TrackerHTMiss"), #includes HT + TrackMHTInputTag = cms.InputTag("l1tTrackerHTMiss","L1TrackerHTMiss"), #includes HT TrackMHTExtendedInputTag = cms.InputTag("l1tTrackerHTMissExtended","L1TrackerHTMissExtended"), TrackMHTEmuInputTag = cms.InputTag("l1tTrackerEmuHTMiss",process.l1tTrackerEmuHTMiss.L1MHTCollectionName.value()), TrackMHTEmuExtendedInputTag = cms.InputTag("l1tTrackerEmuHTMissExtended",process.l1tTrackerEmuHTMissExtended.L1MHTCollectionName.value()), diff --git a/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py b/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py index c425c1bfa9a9d..bb76801d5be95 100644 --- a/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py +++ b/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py @@ -1,10 +1,9 @@ import FWCore.ParameterSet.Config as cms -l1tVertexProducer = cms.EDProducer('VertexProducer', - - l1TracksInputTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), - - l1VertexCollectionName = cms.string("l1vertices"), +l1tVertexProducer = cms.EDProducer('VertexProducer', + l1TracksInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"), + + l1VertexCollectionName = cms.string("l1vertices"), #Emulation postfix is appended when fastHistoEmulation is chosen as the algorithm # === Vertex Reconstruction configuration VertexReconstruction = cms.PSet( @@ -72,3 +71,9 @@ # Debug printout debug = cms.uint32(0) ) + +l1tVertexFinder = l1tVertexProducer.clone() + +l1tVertexFinderEmulator = l1tVertexProducer.clone() +l1tVertexFinderEmulator.VertexReconstruction.Algorithm = cms.string("fastHistoEmulation") +l1tVertexFinderEmulator.l1TracksInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation") diff --git a/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py b/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py index 8212c07d3b82b..988d2fa86c75a 100644 --- a/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py +++ b/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py @@ -107,10 +107,10 @@ producer.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted") producerSum = process.L1GTTInputProducer + producerSum - process.l1tVertexNTupler.emulationVertexInputTags.append( cms.InputTag(producerName, 'l1verticesEmulation') ) + process.l1tVertexNTupler.emulationVertexInputTags.append( cms.InputTag(producerName, 'l1tVerticesEmulation') ) process.l1tVertexNTupler.emulationVertexBranchNames.append(algo) else: - process.l1tVertexNTupler.l1VertexInputTags.append( cms.InputTag(producerName, 'l1vertices') ) + process.l1tVertexNTupler.l1VertexInputTags.append( cms.InputTag(producerName, 'l1tVertices') ) process.l1tVertexNTupler.l1VertexBranchNames.append(algo) process.l1tVertexNTupler.l1VertexTrackInputs.append('hybrid') @@ -146,7 +146,7 @@ setattr(process, producerName, producer) producerNames += [producerName] process.l1tVertexNTupler.extraVertexDescriptions += ['DBSCAN(dist={0},minPt={1},minDensity={2},seedTrackPt{3})'.format(dist, minPt, minDensity, seedTrackPt)] - process.l1tVertexNTupler.extraVertexInputTags.append( cms.InputTag(producerName, 'l1vertices')) + process.l1tVertexNTupler.extraVertexInputTags.append( cms.InputTag(producerName, 'l1tVertices')) producerSum += producer print "Total number of producers =", len(additionalProducerAlgorithms)+1 From 8791748abdd5214e12aff476a2050bff91d45cc9 Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Fri, 19 May 2023 21:35:38 +0200 Subject: [PATCH 2/6] Propagate the TS and TVA split, new VertexFinder configuration, and updated JetFinding workflow to more L1T workflows Update L1TkObjectProducers_cff.py and L1TrackMET_cfg.py for TrackSelection insertion before VertexFinding Add TrackSelection in front of VertexFinding and remove redundant configuration in make_l1ctLayer1_dumpFiles_cfg.py make_l1ct_patternFiles_cfg.py l1emulator_cff.py Make input tags non-optional, ifConsumes permits non-existent tags (default) if bool is set to false Port note: files not present in master removed: L1Trigger/Phase2L1ParticleFlow/test/make_l1ctLayer1_dumpFiles_cfg.py L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_patternFiles_cfg.py --- L1Trigger/L1TTrackMatch/python/L1TkObjectProducers_cff.py | 3 ++- L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py | 3 ++- L1Trigger/Phase2L1Taus/python/l1emulator_cff.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/L1Trigger/L1TTrackMatch/python/L1TkObjectProducers_cff.py b/L1Trigger/L1TTrackMatch/python/L1TkObjectProducers_cff.py index 3ca0ab90d2387..6b642ed5781a2 100644 --- a/L1Trigger/L1TTrackMatch/python/L1TkObjectProducers_cff.py +++ b/L1Trigger/L1TTrackMatch/python/L1TkObjectProducers_cff.py @@ -50,8 +50,9 @@ # from L1Trigger.L1TTrackMatch.L1TkCaloJetProducer_cfi import L1TkCaloJets # pL1TkCaloJets = cms.Path( L1TkCaloJets) +from L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi import l1tTrackSelectionProducer from L1Trigger.VertexFinder.l1tVertexProducer_cfi import l1tVertexProducer -pVertexProducer = cms.Path( l1tVertexProducer ) +pVertexProducer = cms.Path( l1tTrackSelectionProducer * l1tVertexProducer ) # from L1Trigger.L1TTrackMatch.l1tTrackerEtMiss_cfi import l1tTrackerEtMiss # pL1TrkMET = cms.Path( l1tTrackerEtMiss ) diff --git a/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py b/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py index c8ebed5fd351f..ee8618d2318c3 100644 --- a/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py +++ b/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py @@ -71,10 +71,11 @@ # Primary vertex ############################################################ +process.load('L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi') process.load('L1Trigger.VertexFinder.l1tVertexProducer_cfi') process.l1tVertexProducer.l1TracksInputTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks") - +producerSum += process.l1tTrackSelectionProducer producerSum += process.l1tVertexProducer producerName = 'VertexProducer{0}'.format("fastHisto") diff --git a/L1Trigger/Phase2L1Taus/python/l1emulator_cff.py b/L1Trigger/Phase2L1Taus/python/l1emulator_cff.py index 40d3022377c6a..ccf7ba9eb5eac 100644 --- a/L1Trigger/Phase2L1Taus/python/l1emulator_cff.py +++ b/L1Trigger/Phase2L1Taus/python/l1emulator_cff.py @@ -24,6 +24,9 @@ TTTrackAssociatorFromPixelDigis.TTTracks = cms.VInputTag( cms.InputTag(L1TRK_NAME, L1TRK_LABEL) ) l1emulator += TrackTriggerAssociatorTracks +from L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi import * +l1emulator += l1tTrackSelectionProducer + from L1Trigger.VertexFinder.l1tVertexProducer_cfi import * l1emulator += l1tVertexProducer From 4246b050ebddb84aecd9af5c9e5e50a65024dbf4 Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Fri, 10 Mar 2023 23:09:43 +0100 Subject: [PATCH 3/6] FastHisto update to match firmware approximately for June 2023 Update VertexFinder to 256 bins, delay truncation of track pt until histogramming is finished to match HDLS firmware. Update typedefs, switch vertex-finder to use selected tracks instead of converted, sync to global/EDProducer from cmssw master FastHisto update, split part 2 of commit b17fb0ea9960e0c08750603f47627448611bc589 Adjust VertexFinder inversion table. Port note: Removed include of global/EDProducer.h in L1Trigger/VertexFinder/plugins/VertexProducer.cc, as it's present in L1Trigger/VertexFinder/interface/VertexProducer.h already --- .../VertexFinder/interface/VertexProducer.h | 10 ++- .../VertexFinder/plugins/VertexProducer.cc | 12 ++-- .../python/l1tVertexProducer_cfi.py | 6 +- L1Trigger/VertexFinder/src/VertexFinder.cc | 62 ++++++++++++++----- 4 files changed, 60 insertions(+), 30 deletions(-) diff --git a/L1Trigger/VertexFinder/interface/VertexProducer.h b/L1Trigger/VertexFinder/interface/VertexProducer.h index f9d683ff0334a..5f4d93bcc74ee 100644 --- a/L1Trigger/VertexFinder/interface/VertexProducer.h +++ b/L1Trigger/VertexFinder/interface/VertexProducer.h @@ -1,8 +1,9 @@ #ifndef __L1Trigger_VertexFinder_VertexProducer_h__ #define __L1Trigger_VertexFinder_VertexProducer_h__ +#include "DataFormats/Common/interface/Ptr.h" +#include "DataFormats/Common/interface/RefToPtr.h" #include "DataFormats/L1Trigger/interface/Vertex.h" -#include "FWCore/Framework/interface/global/EDProducer.h" #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "DataFormats/L1Trigger/interface/VertexWord.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" @@ -33,12 +34,15 @@ class VertexProducer : public edm::global::EDProducer<> { ~VertexProducer() override {} private: - typedef edm::View> TTTrackCollectionView; + typedef TTTrack TTTrackType; + typedef std::vector TTTrackCollectionType; + typedef edm::RefVector TTTrackRefCollectionType; + typedef edm::View TTTrackCollectionView; void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; private: - const edm::EDGetTokenT l1TracksToken_; + const edm::EDGetTokenT l1TracksToken_; const edm::ESGetToken tTopoToken; const std::string outputCollectionName_; diff --git a/L1Trigger/VertexFinder/plugins/VertexProducer.cc b/L1Trigger/VertexFinder/plugins/VertexProducer.cc index 0b954defdc3fa..a300be0502b69 100644 --- a/L1Trigger/VertexFinder/plugins/VertexProducer.cc +++ b/L1Trigger/VertexFinder/plugins/VertexProducer.cc @@ -16,7 +16,7 @@ using namespace l1tVertexFinder; using namespace std; VertexProducer::VertexProducer(const edm::ParameterSet& iConfig) - : l1TracksToken_(consumes(iConfig.getParameter("l1TracksInputTag"))), + : l1TracksToken_(consumes(iConfig.getParameter("l1TracksInputTag"))), tTopoToken(esConsumes()), outputCollectionName_(iConfig.getParameter("l1VertexCollectionName")), settings_(AlgoSettings(iConfig)) { @@ -67,7 +67,7 @@ VertexProducer::VertexProducer(const edm::ParameterSet& iConfig) } void VertexProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { - edm::Handle l1TracksHandle; + edm::Handle l1TracksHandle; iEvent.getByToken(l1TracksToken_, l1TracksHandle); std::vector l1Tracks; @@ -75,11 +75,8 @@ void VertexProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Event if (settings_.debug() > 1) { edm::LogInfo("VertexProducer") << "produce::Processing " << l1TracksHandle->size() << " tracks"; } - for (const auto& track : l1TracksHandle->ptrs()) { - auto l1track = L1Track(track); - // Check the minimum pT of the tracks - // This is left here because it represents the smallest pT to be sent by the track finding boards - // This has less to do with the algorithms than the constraints of what will be sent to the vertexing algorithm + for (const auto& track : *l1TracksHandle) { + auto l1track = L1Track(edm::refToPtr(track)); if (l1track.pt() >= settings_.vx_TrackMinPt()) { l1Tracks.push_back(l1track); } else { @@ -89,6 +86,7 @@ void VertexProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Event } } } + if (settings_.debug() > 1) { edm::LogInfo("VertexProducer") << "produce::Processing " << l1Tracks.size() << " tracks after minimum pt cut of" << settings_.vx_TrackMinPt() << " GeV"; diff --git a/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py b/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py index bb76801d5be95..1cbc9c1057686 100644 --- a/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py +++ b/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py @@ -34,9 +34,9 @@ # TDR settings: [-14.95, 15.0, 0.1] # L1TkPrimaryVertexProducer: [-30.0, 30.0, 0.09983361065] # HLS Firmware: [-14.4, 14.4, 0.4] - # Track word limits (128 binns): [-20.46921512, 20.46921512, 0.31983148625] - # Track word limits (256 binns): [-20.46921512, 20.46921512, 0.159915743125] - FH_HistogramParameters = cms.vdouble(-20.46921512, 20.46921512, 0.31983148625), + # Track word limits (128 binns): [-20.46912512, 20.46912512, 0.31983008] + # Track word limits (256 binns): [-20.46912512, 20.46912512, 0.15991504] + FH_HistogramParameters = cms.vdouble(-20.46912512, 20.46912512, 0.15991504), # The number of vertixes to return (i.e. N windows with the highest combined pT) FH_NVtx = cms.uint32(10), # fastHisto algorithm assumed vertex half-width [cm] diff --git a/L1Trigger/VertexFinder/src/VertexFinder.cc b/L1Trigger/VertexFinder/src/VertexFinder.cc index 3e6353d2633f7..b1ac468d3e7e1 100644 --- a/L1Trigger/VertexFinder/src/VertexFinder.cc +++ b/L1Trigger/VertexFinder/src/VertexFinder.cc @@ -634,7 +634,7 @@ namespace l1tVertexFinder { int nbins = std::ceil((settings_->vx_histogram_max() - settings_->vx_histogram_min()) / settings_->vx_histogram_binwidth()); std::vector> hist(nbins); - std::vector> sums(nbins - settings_->vx_windowSize()); + std::vector> sums(nbins - settings_->vx_windowSize() + 1); std::vector bounds(nbins + 1); strided_iota(std::begin(bounds), std::next(std::begin(bounds), nbins + 1), @@ -770,9 +770,9 @@ namespace l1tVertexFinder { }; enum HistogramBitWidths { - kBinSize = 10, // Width of a single bin in z - kBinFixedSize = 7, // Width of a single z0 bin in fixed point representation - kBinFixedMagSize = 4, // Width (magnitude) of a single z0 bin in fixed point representation + kBinSize = 8, // Width of a single bin in z + kBinFixedSize = 8, // Width of a single z0 bin in fixed point representation + kBinFixedMagSize = 5, // Width (magnitude) of a single z0 bin in fixed point representation kSlidingSumSize = 11, // Width of the sum of a window of bins kInverseSize = 14, // Width of the inverse sum kInverseMagSize = 1, // Width of the inverse sum magnitude (unsigned) @@ -780,7 +780,11 @@ namespace l1tVertexFinder { kWeightedSlidingSumMagSize = 10, // Width of the pT weighted sliding sum magnitude (signed) kWindowSize = 3, // Number of bins in the window used to sum histogram bins kSumPtLinkSize = 9, // Number of bits used to represent the sum of track pts in a single bin from a single link + kSumPtWindowBits = BitsToRepresent(HistogramBitWidths::kWindowSize * (1 << HistogramBitWidths::kSumPtLinkSize)), + // Number of bits to represent the untruncated sum of track pts in a single bin from a single link + kSumPtUntruncatedLinkSize = TrackBitWidths::kPtSize + 2, + kSumPtUntruncatedLinkMagSize = TrackBitWidths::kPtMagSize + 2, }; static constexpr unsigned int kTableSize = @@ -798,6 +802,13 @@ namespace l1tVertexFinder { // Histogram bin in fixed point representation, before truncation typedef ap_ufixed histbin_fixed_t; + // This type is slightly arbitrary, but 2 bits larger than untruncated track pt to store sums in histogram bins + // with truncation just before vertex-finding + typedef ap_ufixed + histbin_pt_sum_fixed_t; // This value is slightly arbitrary, but small enough that the windows sums aren't too big. typedef ap_ufixed link_pt_sum_fixed_t; @@ -855,12 +866,12 @@ namespace l1tVertexFinder { // Replace with https://stackoverflow.com/questions/13313980/populate-an-array-using-constexpr-at-compile-time ? auto init_inversion_table = [&]() -> std::vector { std::vector table_out(kTableSize, 0.); - for (unsigned int ii = 0; ii < kTableSize; ii++) { - // First, convert from table index to X-value (unsigned 8-bit, range 0 to +1533) - float in_val = 1533.0 * (ii / float(kTableSize)); - // Next, compute lookup table function - table_out.at(ii) = (in_val > 0) ? (1.0 / in_val) : 0.0; + for (unsigned int ii = 1; ii < (kTableSize - 1); ii++) { + // Compute lookup table function, table_out.at(0) = 0.0 by default + table_out.at(ii) = (1.0 / ii); } + //explicitly set boundary to ensure weighted position doesn't exceed window, consistent with previous implementation of 1/(ii+1) + table_out.at(kTableSize - 1) = 1.0 / (kTableSize); return table_out; }; @@ -953,8 +964,9 @@ namespace l1tVertexFinder { // Create the histogram unsigned int nbins = std::round((settings_->vx_histogram_max() - settings_->vx_histogram_min()) / settings_->vx_histogram_binwidth()); - unsigned int nsums = nbins - settings_->vx_windowSize(); + unsigned int nsums = nbins - settings_->vx_windowSize() + 1; std::vector hist(nbins, 0); + std::vector hist_untruncated(nbins, 0); // Loop over the tracks and fill the histogram if (settings_->debug() > 2) { @@ -963,11 +975,10 @@ namespace l1tVertexFinder { for (const L1Track& track : fitTracks_) { // Get the track pt and z0 // Convert them to an appropriate data format - // Truncation and saturdation taken care of by the data type specification + // Truncation and saturation taken care of by the data type specification, now delayed to end of histogramming pt_t tkpt = 0; tkpt.V = track.getTTTrackPtr()->getTrackWord()(TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB); - track_pt_fixed_t pt_tmp = tkpt; z0_t tkZ0 = track.getTTTrackPtr()->getZ0Word(); if ((settings_->vx_DoQualityCuts() && track_quality_check(tkpt)) || (!settings_->vx_DoQualityCuts())) { @@ -986,16 +997,16 @@ namespace l1tVertexFinder { << "\n" << "tkZ0 = " << tkZ0.to_double() << "(" << tkZ0.to_string(2) << ")\ttkpt = " << tkpt.to_double() << "(" << tkpt.to_string(2) - << ")\tpt_tmp = " << pt_tmp << "\tbin = " << bin.first.to_int() << "\n" + << ")\tbin = " << bin.first.to_int() << "\n" << "pt sum in bin " << bin.first.to_int() << " BEFORE adding track = " << hist.at(bin.first).to_double(); } if (bin.second) { - hist.at(bin.first) = hist.at(bin.first) + pt_tmp; + hist_untruncated.at(bin.first) = hist_untruncated.at(bin.first) + tkpt; } if (settings_->debug() > 2) { edm::LogInfo("VertexProducer") << "fastHistoEmulation::\npt sum in bin " << bin.first.to_int() - << " AFTER adding track = " << hist.at(bin.first).to_double(); + << " AFTER adding track = " << hist_untruncated.at(bin.first).to_double(); } } else { if (settings_->debug() > 2) { @@ -1003,12 +1014,29 @@ namespace l1tVertexFinder { << "track word = " << track.getTTTrackPtr()->getTrackWord().to_string(2) << "\n" << "tkZ0 = " << tkZ0.to_double() << "(" << tkZ0.to_string(2) - << ")\ttkpt = " << tkpt.to_double() << "(" << tkpt.to_string(2) - << ")\tpt_tmp = " << pt_tmp; + << ")\ttkpt = " << tkpt.to_double() << "(" << tkpt.to_string(2) << ")"; } } } // end loop over tracks + // HLS histogramming used to truncate track pt before adding, using + // track_pt_fixed_t pt_tmp = tkpt; + // Now, truncation should happen after histograms are filled but prior to the vertex-finding part of the algo + for (unsigned int hb = 0; hb < hist.size(); ++hb) { + link_pt_sum_fixed_t bin_trunc = hist_untruncated.at(hb).range( + HistogramBitWidths::kSumPtUntruncatedLinkSize - 1, + HistogramBitWidths::kSumPtUntruncatedLinkSize - HistogramBitWidths::kSumPtUntruncatedLinkMagSize); + hist.at(hb) = bin_trunc; + if (settings_->debug() > 2) { + edm::LogInfo("VertexProducer") << "fastHistoEmulation::truncating histogram bin pt once filling is complete \n" + << "hist_untruncated.at(" << hb << ") = " << hist_untruncated.at(hb).to_double() + << "(" << hist_untruncated.at(hb).to_string(2) + << ")\tbin_trunc = " << bin_trunc.to_double() << "(" << bin_trunc.to_string(2) + << ")\n\thist.at(" << hb << ") = " << hist.at(hb).to_double() << "(" + << hist.at(hb).to_string(2) << ")"; + } + } + // Loop through all bins, taking into account the fact that the last bin is nbins-window_width+1, // and compute the sums using sliding windows ... sum_i_i+(w-1) where i in (0,nbins-w) and w is the window size std::vector hist_window_sums(nsums, 0); From c2e029e9dd53aec5e6a8e3923d2df5b793ed9c9a Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Tue, 4 Apr 2023 19:58:41 +0200 Subject: [PATCH 4/6] Update L1TrackObjectNtupleMaker Add updated L1TrackObjectNtupleMaker code and config, removed redundant l1vertices input tags. Apply code-format updates to L1TrackObjectNtupleMaker.cc --- .../test/L1TrackObjectNtupleMaker.cc | 514 +++++++++++++++++- .../test/L1TrackObjectNtupleMaker_cfg.py | 74 ++- 2 files changed, 553 insertions(+), 35 deletions(-) diff --git a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker.cc b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker.cc index 41eeaf5baf170..a0631dc9bb7c7 100644 --- a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker.cc +++ b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker.cc @@ -142,16 +142,36 @@ class L1TrackObjectNtupleMaker : public edm::one::EDAnalyzer ttTrackGTTToken_; edm::EDGetTokenT ttTrackSelectedToken_; edm::EDGetTokenT ttTrackSelectedEmulationToken_; + edm::EDGetTokenT ttTrackSelectedAssociatedToken_; + edm::EDGetTokenT ttTrackSelectedAssociatedEmulationToken_; + edm::EDGetTokenT ttTrackSelectedForJetsToken_; + edm::EDGetTokenT ttTrackSelectedEmulationForJetsToken_; + edm::EDGetTokenT ttTrackSelectedAssociatedForJetsToken_; + edm::EDGetTokenT ttTrackSelectedAssociatedEmulationForJetsToken_; + edm::EDGetTokenT ttTrackSelectedForEtMissToken_; + edm::EDGetTokenT ttTrackSelectedEmulationForEtMissToken_; + edm::EDGetTokenT ttTrackSelectedAssociatedForEtMissToken_; + edm::EDGetTokenT ttTrackSelectedAssociatedEmulationForEtMissToken_; edm::EDGetTokenT ttTrackExtendedToken_; edm::EDGetTokenT> ttTrackMCTruthExtendedToken_; edm::EDGetTokenT ttTrackExtendedGTTToken_; edm::EDGetTokenT ttTrackExtendedSelectedToken_; edm::EDGetTokenT ttTrackExtendedSelectedEmulationToken_; + edm::EDGetTokenT ttTrackExtendedSelectedAssociatedToken_; + edm::EDGetTokenT ttTrackExtendedSelectedAssociatedEmulationToken_; + edm::EDGetTokenT ttTrackExtendedSelectedForJetsToken_; + edm::EDGetTokenT ttTrackExtendedSelectedEmulationForJetsToken_; + edm::EDGetTokenT ttTrackExtendedSelectedAssociatedForJetsToken_; + edm::EDGetTokenT ttTrackExtendedSelectedAssociatedEmulationForJetsToken_; + edm::EDGetTokenT ttTrackExtendedSelectedForEtMissToken_; + edm::EDGetTokenT ttTrackExtendedSelectedEmulationForEtMissToken_; + edm::EDGetTokenT ttTrackExtendedSelectedAssociatedForEtMissToken_; + edm::EDGetTokenT ttTrackExtendedSelectedAssociatedEmulationForEtMissToken_; edm::EDGetTokenT> TrackingParticleToken_; edm::EDGetTokenT> TrackingVertexToken_; @@ -273,6 +313,16 @@ class L1TrackObjectNtupleMaker : public edm::one::EDAnalyzer* m_trk_gtt_phi; std::vector* m_trk_selected_index; std::vector* m_trk_selected_emulation_index; + std::vector* m_trk_selected_associated_index; + std::vector* m_trk_selected_associated_emulation_index; + std::vector* m_trk_selected_forjets_index; + std::vector* m_trk_selected_emulation_forjets_index; + std::vector* m_trk_selected_associated_forjets_index; + std::vector* m_trk_selected_associated_emulation_forjets_index; + std::vector* m_trk_selected_foretmiss_index; + std::vector* m_trk_selected_emulation_foretmiss_index; + std::vector* m_trk_selected_associated_foretmiss_index; + std::vector* m_trk_selected_associated_emulation_foretmiss_index; // all L1 tracks (extended) std::vector* m_trkExt_pt; @@ -309,6 +359,16 @@ class L1TrackObjectNtupleMaker : public edm::one::EDAnalyzer* m_trkExt_gtt_phi; std::vector* m_trkExt_selected_index; std::vector* m_trkExt_selected_emulation_index; + std::vector* m_trkExt_selected_associated_index; + std::vector* m_trkExt_selected_associated_emulation_index; + std::vector* m_trkExt_selected_forjets_index; + std::vector* m_trkExt_selected_emulation_forjets_index; + std::vector* m_trkExt_selected_associated_forjets_index; + std::vector* m_trkExt_selected_associated_emulation_forjets_index; + std::vector* m_trkExt_selected_foretmiss_index; + std::vector* m_trkExt_selected_emulation_foretmiss_index; + std::vector* m_trkExt_selected_associated_foretmiss_index; + std::vector* m_trkExt_selected_associated_emulation_foretmiss_index; // all tracking particles std::vector* m_tp_pt; @@ -498,6 +558,23 @@ L1TrackObjectNtupleMaker::L1TrackObjectNtupleMaker(edm::ParameterSet const& iCon L1TrackGTTInputTag = iConfig.getParameter("L1TrackGTTInputTag"); L1TrackSelectedInputTag = iConfig.getParameter("L1TrackSelectedInputTag"); L1TrackSelectedEmulationInputTag = iConfig.getParameter("L1TrackSelectedEmulationInputTag"); + L1TrackSelectedAssociatedInputTag = iConfig.getParameter("L1TrackSelectedAssociatedInputTag"); + L1TrackSelectedAssociatedEmulationInputTag = + iConfig.getParameter("L1TrackSelectedAssociatedEmulationInputTag"); + L1TrackSelectedForJetsInputTag = iConfig.getParameter("L1TrackSelectedForJetsInputTag"); + L1TrackSelectedEmulationForJetsInputTag = + iConfig.getParameter("L1TrackSelectedEmulationForJetsInputTag"); + L1TrackSelectedAssociatedForJetsInputTag = + iConfig.getParameter("L1TrackSelectedAssociatedForJetsInputTag"); + L1TrackSelectedAssociatedEmulationForJetsInputTag = + iConfig.getParameter("L1TrackSelectedAssociatedEmulationForJetsInputTag"); + L1TrackSelectedForEtMissInputTag = iConfig.getParameter("L1TrackSelectedForEtMissInputTag"); + L1TrackSelectedEmulationForEtMissInputTag = + iConfig.getParameter("L1TrackSelectedEmulationForEtMissInputTag"); + L1TrackSelectedAssociatedForEtMissInputTag = + iConfig.getParameter("L1TrackSelectedAssociatedForEtMissInputTag"); + L1TrackSelectedAssociatedEmulationForEtMissInputTag = + iConfig.getParameter("L1TrackSelectedAssociatedEmulationForEtMissInputTag"); TrackFastJetsInputTag = iConfig.getParameter("TrackFastJetsInputTag"); TrackJetsInputTag = iConfig.getParameter("TrackJetsInputTag"); TrackJetsEmuInputTag = iConfig.getParameter("TrackJetsEmuInputTag"); @@ -511,6 +588,20 @@ L1TrackObjectNtupleMaker::L1TrackObjectNtupleMaker(edm::ParameterSet const& iCon ttTrackGTTToken_ = consumes(L1TrackGTTInputTag); ttTrackSelectedToken_ = consumes(L1TrackSelectedInputTag); ttTrackSelectedEmulationToken_ = consumes(L1TrackSelectedEmulationInputTag); + ttTrackSelectedAssociatedToken_ = consumes(L1TrackSelectedAssociatedInputTag); + ttTrackSelectedAssociatedEmulationToken_ = + consumes(L1TrackSelectedAssociatedEmulationInputTag); + ttTrackSelectedForJetsToken_ = consumes(L1TrackSelectedForJetsInputTag); + ttTrackSelectedEmulationForJetsToken_ = consumes(L1TrackSelectedEmulationForJetsInputTag); + ttTrackSelectedAssociatedForJetsToken_ = consumes(L1TrackSelectedAssociatedForJetsInputTag); + ttTrackSelectedAssociatedEmulationForJetsToken_ = + consumes(L1TrackSelectedAssociatedEmulationForJetsInputTag); + ttTrackSelectedForEtMissToken_ = consumes(L1TrackSelectedForEtMissInputTag); + ttTrackSelectedEmulationForEtMissToken_ = consumes(L1TrackSelectedEmulationForEtMissInputTag); + ttTrackSelectedAssociatedForEtMissToken_ = + consumes(L1TrackSelectedAssociatedForEtMissInputTag); + ttTrackSelectedAssociatedEmulationForEtMissToken_ = + consumes(L1TrackSelectedAssociatedEmulationForEtMissInputTag); TrackFastJetsToken_ = consumes>(TrackFastJetsInputTag); TrackJetsToken_ = consumes(TrackJetsInputTag); TrackJetsEmuToken_ = consumes(TrackJetsEmuInputTag); @@ -527,6 +618,26 @@ L1TrackObjectNtupleMaker::L1TrackObjectNtupleMaker(edm::ParameterSet const& iCon L1TrackExtendedSelectedInputTag = iConfig.getParameter("L1TrackExtendedSelectedInputTag"); L1TrackExtendedSelectedEmulationInputTag = iConfig.getParameter("L1TrackExtendedSelectedEmulationInputTag"); + L1TrackExtendedSelectedAssociatedInputTag = + iConfig.getParameter("L1TrackExtendedSelectedAssociatedInputTag"); + L1TrackExtendedSelectedAssociatedEmulationInputTag = + iConfig.getParameter("L1TrackExtendedSelectedAssociatedEmulationInputTag"); + L1TrackExtendedSelectedForJetsInputTag = + iConfig.getParameter("L1TrackExtendedSelectedForJetsInputTag"); + L1TrackExtendedSelectedEmulationForJetsInputTag = + iConfig.getParameter("L1TrackExtendedSelectedEmulationForJetsInputTag"); + L1TrackExtendedSelectedAssociatedForJetsInputTag = + iConfig.getParameter("L1TrackExtendedSelectedAssociatedForJetsInputTag"); + L1TrackExtendedSelectedAssociatedEmulationForJetsInputTag = + iConfig.getParameter("L1TrackExtendedSelectedAssociatedEmulationForJetsInputTag"); + L1TrackExtendedSelectedForEtMissInputTag = + iConfig.getParameter("L1TrackExtendedSelectedForEtMissInputTag"); + L1TrackExtendedSelectedEmulationForEtMissInputTag = + iConfig.getParameter("L1TrackExtendedSelectedEmulationForEtMissInputTag"); + L1TrackExtendedSelectedAssociatedForEtMissInputTag = + iConfig.getParameter("L1TrackExtendedSelectedAssociatedForEtMissInputTag"); + L1TrackExtendedSelectedAssociatedEmulationForEtMissInputTag = + iConfig.getParameter("L1TrackExtendedSelectedAssociatedEmulationForEtMissInputTag"); TrackFastJetsExtendedInputTag = iConfig.getParameter("TrackFastJetsExtendedInputTag"); TrackJetsExtendedInputTag = iConfig.getParameter("TrackJetsExtendedInputTag"); TrackJetsExtendedEmuInputTag = iConfig.getParameter("TrackJetsExtendedEmuInputTag"); @@ -541,6 +652,23 @@ L1TrackObjectNtupleMaker::L1TrackObjectNtupleMaker(edm::ParameterSet const& iCon ttTrackExtendedGTTToken_ = consumes(L1TrackExtendedGTTInputTag); ttTrackExtendedSelectedToken_ = consumes(L1TrackExtendedSelectedInputTag); ttTrackExtendedSelectedEmulationToken_ = consumes(L1TrackExtendedSelectedEmulationInputTag); + ttTrackExtendedSelectedAssociatedToken_ = consumes(L1TrackExtendedSelectedAssociatedInputTag); + ttTrackExtendedSelectedAssociatedEmulationToken_ = + consumes(L1TrackExtendedSelectedAssociatedEmulationInputTag); + ttTrackExtendedSelectedForJetsToken_ = consumes(L1TrackExtendedSelectedForJetsInputTag); + ttTrackExtendedSelectedEmulationForJetsToken_ = + consumes(L1TrackExtendedSelectedEmulationForJetsInputTag); + ttTrackExtendedSelectedAssociatedForJetsToken_ = + consumes(L1TrackExtendedSelectedAssociatedForJetsInputTag); + ttTrackExtendedSelectedAssociatedEmulationForJetsToken_ = + consumes(L1TrackExtendedSelectedAssociatedEmulationForJetsInputTag); + ttTrackExtendedSelectedForEtMissToken_ = consumes(L1TrackExtendedSelectedForEtMissInputTag); + ttTrackExtendedSelectedEmulationForEtMissToken_ = + consumes(L1TrackExtendedSelectedEmulationForEtMissInputTag); + ttTrackExtendedSelectedAssociatedForEtMissToken_ = + consumes(L1TrackExtendedSelectedAssociatedForEtMissInputTag); + ttTrackExtendedSelectedAssociatedEmulationForEtMissToken_ = + consumes(L1TrackExtendedSelectedAssociatedEmulationForEtMissInputTag); TrackFastJetsExtendedToken_ = consumes>(TrackFastJetsExtendedInputTag); TrackJetsExtendedToken_ = consumes(TrackJetsExtendedInputTag); TrackJetsExtendedEmuToken_ = consumes(TrackJetsExtendedEmuInputTag); @@ -574,6 +702,226 @@ L1TrackObjectNtupleMaker::~L1TrackObjectNtupleMaker() {} void L1TrackObjectNtupleMaker::endJob() { // things to be done at the exit of the event Loop // edm::LogVerbatim("Tracklet") << "L1TrackObjectNtupleMaker::endJob"; + // clean up raw pointers + delete m_trk_pt; + delete m_trk_eta; + delete m_trk_phi; + delete m_trk_phi_local; + delete m_trk_z0; + delete m_trk_d0; + delete m_trk_chi2; + delete m_trk_chi2dof; + delete m_trk_chi2rphi; + delete m_trk_chi2rz; + delete m_trk_bendchi2; + delete m_trk_MVA1; + delete m_trk_nstub; + delete m_trk_lhits; + delete m_trk_dhits; + delete m_trk_seed; + delete m_trk_hitpattern; + delete m_trk_phiSector; + delete m_trk_genuine; + delete m_trk_loose; + delete m_trk_unknown; + delete m_trk_combinatoric; + delete m_trk_fake; + delete m_trk_matchtp_pdgid; + delete m_trk_matchtp_pt; + delete m_trk_matchtp_eta; + delete m_trk_matchtp_phi; + delete m_trk_matchtp_z0; + delete m_trk_matchtp_dxy; + delete m_trk_gtt_pt; + delete m_trk_gtt_eta; + delete m_trk_gtt_phi; + delete m_trk_selected_index; + delete m_trk_selected_emulation_index; + delete m_trk_selected_associated_index; + delete m_trk_selected_associated_emulation_index; + delete m_trk_selected_forjets_index; + delete m_trk_selected_emulation_forjets_index; + delete m_trk_selected_associated_forjets_index; + delete m_trk_selected_associated_emulation_forjets_index; + delete m_trk_selected_foretmiss_index; + delete m_trk_selected_emulation_foretmiss_index; + delete m_trk_selected_associated_foretmiss_index; + delete m_trk_selected_associated_emulation_foretmiss_index; + + delete m_trkExt_pt; + delete m_trkExt_eta; + delete m_trkExt_phi; + delete m_trkExt_phi_local; + delete m_trkExt_z0; + delete m_trkExt_d0; + delete m_trkExt_chi2; + delete m_trkExt_chi2dof; + delete m_trkExt_chi2rphi; + delete m_trkExt_chi2rz; + delete m_trkExt_bendchi2; + delete m_trkExt_MVA; + delete m_trkExt_nstub; + delete m_trkExt_lhits; + delete m_trkExt_dhits; + delete m_trkExt_seed; + delete m_trkExt_hitpattern; + delete m_trkExt_phiSector; + delete m_trkExt_genuine; + delete m_trkExt_loose; + delete m_trkExt_unknown; + delete m_trkExt_combinatoric; + delete m_trkExt_fake; + delete m_trkExt_matchtp_pdgid; + delete m_trkExt_matchtp_pt; + delete m_trkExt_matchtp_eta; + delete m_trkExt_matchtp_phi; + delete m_trkExt_matchtp_z0; + delete m_trkExt_matchtp_dxy; + delete m_trkExt_gtt_pt; + delete m_trkExt_gtt_eta; + delete m_trkExt_gtt_phi; + delete m_trkExt_selected_index; + delete m_trkExt_selected_emulation_index; + delete m_trkExt_selected_associated_index; + delete m_trkExt_selected_associated_emulation_index; + delete m_trkExt_selected_forjets_index; + delete m_trkExt_selected_emulation_forjets_index; + delete m_trkExt_selected_associated_forjets_index; + delete m_trkExt_selected_associated_emulation_forjets_index; + delete m_trkExt_selected_foretmiss_index; + delete m_trkExt_selected_emulation_foretmiss_index; + delete m_trkExt_selected_associated_foretmiss_index; + delete m_trkExt_selected_associated_emulation_foretmiss_index; + + delete m_tp_pt; + delete m_tp_eta; + delete m_tp_phi; + delete m_tp_dxy; + delete m_tp_d0; + delete m_tp_z0; + delete m_tp_d0_prod; + delete m_tp_z0_prod; + delete m_tp_pdgid; + delete m_tp_nmatch; + delete m_tp_nstub; + delete m_tp_eventid; + delete m_tp_charge; + + delete m_gen_pt; + delete m_gen_phi; + delete m_gen_pdgid; + delete m_gen_z0; + + delete m_matchtrk_pt; + delete m_matchtrk_eta; + delete m_matchtrk_phi; + delete m_matchtrk_z0; + delete m_matchtrk_d0; + delete m_matchtrk_chi2; + delete m_matchtrk_chi2dof; + delete m_matchtrk_chi2rphi; + delete m_matchtrk_chi2rz; + delete m_matchtrk_bendchi2; + delete m_matchtrk_MVA1; + delete m_matchtrk_nstub; + delete m_matchtrk_dhits; + delete m_matchtrk_lhits; + delete m_matchtrk_seed; + delete m_matchtrk_hitpattern; + + delete m_matchtrkExt_pt; + delete m_matchtrkExt_eta; + delete m_matchtrkExt_phi; + delete m_matchtrkExt_z0; + delete m_matchtrkExt_d0; + delete m_matchtrkExt_chi2; + delete m_matchtrkExt_chi2dof; + delete m_matchtrkExt_chi2rphi; + delete m_matchtrkExt_chi2rz; + delete m_matchtrkExt_bendchi2; + delete m_matchtrkExt_MVA; + delete m_matchtrkExt_nstub; + delete m_matchtrkExt_dhits; + delete m_matchtrkExt_lhits; + delete m_matchtrkExt_seed; + delete m_matchtrkExt_hitpattern; + + delete m_allstub_x; + delete m_allstub_y; + delete m_allstub_z; + delete m_allstub_isBarrel; + delete m_allstub_layer; + delete m_allstub_isPSmodule; + delete m_allstub_trigDisplace; + delete m_allstub_trigOffset; + delete m_allstub_trigPos; + delete m_allstub_trigBend; + delete m_allstub_matchTP_pdgid; + delete m_allstub_matchTP_pt; + delete m_allstub_matchTP_eta; + delete m_allstub_matchTP_phi; + delete m_allstub_genuine; + + delete m_pv_L1reco; + delete m_pv_L1reco_sum; + delete m_pv_L1reco_emu; + delete m_pv_L1reco_sum_emu; + delete m_pv_MC; + delete m_MC_lep; + + delete m_trkjet_eta; + delete m_trkjet_vz; + delete m_trkjet_phi; + delete m_trkjet_p; + delete m_trkjet_pt; + delete m_trkjet_ntracks; + delete m_trkjet_nDisplaced; + delete m_trkjet_nTight; + delete m_trkjet_nTightDisplaced; + delete m_trkjet_ntdtrk; + + delete m_trkjetem_pt; + delete m_trkjetem_phi; + delete m_trkjetem_eta; + delete m_trkjetem_z; + delete m_trkjetem_ntracks; + delete m_trkjetem_nxtracks; + + delete m_trkfastjet_eta; + delete m_trkfastjet_vz; + delete m_trkfastjet_phi; + delete m_trkfastjet_p; + delete m_trkfastjet_pt; + delete m_trkfastjet_ntracks; + delete m_trkfastjet_tp_sumpt; + delete m_trkfastjet_truetp_sumpt; + + delete m_trkjetExt_eta; + delete m_trkjetExt_vz; + delete m_trkjetExt_phi; + delete m_trkjetExt_p; + delete m_trkjetExt_pt; + delete m_trkjetExt_ntracks; + delete m_trkjetExt_nDisplaced; + delete m_trkjetExt_nTight; + delete m_trkjetExt_nTightDisplaced; + delete m_trkjetExt_ntdtrk; + + delete m_trkjetemExt_pt; + delete m_trkjetemExt_phi; + delete m_trkjetemExt_eta; + delete m_trkjetemExt_z; + delete m_trkjetemExt_ntracks; + delete m_trkjetemExt_nxtracks; + + delete m_trkfastjetExt_eta; + delete m_trkfastjetExt_vz; + delete m_trkfastjetExt_phi; + delete m_trkfastjetExt_p; + delete m_trkfastjetExt_pt; + delete m_trkfastjetExt_ntracks; + delete m_trkfastjetExt_tp_sumpt; + delete m_trkfastjetExt_truetp_sumpt; } //////////// @@ -624,6 +972,16 @@ void L1TrackObjectNtupleMaker::beginJob() { m_trk_gtt_phi = new std::vector; m_trk_selected_index = new std::vector; m_trk_selected_emulation_index = new std::vector; + m_trk_selected_associated_index = new std::vector; + m_trk_selected_associated_emulation_index = new std::vector; + m_trk_selected_forjets_index = new std::vector; + m_trk_selected_emulation_forjets_index = new std::vector; + m_trk_selected_associated_forjets_index = new std::vector; + m_trk_selected_associated_emulation_forjets_index = new std::vector; + m_trk_selected_foretmiss_index = new std::vector; + m_trk_selected_emulation_foretmiss_index = new std::vector; + m_trk_selected_associated_foretmiss_index = new std::vector; + m_trk_selected_associated_emulation_foretmiss_index = new std::vector; m_trkExt_pt = new std::vector; m_trkExt_eta = new std::vector; @@ -659,6 +1017,16 @@ void L1TrackObjectNtupleMaker::beginJob() { m_trkExt_gtt_phi = new std::vector; m_trkExt_selected_index = new std::vector; m_trkExt_selected_emulation_index = new std::vector; + m_trkExt_selected_associated_index = new std::vector; + m_trkExt_selected_associated_emulation_index = new std::vector; + m_trkExt_selected_forjets_index = new std::vector; + m_trkExt_selected_emulation_forjets_index = new std::vector; + m_trkExt_selected_associated_forjets_index = new std::vector; + m_trkExt_selected_associated_emulation_forjets_index = new std::vector; + m_trkExt_selected_foretmiss_index = new std::vector; + m_trkExt_selected_emulation_foretmiss_index = new std::vector; + m_trkExt_selected_associated_foretmiss_index = new std::vector; + m_trkExt_selected_associated_emulation_foretmiss_index = new std::vector; m_tp_pt = new std::vector; m_tp_eta = new std::vector; @@ -827,6 +1195,18 @@ void L1TrackObjectNtupleMaker::beginJob() { eventTree->Branch("trk_gtt_phi", &m_trk_gtt_phi); eventTree->Branch("trk_gtt_selected_index", &m_trk_selected_index); eventTree->Branch("trk_gtt_selected_emulation_index", &m_trk_selected_emulation_index); + eventTree->Branch("trk_gtt_selected_associated_index", &m_trk_selected_associated_index); + eventTree->Branch("trk_gtt_selected_associated_emulation_index", &m_trk_selected_associated_emulation_index); + eventTree->Branch("trk_gtt_selected_forjets_index", &m_trk_selected_forjets_index); + eventTree->Branch("trk_gtt_selected_emulation_forjets_index", &m_trk_selected_emulation_forjets_index); + eventTree->Branch("trk_gtt_selected_associated_forjets_index", &m_trk_selected_associated_forjets_index); + eventTree->Branch("trk_gtt_selected_associated_emulation_forjets_index", + &m_trk_selected_associated_emulation_forjets_index); + eventTree->Branch("trk_gtt_selected_foretmiss_index", &m_trk_selected_foretmiss_index); + eventTree->Branch("trk_gtt_selected_emulation_foretmiss_index", &m_trk_selected_emulation_foretmiss_index); + eventTree->Branch("trk_gtt_selected_associated_foretmiss_index", &m_trk_selected_associated_foretmiss_index); + eventTree->Branch("trk_gtt_selected_associated_emulation_foretmiss_index", + &m_trk_selected_associated_emulation_foretmiss_index); } if (SaveAllTracks && (Displaced == "Displaced" || Displaced == "Both")) { @@ -864,6 +1244,18 @@ void L1TrackObjectNtupleMaker::beginJob() { eventTree->Branch("trkExt_gtt_phi", &m_trkExt_gtt_phi); eventTree->Branch("trkExt_gtt_selected_index", &m_trkExt_selected_index); eventTree->Branch("trkExt_gtt_selected_emulation_index", &m_trkExt_selected_emulation_index); + eventTree->Branch("trkExt_gtt_selected_associated_index", &m_trkExt_selected_associated_index); + eventTree->Branch("trkExt_gtt_selected_associated_emulation_index", &m_trkExt_selected_associated_emulation_index); + eventTree->Branch("trkExt_gtt_selected_forjets_index", &m_trkExt_selected_forjets_index); + eventTree->Branch("trkExt_gtt_selected_emulation_forjets_index", &m_trkExt_selected_emulation_forjets_index); + eventTree->Branch("trkExt_gtt_selected_associated_forjets_index", &m_trkExt_selected_associated_forjets_index); + eventTree->Branch("trkExt_gtt_selected_associated_emulation_forjets_index", + &m_trkExt_selected_associated_emulation_forjets_index); + eventTree->Branch("trkExt_gtt_selected_foretmiss_index", &m_trkExt_selected_foretmiss_index); + eventTree->Branch("trkExt_gtt_selected_emulation_foretmiss_index", &m_trkExt_selected_emulation_foretmiss_index); + eventTree->Branch("trkExt_gtt_selected_associated_foretmiss_index", &m_trkExt_selected_associated_foretmiss_index); + eventTree->Branch("trkExt_gtt_selected_associated_emulation_foretmiss_index", + &m_trkExt_selected_associated_emulation_foretmiss_index); } eventTree->Branch("tp_pt", &m_tp_pt); eventTree->Branch("tp_eta", &m_tp_eta); @@ -1076,6 +1468,16 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even m_trk_gtt_phi->clear(); m_trk_selected_index->clear(); m_trk_selected_emulation_index->clear(); + m_trk_selected_associated_index->clear(); + m_trk_selected_associated_emulation_index->clear(); + m_trk_selected_forjets_index->clear(); + m_trk_selected_emulation_forjets_index->clear(); + m_trk_selected_associated_forjets_index->clear(); + m_trk_selected_associated_emulation_forjets_index->clear(); + m_trk_selected_foretmiss_index->clear(); + m_trk_selected_emulation_foretmiss_index->clear(); + m_trk_selected_associated_foretmiss_index->clear(); + m_trk_selected_associated_emulation_foretmiss_index->clear(); } if (SaveAllTracks && (Displaced == "Displaced" || Displaced == "Both")) { m_trkExt_pt->clear(); @@ -1112,6 +1514,16 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even m_trkExt_gtt_phi->clear(); m_trkExt_selected_index->clear(); m_trkExt_selected_emulation_index->clear(); + m_trkExt_selected_associated_index->clear(); + m_trkExt_selected_associated_emulation_index->clear(); + m_trkExt_selected_forjets_index->clear(); + m_trkExt_selected_emulation_forjets_index->clear(); + m_trkExt_selected_associated_forjets_index->clear(); + m_trkExt_selected_associated_emulation_forjets_index->clear(); + m_trkExt_selected_foretmiss_index->clear(); + m_trkExt_selected_emulation_foretmiss_index->clear(); + m_trkExt_selected_associated_foretmiss_index->clear(); + m_trkExt_selected_associated_emulation_foretmiss_index->clear(); } m_tp_pt->clear(); m_tp_eta->clear(); @@ -1317,8 +1729,28 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even edm::Handle TTTrackExtendedGTTHandle; edm::Handle TTTrackSelectedHandle; edm::Handle TTTrackSelectedEmulationHandle; + edm::Handle TTTrackSelectedAssociatedHandle; + edm::Handle TTTrackSelectedAssociatedEmulationHandle; + edm::Handle TTTrackSelectedForJetsHandle; + edm::Handle TTTrackSelectedEmulationForJetsHandle; + edm::Handle TTTrackSelectedAssociatedForJetsHandle; + edm::Handle TTTrackSelectedAssociatedEmulationForJetsHandle; + edm::Handle TTTrackSelectedForEtMissHandle; + edm::Handle TTTrackSelectedEmulationForEtMissHandle; + edm::Handle TTTrackSelectedAssociatedForEtMissHandle; + edm::Handle TTTrackSelectedAssociatedEmulationForEtMissHandle; + edm::Handle TTTrackExtendedSelectedAssociatedHandle; + edm::Handle TTTrackExtendedSelectedAssociatedEmulationHandle; edm::Handle TTTrackExtendedSelectedHandle; edm::Handle TTTrackExtendedSelectedEmulationHandle; + edm::Handle TTTrackExtendedSelectedAssociatedForJetsHandle; + edm::Handle TTTrackExtendedSelectedAssociatedEmulationForJetsHandle; + edm::Handle TTTrackExtendedSelectedForJetsHandle; + edm::Handle TTTrackExtendedSelectedEmulationForJetsHandle; + edm::Handle TTTrackExtendedSelectedAssociatedForEtMissHandle; + edm::Handle TTTrackExtendedSelectedAssociatedEmulationForEtMissHandle; + edm::Handle TTTrackExtendedSelectedForEtMissHandle; + edm::Handle TTTrackExtendedSelectedEmulationForEtMissHandle; L1TrackCollection::const_iterator iterL1Track; if (Displaced == "Prompt" || Displaced == "Both") { @@ -1334,6 +1766,17 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even iEvent.getByToken(ttTrackGTTToken_, TTTrackGTTHandle); iEvent.getByToken(ttTrackSelectedToken_, TTTrackSelectedHandle); iEvent.getByToken(ttTrackSelectedEmulationToken_, TTTrackSelectedEmulationHandle); + iEvent.getByToken(ttTrackSelectedAssociatedToken_, TTTrackSelectedAssociatedHandle); + iEvent.getByToken(ttTrackSelectedAssociatedEmulationToken_, TTTrackSelectedAssociatedEmulationHandle); + iEvent.getByToken(ttTrackSelectedForJetsToken_, TTTrackSelectedForJetsHandle); + iEvent.getByToken(ttTrackSelectedEmulationForJetsToken_, TTTrackSelectedEmulationForJetsHandle); + iEvent.getByToken(ttTrackSelectedAssociatedForJetsToken_, TTTrackSelectedAssociatedForJetsHandle); + iEvent.getByToken(ttTrackSelectedAssociatedEmulationForJetsToken_, TTTrackSelectedAssociatedEmulationForJetsHandle); + iEvent.getByToken(ttTrackSelectedForEtMissToken_, TTTrackSelectedForEtMissHandle); + iEvent.getByToken(ttTrackSelectedEmulationForEtMissToken_, TTTrackSelectedEmulationForEtMissHandle); + iEvent.getByToken(ttTrackSelectedAssociatedForEtMissToken_, TTTrackSelectedAssociatedForEtMissHandle); + iEvent.getByToken(ttTrackSelectedAssociatedEmulationForEtMissToken_, + TTTrackSelectedAssociatedEmulationForEtMissHandle); } if (Displaced == "Displaced" || Displaced == "Both") { iEvent.getByToken(TrackFastJetsExtendedToken_, TrackFastJetsExtendedHandle); @@ -1347,6 +1790,20 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even iEvent.getByToken(ttTrackExtendedGTTToken_, TTTrackExtendedGTTHandle); iEvent.getByToken(ttTrackExtendedSelectedToken_, TTTrackExtendedSelectedHandle); iEvent.getByToken(ttTrackExtendedSelectedEmulationToken_, TTTrackExtendedSelectedEmulationHandle); + iEvent.getByToken(ttTrackExtendedSelectedAssociatedToken_, TTTrackExtendedSelectedAssociatedHandle); + iEvent.getByToken(ttTrackExtendedSelectedAssociatedEmulationToken_, + TTTrackExtendedSelectedAssociatedEmulationHandle); + iEvent.getByToken(ttTrackExtendedSelectedForJetsToken_, TTTrackExtendedSelectedForJetsHandle); + iEvent.getByToken(ttTrackExtendedSelectedEmulationForJetsToken_, TTTrackExtendedSelectedEmulationForJetsHandle); + iEvent.getByToken(ttTrackExtendedSelectedAssociatedForJetsToken_, TTTrackExtendedSelectedAssociatedForJetsHandle); + iEvent.getByToken(ttTrackExtendedSelectedAssociatedEmulationForJetsToken_, + TTTrackExtendedSelectedAssociatedEmulationForJetsHandle); + iEvent.getByToken(ttTrackExtendedSelectedForEtMissToken_, TTTrackExtendedSelectedForEtMissHandle); + iEvent.getByToken(ttTrackExtendedSelectedEmulationForEtMissToken_, TTTrackExtendedSelectedEmulationForEtMissHandle); + iEvent.getByToken(ttTrackExtendedSelectedAssociatedForEtMissToken_, + TTTrackExtendedSelectedAssociatedForEtMissHandle); + iEvent.getByToken(ttTrackExtendedSelectedAssociatedEmulationForEtMissToken_, + TTTrackExtendedSelectedAssociatedEmulationForEtMissHandle); } //Loop over gen particles @@ -1670,6 +2127,23 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even m_trk_gtt_phi->push_back(l1track_ref->momentum().phi()); m_trk_selected_index->push_back(getSelectedTrackIndex(l1track_ref, TTTrackSelectedHandle)); m_trk_selected_emulation_index->push_back(getSelectedTrackIndex(l1track_ref, TTTrackSelectedEmulationHandle)); + m_trk_selected_associated_index->push_back(getSelectedTrackIndex(l1track_ref, TTTrackSelectedAssociatedHandle)); + m_trk_selected_associated_emulation_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedAssociatedEmulationHandle)); + m_trk_selected_forjets_index->push_back(getSelectedTrackIndex(l1track_ref, TTTrackSelectedForJetsHandle)); + m_trk_selected_emulation_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedEmulationForJetsHandle)); + m_trk_selected_associated_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedAssociatedForJetsHandle)); + m_trk_selected_associated_emulation_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedAssociatedEmulationForJetsHandle)); + m_trk_selected_foretmiss_index->push_back(getSelectedTrackIndex(l1track_ref, TTTrackSelectedForEtMissHandle)); + m_trk_selected_emulation_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedEmulationForEtMissHandle)); + m_trk_selected_associated_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedAssociatedForEtMissHandle)); + m_trk_selected_associated_emulation_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackSelectedAssociatedEmulationForEtMissHandle)); } //end track loop } //end if SaveAllTracks @@ -1864,6 +2338,26 @@ void L1TrackObjectNtupleMaker::analyze(const edm::Event& iEvent, const edm::Even m_trkExt_selected_index->push_back(getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedHandle)); m_trkExt_selected_emulation_index->push_back( getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedEmulationHandle)); + m_trkExt_selected_associated_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedAssociatedHandle)); + m_trkExt_selected_associated_emulation_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedAssociatedEmulationHandle)); + m_trkExt_selected_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedForJetsHandle)); + m_trkExt_selected_emulation_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedEmulationForJetsHandle)); + m_trkExt_selected_associated_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedAssociatedForJetsHandle)); + m_trkExt_selected_associated_emulation_forjets_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedAssociatedEmulationForJetsHandle)); + m_trkExt_selected_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedForEtMissHandle)); + m_trkExt_selected_emulation_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedEmulationForEtMissHandle)); + m_trkExt_selected_associated_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedAssociatedForEtMissHandle)); + m_trkExt_selected_associated_emulation_foretmiss_index->push_back( + getSelectedTrackIndex(l1track_ref, TTTrackExtendedSelectedAssociatedEmulationForEtMissHandle)); } //end track loop } //end if SaveAllTracks (displaced) diff --git a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py index fec76b17dc647..1ed60ec5c6553 100644 --- a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py +++ b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py @@ -83,6 +83,7 @@ process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff") process.load("L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi") +process.load("L1Trigger.L1TTrackMatch.l1tTrackVertexAssociationProducer_cfi") process.load("L1Trigger.L1TTrackMatch.l1tTrackJets_cfi") process.load("L1Trigger.L1TTrackMatch.l1tGTTInputProducer_cfi") process.load("L1Trigger.L1TTrackMatch.l1tTrackJetsEmulation_cfi") @@ -97,30 +98,19 @@ ############################################################ # Primary vertex ############################################################ -process.l1tVertexFinder = process.l1tVertexProducer.clone() process.pPV = cms.Path(process.l1tVertexFinder) -process.l1tVertexFinderEmulator = process.l1tVertexProducer.clone() -process.l1tVertexFinderEmulator.VertexReconstruction.Algorithm = "fastHistoEmulation" -process.l1tVertexFinderEmulator.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted") -process.l1tVertexFinderEmulator.VertexReconstruction.VxMinTrackPt = cms.double(0.0) process.pPVemu = cms.Path(process.l1tVertexFinderEmulator) -process.l1tTrackFastJets.L1PrimaryVertexTag = cms.InputTag("l1tVertexFinder", "l1vertices") -process.l1tTrackFastJetsExtended.L1PrimaryVertexTag = cms.InputTag("l1tVertexFinder", "l1vertices") -process.l1tTrackJets.L1PVertexInputTag = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation") -process.l1tTrackJetsExtended.L1PVertexInputTag = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation") -process.l1tTrackerEtMiss.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices") -process.l1tTrackerHTMiss.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices") -process.l1tTrackerEtMissExtended.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices") -process.l1tTrackerHTMissExtended.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices") -process.l1tTrackerEmuEtMiss.L1VertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation") - - # HYBRID: prompt tracking if (L1TRKALGO == 'HYBRID'): process.TTTracksEmu = cms.Path(process.L1THybridTracks) process.TTTracksEmuWithTruth = cms.Path(process.L1THybridTracksWithAssociators) - process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer) + process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer * + process.l1tTrackSelectionProducerForJets * + process.l1tTrackSelectionProducerForEtMiss) + process.pL1TrackVertexAssociation = cms.Path(process.l1tTrackVertexAssociationProducer* + process.l1tTrackVertexAssociationProducerForJets* + process.l1tTrackVertexAssociationProducerForEtMiss) process.pL1TrackJets = cms.Path(process.l1tTrackJets) process.pL1TrackFastJets=cms.Path(process.l1tTrackFastJets) process.pL1GTTInput = cms.Path(process.l1tGTTInputProducer) @@ -135,7 +125,13 @@ elif (L1TRKALGO == 'HYBRID_DISPLACED'): process.TTTracksEmu = cms.Path(process.L1TExtendedHybridTracks) process.TTTracksEmuWithTruth = cms.Path(process.L1TExtendedHybridTracksWithAssociators) - process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducerExtended) + process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer * + process.l1tTrackSelectionProducerExtended * + process.l1tTrackSelectionProducerExtendedForJets * + process.l1tTrackSelectionProducerExtendedForEtMiss) + process.pL1TrackVertexAssociation = cms.Path(process.l1tTrackVertexAssociationProducerExtended * + process.l1tTrackVertexAssociationProducerExtendedForJets * + process.l1tTrackVertexAssociationProducerExtendedForEtMiss) process.pL1TrackJets = cms.Path(process.l1tTrackJetsExtended) process.pL1TrackFastJets = cms.Path(process.l1tTrackFastJetsExtended) process.pL1GTTInput = cms.Path(process.l1tGTTInputProducerExtended) @@ -149,7 +145,12 @@ elif (L1TRKALGO == 'HYBRID_PROMPTANDDISP'): process.TTTracksEmu = cms.Path(process.L1TPromptExtendedHybridTracks) process.TTTracksEmuWithTruth = cms.Path(process.L1TPromptExtendedHybridTracksWithAssociators) - process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer*process.l1tTrackSelectionProducerExtended) + process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer * process.l1tTrackSelectionProducerExtended * + process.l1tTrackSelectionProducerForJets * process.l1tTrackSelectionProducerExtendedForJets * + process.l1tTrackSelectionProducerForEtMiss * process.l1tTrackSelectionProducerExtendedForEtMiss) + process.pL1TrackVertexAssociation = cms.Path(process.l1tTrackVertexAssociationProducer * process.l1tTrackVertexAssociationProducerExtended * + process.l1tTrackVertexAssociationProducerForJets * process.l1tTrackVertexAssociationProducerExtendedForJets * + process.l1tTrackVertexAssociationProducerForEtMiss * process.l1tTrackVertexAssociationProducerExtendedForEtMiss) process.pL1TrackJets = cms.Path(process.l1tTrackJets*process.l1tTrackJetsExtended) process.pL1TrackFastJets = cms.Path(process.l1tTrackFastJets*process.l1tTrackFastJetsExtended) process.pL1GTTInput = cms.Path(process.l1tGTTInputProducer*process.l1tGTTInputProducerExtended) @@ -193,8 +194,34 @@ L1TrackExtendedGTTInputTag = cms.InputTag("l1tGTTInputProducerExtended","Level1TTTracksExtendedConverted"), # TTTracks, extended, GTT converted L1TrackSelectedInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"), # TTTracks, prompt, selected L1TrackSelectedEmulationInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation"), # TTTracks, prompt, emulation, selected - L1TrackExtendedSelectedInputTag = cms.InputTag("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelected"), # TTTracks, extended, selected - L1TrackExtendedSelectedEmulationInputTag = cms.InputTag("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelectedEmulation"), # TTTracks, extended, emulation, selected + L1TrackSelectedAssociatedInputTag = cms.InputTag("l1tTrackVertexAssociationProducer", "Level1TTTracksSelectedAssociated"), # TTTracks, prompt, selected, associated + L1TrackSelectedAssociatedEmulationInputTag = cms.InputTag("l1tTrackVertexAssociationProducer", "Level1TTTracksSelectedAssociatedEmulation"), # TTTracks, prompt, emulation, selected, associated + + L1TrackSelectedForJetsInputTag = cms.InputTag("l1tTrackSelectionProducerForJets", "Level1TTTracksSelected"), # TTTracks, prompt, selected + L1TrackSelectedEmulationForJetsInputTag = cms.InputTag("l1tTrackSelectionProducerForJets", "Level1TTTracksSelectedEmulation"), # TTTracks, prompt, emulation, selected + L1TrackSelectedAssociatedForJetsInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociated"), # TTTracks, prompt, selected, associated + L1TrackSelectedAssociatedEmulationForJetsInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociatedEmulation"), # TTTracks, prompt, emulation, selected, associated + + L1TrackSelectedForEtMissInputTag = cms.InputTag("l1tTrackSelectionProducerForEtMiss", "Level1TTTracksSelected"), # TTTracks, prompt, selected + L1TrackSelectedEmulationForEtMissInputTag = cms.InputTag("l1tTrackSelectionProducerForEtMiss", "Level1TTTracksSelectedEmulation"), # TTTracks, prompt, emulation, selected + L1TrackSelectedAssociatedForEtMissInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForEtMiss", "Level1TTTracksSelectedAssociated"), # TTTracks, prompt, selected, associated + L1TrackSelectedAssociatedEmulationForEtMissInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForEtMiss", "Level1TTTracksSelectedAssociatedEmulation"), # TTTracks, prompt, emulation, selected, associated + + L1TrackExtendedSelectedInputTag = cms.InputTag("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelected"), # TTTracks, extended, selected + L1TrackExtendedSelectedEmulationInputTag = cms.InputTag("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelectedEmulation"), # TTTracks, extended, emulation, selected + L1TrackExtendedSelectedAssociatedInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtended", "Level1TTTracksExtendedSelectedAssociated"), # TTTracks, extended, selected, associated + L1TrackExtendedSelectedAssociatedEmulationInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtended", "Level1TTTracksExtendedSelectedAssociatedEmulation"), # TTTracks, extended, emulation, selected, associated + + L1TrackExtendedSelectedForJetsInputTag = cms.InputTag("l1tTrackSelectionProducerExtendedForJets", "Level1TTTracksExtendedSelected"), # TTTracks, extended, selected + L1TrackExtendedSelectedEmulationForJetsInputTag = cms.InputTag("l1tTrackSelectionProducerExtendedForJets", "Level1TTTracksExtendedSelectedEmulation"), # TTTracks, extended, emulation, selected + L1TrackExtendedSelectedAssociatedForJetsInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtendedForJets", "Level1TTTracksExtendedSelectedAssociated"), # TTTracks, extended, selected, associated + L1TrackExtendedSelectedAssociatedEmulationForJetsInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtendedForJets", "Level1TTTracksExtendedSelectedAssociatedEmulation"), # TTTracks, extended, emulation, selected, associated + + L1TrackExtendedSelectedForEtMissInputTag = cms.InputTag("l1tTrackSelectionProducerExtendedForEtMiss", "Level1TTTracksExtendedSelected"), # TTTracks, extended, selected + L1TrackExtendedSelectedEmulationForEtMissInputTag = cms.InputTag("l1tTrackSelectionProducerExtendedForEtMiss", "Level1TTTracksExtendedSelectedEmulation"), # TTTracks, extended, emulation, selected + L1TrackExtendedSelectedAssociatedForEtMissInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtendedForEtMiss", "Level1TTTracksExtendedSelectedAssociated"), # TTTracks, extended, selected, associated + L1TrackExtendedSelectedAssociatedEmulationForEtMissInputTag = cms.InputTag("l1tTrackVertexAssociationProducerExtendedForEtMiss", "Level1TTTracksExtendedSelectedAssociatedEmulation"), # TTTracks, extended, emulation, selected, associated + L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"), MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"), MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"), @@ -238,7 +265,4 @@ # use this if cluster/stub associators not available # process.schedule = cms.Schedule(process.TTClusterStubTruth,process.TTTracksEmuWithTruth,process.ntuple) -process.schedule = cms.Schedule(process.TTClusterStub, process.TTClusterStubTruth, process.dtc, process.TTTracksEmuWithTruth, process.pL1GTTInput, process.pPV, process.pPVemu, process.pL1TrackSelection, process.pL1TrackJets, process.pL1TrackJetsEmu,process.pL1TrackFastJets, process.pTkMET, process.pTkMETEmu, process.pTkMHT, process.pTkMHTEmulator, process.ntuple) - - - +process.schedule = cms.Schedule(process.TTClusterStub, process.TTClusterStubTruth, process.dtc, process.TTTracksEmuWithTruth, process.pL1GTTInput, process.pL1TrackSelection, process.pPV, process.pPVemu,process.pL1TrackVertexAssociation, process.pL1TrackJets, process.pL1TrackJetsEmu,process.pL1TrackFastJets, process.pTkMET, process.pTkMETEmu, process.pTkMHT, process.pTkMHTEmulator, process.ntuple) From 57125f0253d8c5b71c4b64d0d679a71661a41b03 Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Wed, 28 Jun 2023 09:27:12 +0200 Subject: [PATCH 5/6] Harmonize l1vertices to L1Vertices Port note: files not present in master removed: L1Trigger/L1TNtuples/plugins/L1PhaseIITreeProducer.cc L1Trigger/L1TNtuples/plugins/L1PhaseIITreeStep1Producer.cc L1Trigger/L1TNtuples/python/l1PhaseIITreeProducer_cfi.py L1Trigger/L1TNtuples/python/l1PhaseIITreeStep1Producer_cfi.py --- DQMOffline/L1Trigger/python/L1TPhase2Offline_cfi.py | 2 +- L1Trigger/DemonstratorTools/plugins/GTTFileWriter.cc | 2 +- .../DemonstratorTools/python/l1tGTTFileWriter_cfi.py | 2 +- .../test/gtt/createFirmwareInputFiles_cfg.py | 2 +- .../L1TTrackMatch/plugins/L1FastTrackingJetProducer.cc | 2 +- .../L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc | 2 +- L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc | 2 +- .../plugins/L1TrackVertexAssociationProducer.cc | 4 ++-- .../python/l1tFastTrackingJetProducer_cfi.py | 4 ++-- L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py | 4 ++-- .../L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py | 4 ++-- L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py | 2 +- .../python/l1tTrackVertexAssociationProducer_cfi.py | 4 ++-- L1Trigger/L1TTrackMatch/python/l1tTrackerEmuEtMiss_cfi.py | 2 +- L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py | 6 +++--- L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py | 4 ++-- .../L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py | 4 ++-- L1Trigger/Phase2L1ParticleFlow/plugins/L1BJetProducer.cc | 2 +- .../Phase2L1ParticleFlow/python/L1BJetProducer_cff.py | 2 +- L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py | 8 ++++---- L1Trigger/Phase2L1Taus/plugins/HPSPFTauProducer.cc | 2 +- L1Trigger/VertexFinder/python/l1tVertexNTupler_cfi.py | 2 +- L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py | 2 +- L1Trigger/VertexFinder/test/vertexNTupler_cfg.py | 6 +++--- 24 files changed, 38 insertions(+), 38 deletions(-) diff --git a/DQMOffline/L1Trigger/python/L1TPhase2Offline_cfi.py b/DQMOffline/L1Trigger/python/L1TPhase2Offline_cfi.py index 01ede6aaa5785..f5adb89fb4bcf 100644 --- a/DQMOffline/L1Trigger/python/L1TPhase2Offline_cfi.py +++ b/DQMOffline/L1Trigger/python/L1TPhase2Offline_cfi.py @@ -6,7 +6,7 @@ OuterTrackerTkMET = DQMEDAnalyzer('L1TPhase2OuterTrackerTkMET', TopFolderName = cms.string('L1T/L1TPhase2/'), TTTracksTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), - L1VertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), + L1VertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"), maxZ0 = cms.double ( 15. ) , # in cm maxEta = cms.double ( 2.4 ) , chi2dofMax = cms.double( 10. ), diff --git a/L1Trigger/DemonstratorTools/plugins/GTTFileWriter.cc b/L1Trigger/DemonstratorTools/plugins/GTTFileWriter.cc index a9fe05c34a399..c79de7f8ee836 100644 --- a/L1Trigger/DemonstratorTools/plugins/GTTFileWriter.cc +++ b/L1Trigger/DemonstratorTools/plugins/GTTFileWriter.cc @@ -305,7 +305,7 @@ void GTTFileWriter::fillDescriptions(edm::ConfigurationDescriptions& description desc.addUntracked( "vertexAssociatedTracks", edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedAssociatedEmulation")); - desc.addUntracked("vertices", edm::InputTag("l1tVertexProducer", "l1verticesEmulation")); + desc.addUntracked("vertices", edm::InputTag("l1tVertexProducer", "L1VerticesEmulation")); desc.addUntracked("jets", edm::InputTag("l1tTrackJetsEmulation", "L1TrackJets")); desc.addUntracked("htmiss", edm::InputTag("l1tTrackerEmuHTMiss", "L1TrackerEmuHTMiss")); desc.addUntracked("etmiss", edm::InputTag("l1tTrackerEmuEtMiss", "L1TrackerEmuEtMiss")); diff --git a/L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py b/L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py index 2f4298e20923c..3274a1667359c 100644 --- a/L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py +++ b/L1Trigger/DemonstratorTools/python/l1tGTTFileWriter_cfi.py @@ -3,7 +3,7 @@ l1tGTTFileWriter = cms.EDAnalyzer('GTTFileWriter', tracks = cms.untracked.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), convertedTracks = cms.untracked.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted"), - vertices = cms.untracked.InputTag("l1tVertexProducer", "l1verticesEmulation"), + vertices = cms.untracked.InputTag("l1tVertexProducer", "L1VerticesEmulation"), selectedTracks = cms.untracked.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation"), vertexAssociatedTracks = cms.untracked.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedAssociatedEmulation"), jets = cms.untracked.InputTag("l1tTrackJetsEmulation","L1TrackJets"), diff --git a/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py b/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py index 002ea74c5dfbf..1a5540c377d94 100644 --- a/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py +++ b/L1Trigger/DemonstratorTools/test/gtt/createFirmwareInputFiles_cfg.py @@ -124,7 +124,7 @@ process.l1tGTTFileWriter.tracks = cms.untracked.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks") process.l1tGTTFileWriter.convertedTracks = cms.untracked.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted") process.l1tGTTFileWriter.selectedTracks = cms.untracked.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation") -process.l1tGTTFileWriter.vertices = cms.untracked.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation") +process.l1tGTTFileWriter.vertices = cms.untracked.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation") process.l1tGTTFileWriter.vertexAssociatedTracks = cms.untracked.InputTag("l1tTrackVertexAssociationProducer", "Level1TTTracksSelectedAssociatedEmulation") process.l1tGTTFileWriter.jets = cms.untracked.InputTag("l1tTrackJetsEmulation","L1TrackJets") process.l1tGTTFileWriter.htmiss = cms.untracked.InputTag("l1tTrackerEmuHTMiss", "L1TrackerEmuHTMiss") diff --git a/L1Trigger/L1TTrackMatch/plugins/L1FastTrackingJetProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1FastTrackingJetProducer.cc index f7113e9e97192..44d8880b7457d 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1FastTrackingJetProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1FastTrackingJetProducer.cc @@ -257,7 +257,7 @@ void L1FastTrackingJetProducer::fillDescriptions(edm::ConfigurationDescriptions& // L1FastTrackingJets edm::ParameterSetDescription desc; desc.add("L1TrackInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks")); - desc.add("L1PrimaryVertexTag", "l1vertices"); + desc.add("L1PrimaryVertexTag", "L1Vertices"); desc.add("GenInfo", edm::InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks")); desc.add("trk_zMax", 15.0); desc.add("trk_chi2dofMax", 10.0); diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc index f13218a2b6468..7382ef37bb818 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc @@ -425,7 +425,7 @@ void L1TrackJetEmulatorProducer::fillDescriptions(ConfigurationDescriptions &des // Please change this to state exactly what you do use, even if it is no parameters ParameterSetDescription desc; desc.add("L1TrackInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks")); - desc.add("L1PVertexInputTag", edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")); + desc.add("L1PVertexInputTag", edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation")); desc.add("MaxDzTrackPV", 1.0); desc.add("trk_zMax", 15.0); desc.add("trk_ptMax", 200.0); diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc index d76ab4dfca649..80da20559d827 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc @@ -358,7 +358,7 @@ void L1TrackJetProducer::produce(Event &iEvent, const EventSetup &iSetup) { void L1TrackJetProducer::fillDescriptions(ConfigurationDescriptions &descriptions) { ParameterSetDescription desc; desc.add("L1TrackInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks")); - desc.add("L1PVertexInputTag", edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")); + desc.add("L1PVertexInputTag", edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation")); desc.add("MaxDzTrackPV", 1.0); desc.add("trk_zMax", 15.0); desc.add("trk_ptMax", 200.0); diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc index 8d3ce322c5885..7640ce63b1349 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc @@ -421,9 +421,9 @@ void L1TrackVertexAssociationProducer::fillDescriptions(edm::ConfigurationDescri edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected")); desc.add("l1SelectedTracksEmulationInputTag", edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation")); - desc.add("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "l1vertices")); + desc.add("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "L1Vertices")); desc.add("l1VerticesEmulationInputTag", - edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")); + edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation")); desc.add("outputCollectionName", "Level1TTTracksSelectedAssociated"); { edm::ParameterSetDescription descCutSet; diff --git a/L1Trigger/L1TTrackMatch/python/l1tFastTrackingJetProducer_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tFastTrackingJetProducer_cfi.py index f28047728f903..c81bf7a14ef39 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tFastTrackingJetProducer_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tFastTrackingJetProducer_cfi.py @@ -2,7 +2,7 @@ l1tFastTrackingJets = cms.EDProducer("L1FastTrackingJetProducer", L1TrackInputTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), - L1PrimaryVertexTag=cms.InputTag("l1tVertexProducer", "l1vertices"), + L1PrimaryVertexTag=cms.InputTag("l1tVertexProducer", "L1Vertices"), GenInfo = cms.InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks"), trk_zMax = cms.double(15.), # max track z0 [cm] trk_chi2dofMax = cms.double(10.), # max track chi2/dof @@ -24,7 +24,7 @@ l1tFastTrackingJetsExtended = cms.EDProducer("L1FastTrackingJetProducer", L1TrackInputTag = cms.InputTag("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"), - L1PrimaryVertexTag=cms.InputTag("l1tVertexProducer", "l1vertices"), + L1PrimaryVertexTag=cms.InputTag("l1tVertexProducer", "L1Vertices"), GenInfo = cms.InputTag("TTTrackAssociatorFromPixelDigisExtended", "Level1TTTracks"), trk_zMax = cms.double(15.), # max track z0 [cm] trk_chi2dofMax = cms.double(40.), # max track chi2 for extended tracks diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py index b105fbfca9b24..183244e7d0ad1 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackFastJets_cfi.py @@ -2,7 +2,7 @@ l1tTrackFastJets = cms.EDProducer("L1TrackFastJetProducer", L1TrackInputTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"), - L1PrimaryVertexTag=cms.InputTag("l1tVertexFinder", "l1vertices"), + L1PrimaryVertexTag=cms.InputTag("l1tVertexFinder", "L1Vertices"), trk_zMax = cms.double(15.), # max track z0 [cm] trk_chi2dofMax = cms.double(10.), # max track chi2/dof trk_bendChi2Max = cms.double(2.2),# max bendChi2 cut @@ -20,7 +20,7 @@ l1tTrackFastJetsExtended = cms.EDProducer("L1TrackFastJetProducer", L1TrackInputTag = cms.InputTag("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"), - L1PrimaryVertexTag=cms.InputTag("l1tVertexFinder", "l1vertices"), + L1PrimaryVertexTag=cms.InputTag("l1tVertexFinder", "L1Vertices"), trk_zMax = cms.double(15.), # max track z0 [cm] trk_chi2dofMax = cms.double(40.), # max track chi2 for extended tracks trk_bendChi2Max = cms.double(2.4),#Bendchi2 cut for extended tracks diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py index 33e9db5c045f2..9a227295a7257 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackJetsEmulation_cfi.py @@ -2,7 +2,7 @@ l1tTrackJetsEmulation = cms.EDProducer('L1TrackJetEmulatorProducer', L1TrackInputTag= cms.InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociatedEmulation"), - L1PVertexInputTag=cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + L1PVertexInputTag=cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), MaxDzTrackPV = cms.double(1.0), trk_zMax = cms.double (15.) , # maximum track z trk_ptMax = cms.double(200.), # maximumum track pT before saturation [GeV] @@ -33,7 +33,7 @@ l1tTrackJetsExtendedEmulation = l1tTrackJetsEmulation.clone( L1TrackInputTag= cms.InputTag("l1tTrackVertexAssociationProducerExtendedForJets", "Level1TTTracksExtendedSelectedAssociatedEmulation"), - L1PVertexInputTag=cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), + L1PVertexInputTag=cms.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"), minTrkJetpT= 5.0, # minimum track pt to be considered for track jet MaxDzTrackPV = 5.0, d0_cutNStubs4= -1, # -1 excludes nstub=4 from disp tag diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py index 164682c867295..353d8c5e126e3 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py @@ -3,7 +3,7 @@ #prompt jet selection l1tTrackJets = cms.EDProducer('L1TrackJetProducer', L1TrackInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociated"), - L1PVertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), + L1PVertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"), MaxDzTrackPV = cms.double( 1.0 ), #max distance from PV;negative=no cut trk_zMax = cms.double (15.) , # maximum track z trk_ptMax = cms.double(200.), # maximumum track pT before saturation [GeV] diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackVertexAssociationProducer_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackVertexAssociationProducer_cfi.py index ce2edd419f73c..8510805fa3dd6 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackVertexAssociationProducer_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackVertexAssociationProducer_cfi.py @@ -4,8 +4,8 @@ l1SelectedTracksInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"), l1SelectedTracksEmulationInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation"), # If no vertex collection is provided, then the DeltaZ cuts will not be run - l1VerticesInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), - l1VerticesEmulationInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), + l1VerticesInputTag = cms.InputTag("l1tVertexFinder", "L1Vertices"), + l1VerticesEmulationInputTag = cms.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"), outputCollectionName = cms.string("Level1TTTracksSelectedAssociated"), cutSet = cms.PSet( #deltaZMaxEtaBounds = cms.vdouble(0.0, absEtaMax.value), # these values define the bin boundaries in |eta| diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackerEmuEtMiss_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackerEmuEtMiss_cfi.py index e90addef21ee6..63a1229a2302a 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackerEmuEtMiss_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackerEmuEtMiss_cfi.py @@ -5,7 +5,7 @@ L1TrackAssociatedInputTag = cms.InputTag("l1tTrackVertexAssociationProducerForEtMiss", "Level1TTTracksSelectedAssociatedEmulation"), # To bypass GTT input module use cms.InputTag("TTTracksFromTrackletEmulation", "Level1TTTracks") # and set useGTTinput to false - L1VertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), + L1VertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"), # This will use the vertex algorithm as specified in l1tVertexProducer_cfi, if using emulated vertex # set useVertexEmulator to true L1MetCollectionName = cms.string("L1TrackerEmuEtMiss"), diff --git a/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py b/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py index 6b71a59da2db1..79fac31823c8b 100644 --- a/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py +++ b/L1Trigger/L1TTrackMatch/python/l1tTrackerHTMiss_cfi.py @@ -2,7 +2,7 @@ l1tTkCaloHTMiss = cms.EDProducer("L1TkHTMissProducer", L1TkJetInputTag = cms.InputTag("l1tTkCaloJets", "L1TkCaloJets"), - L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), + L1VertexInputTag = cms.InputTag("l1tVertexFinder", "L1Vertices"), jet_maxEta = cms.double(2.2), # maximum eta of jets for HT jet_minPt = cms.double(15.0), # minimum pt of jets for HT [GeV] jet_minNtracksHighPt=cms.int32(0), #Add track jet quality criteria pT>100 @@ -20,7 +20,7 @@ l1tTrackerHTMiss = cms.EDProducer("L1TkHTMissProducer", L1TkJetInputTag = cms.InputTag("l1tTrackJets", "L1TrackJets"), - L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), + L1VertexInputTag = cms.InputTag("l1tVertexFinder", "L1Vertices"), jet_maxEta = cms.double(2.4), jet_minPt = cms.double(5.0), jet_minNtracksLowPt=cms.int32(2), @@ -36,7 +36,7 @@ l1tTrackerHTMissExtended = cms.EDProducer("L1TkHTMissProducer", L1TkJetInputTag = cms.InputTag("l1tTrackJetsExtended", "L1TrackJetsExtended"), - L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices"), + L1VertexInputTag = cms.InputTag("l1tVertexFinder", "L1Vertices"), jet_maxEta = cms.double(2.4), jet_minPt = cms.double(5.0), jet_minNtracksLowPt=cms.int32(2), diff --git a/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py b/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py index ee8618d2318c3..6c441a3ba61cc 100644 --- a/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py +++ b/L1Trigger/L1TTrackMatch/test/L1TrackMET_cfg.py @@ -82,7 +82,7 @@ producerName = producerName.replace(".","p") # legalize the name producer = process.l1tVertexProducer.clone() producer.VertexReconstruction.Algorithm = cms.string("fastHisto") -process.l1tTrackerEtMiss.L1VertexInputTag = cms.InputTag(producerName,"l1vertices") +process.l1tTrackerEtMiss.L1VertexInputTag = cms.InputTag(producerName,"L1Vertices") setattr(process, producerName, producer) @@ -100,7 +100,7 @@ EmuproducerName = EmuproducerName.replace(".","p") # legalize the name Emuproducer = process.l1tVertexProducer.clone() Emuproducer.VertexReconstruction.Algorithm = cms.string("fastHistoEmulation") -process.l1tTrackerEmuEtMiss.L1VertexInputTag = cms.InputTag(EmuproducerName,"l1verticesEmulation") +process.l1tTrackerEmuEtMiss.L1VertexInputTag = cms.InputTag(EmuproducerName,"L1VerticesEmulation") if GTTInput: Emuproducer.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted") diff --git a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py index 1ed60ec5c6553..e2519cb5dff7e 100644 --- a/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py +++ b/L1Trigger/L1TTrackMatch/test/L1TrackObjectNtupleMaker_cfg.py @@ -245,8 +245,8 @@ TrackMHTEmuInputTag = cms.InputTag("l1tTrackerEmuHTMiss",process.l1tTrackerEmuHTMiss.L1MHTCollectionName.value()), TrackMHTEmuExtendedInputTag = cms.InputTag("l1tTrackerEmuHTMissExtended",process.l1tTrackerEmuHTMissExtended.L1MHTCollectionName.value()), GenParticleInputTag = cms.InputTag("genParticles",""), - RecoVertexInputTag=cms.InputTag("l1tVertexFinder", "l1vertices"), - RecoVertexEmuInputTag=cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"), + RecoVertexInputTag=cms.InputTag("l1tVertexFinder", "L1Vertices"), + RecoVertexEmuInputTag=cms.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"), ) process.ntuple = cms.Path(process.L1TrackNtuple) diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1BJetProducer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1BJetProducer.cc index ef9c2fa8b335a..3db89a84a276e 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1BJetProducer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1BJetProducer.cc @@ -106,7 +106,7 @@ void L1BJetProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptio desc.add("nParticles", 10); desc.add("minPt", 20); desc.add("maxEta", 2.4); - desc.add("vtx", edm::InputTag("L1VertexFinderEmulator", "l1verticesEmulation")); + desc.add("vtx", edm::InputTag("L1VertexFinderEmulator", "L1VerticesEmulation")); descriptions.add("L1BJetProducer", desc); } diff --git a/L1Trigger/Phase2L1ParticleFlow/python/L1BJetProducer_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/L1BJetProducer_cff.py index 51e98c3326277..731d661cfd6c1 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/L1BJetProducer_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/L1BJetProducer_cff.py @@ -7,7 +7,7 @@ jets = ("l1tSCPFL1PuppiExtended", ""), maxJets = 6, minPt = 10, - vtx = ("l1tVertexFinderEmulator","l1verticesEmulation") + vtx = ("l1tVertexFinderEmulator","L1VerticesEmulation") ) diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py index bb2ea1f335401..a0dfb795b4a39 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py @@ -19,7 +19,7 @@ muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), emClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromL1EGClusters:selected')), hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromCombinedCaloHCal:calibrated')), - vtxCollection = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), vtxCollectionEmulation = cms.bool(True), emPtCut = cms.double(0.5), hadPtCut = cms.double(1.0), @@ -160,7 +160,7 @@ muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), emClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters:egamma')), # used only for E/gamma hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters')), - vtxCollection = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), vtxCollectionEmulation = cms.bool(True), nVtx = cms.int32(1), emPtCut = cms.double(0.5), @@ -310,7 +310,7 @@ muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), emClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters:egamma')), # used only for E/gamma hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters')), - vtxCollection = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), vtxCollectionEmulation = cms.bool(True), nVtx = cms.int32(1), emPtCut = cms.double(0.5), @@ -396,7 +396,7 @@ useTrackerMuons = cms.bool(False), emClusters = cms.VInputTag(), hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromCombinedCaloHF:calibrated')), - vtxCollection = cms.InputTag("l1tVertexFinderEmulator","l1verticesEmulation"), + vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), vtxCollectionEmulation = cms.bool(True), nVtx = cms.int32(1), emPtCut = cms.double(0.5), diff --git a/L1Trigger/Phase2L1Taus/plugins/HPSPFTauProducer.cc b/L1Trigger/Phase2L1Taus/plugins/HPSPFTauProducer.cc index aaf0060d73161..331aa1c239230 100644 --- a/L1Trigger/Phase2L1Taus/plugins/HPSPFTauProducer.cc +++ b/L1Trigger/Phase2L1Taus/plugins/HPSPFTauProducer.cc @@ -230,7 +230,7 @@ void HPSPFTauProducer::fillDescriptions(edm::ConfigurationDescriptions& descript desc.add("maxSeedChargedPFCandEta", 2.4); desc.add("applyPreselection", false); desc.add("isolationConeSize", 0.4); - desc.add("srcL1Vertices", edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")); + desc.add("srcL1Vertices", edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation")); desc.add("maxChargedIso", 1000.0); { edm::ParameterSetDescription psd0; diff --git a/L1Trigger/VertexFinder/python/l1tVertexNTupler_cfi.py b/L1Trigger/VertexFinder/python/l1tVertexNTupler_cfi.py index 1710cbed7ec96..c8409705f7fc2 100644 --- a/L1Trigger/VertexFinder/python/l1tVertexNTupler_cfi.py +++ b/L1Trigger/VertexFinder/python/l1tVertexNTupler_cfi.py @@ -8,7 +8,7 @@ l1TracksTPInputTags = cms.InputTag("l1tTPStubValueMapProducer:allMatchedTPs"), l1TracksTPValueMapInputTags = cms.InputTag("l1tTPStubValueMapProducer:TPs"), l1TracksBranchNames = cms.vstring('hybrid'), - l1VertexInputTags = cms.VInputTag( cms.InputTag("l1tVertexProducer", "l1vertices") ), + l1VertexInputTags = cms.VInputTag( cms.InputTag("l1tVertexProducer", "L1Vertices") ), l1VertexTrackInputs = cms.vstring('hybrid'), l1VertexBranchNames = cms.vstring('fastHisto'), emulationVertexInputTags = cms.VInputTag(), diff --git a/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py b/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py index 1cbc9c1057686..682246189ed49 100644 --- a/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py +++ b/L1Trigger/VertexFinder/python/l1tVertexProducer_cfi.py @@ -3,7 +3,7 @@ l1tVertexProducer = cms.EDProducer('VertexProducer', l1TracksInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"), - l1VertexCollectionName = cms.string("l1vertices"), #Emulation postfix is appended when fastHistoEmulation is chosen as the algorithm + l1VertexCollectionName = cms.string("L1Vertices"), #Emulation postfix is appended when fastHistoEmulation is chosen as the algorithm # === Vertex Reconstruction configuration VertexReconstruction = cms.PSet( diff --git a/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py b/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py index 988d2fa86c75a..6f353689979f7 100644 --- a/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py +++ b/L1Trigger/VertexFinder/test/vertexNTupler_cfg.py @@ -107,10 +107,10 @@ producer.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted") producerSum = process.L1GTTInputProducer + producerSum - process.l1tVertexNTupler.emulationVertexInputTags.append( cms.InputTag(producerName, 'l1tVerticesEmulation') ) + process.l1tVertexNTupler.emulationVertexInputTags.append( cms.InputTag(producerName, 'L1VerticesEmulation') ) process.l1tVertexNTupler.emulationVertexBranchNames.append(algo) else: - process.l1tVertexNTupler.l1VertexInputTags.append( cms.InputTag(producerName, 'l1tVertices') ) + process.l1tVertexNTupler.l1VertexInputTags.append( cms.InputTag(producerName, 'L1Vertices') ) process.l1tVertexNTupler.l1VertexBranchNames.append(algo) process.l1tVertexNTupler.l1VertexTrackInputs.append('hybrid') @@ -146,7 +146,7 @@ setattr(process, producerName, producer) producerNames += [producerName] process.l1tVertexNTupler.extraVertexDescriptions += ['DBSCAN(dist={0},minPt={1},minDensity={2},seedTrackPt{3})'.format(dist, minPt, minDensity, seedTrackPt)] - process.l1tVertexNTupler.extraVertexInputTags.append( cms.InputTag(producerName, 'l1tVertices')) + process.l1tVertexNTupler.extraVertexInputTags.append( cms.InputTag(producerName, 'L1Vertices')) producerSum += producer print "Total number of producers =", len(additionalProducerAlgorithms)+1 From ad4c326952967e7d0778b5c33f660b346b1d3551 Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Tue, 11 Jul 2023 06:25:42 +0200 Subject: [PATCH 6/6] Update according to Core SW recs; backport to PR1130 in integration branch. --- .../L1TrackVertexAssociationProducer.cc | 42 ++++++------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc index 7640ce63b1349..134d77570eacc 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc @@ -150,6 +150,7 @@ class L1TrackVertexAssociationProducer : public edm::global::EDProducer<> { }; // ----------member data --------------------------- + const bool processSimulatedTracks_, processEmulatedTracks_; const edm::EDGetTokenT l1VerticesToken_; const edm::EDGetTokenT l1SelectedTracksToken_; const edm::EDGetTokenT l1VerticesEmulationToken_; @@ -158,7 +159,6 @@ class L1TrackVertexAssociationProducer : public edm::global::EDProducer<> { const edm::ParameterSet cutSet_; std::vector deltaZMaxEtaBounds_, deltaZMax_; const double useDisplacedTracksDeltaZOverride_; - bool processSimulatedTracks_, processEmulatedTracks_, doDeltaZCutSim_, doDeltaZCutEmu_; int debug_; }; @@ -166,18 +166,20 @@ class L1TrackVertexAssociationProducer : public edm::global::EDProducer<> { // constructors and destructor // L1TrackVertexAssociationProducer::L1TrackVertexAssociationProducer(const edm::ParameterSet& iConfig) - : l1VerticesToken_(iConfig.getParameter("processSimulatedTracks") + : processSimulatedTracks_(iConfig.getParameter("processSimulatedTracks")), + processEmulatedTracks_(iConfig.getParameter("processEmulatedTracks")), + l1VerticesToken_(processSimulatedTracks_ ? consumes(iConfig.getParameter("l1VerticesInputTag")) : edm::EDGetTokenT()), l1SelectedTracksToken_( - iConfig.getParameter("processSimulatedTracks") + processSimulatedTracks_ ? consumes(iConfig.getParameter("l1SelectedTracksInputTag")) : edm::EDGetTokenT()), l1VerticesEmulationToken_( - iConfig.getParameter("processEmulatedTracks") + processEmulatedTracks_ ? consumes(iConfig.getParameter("l1VerticesEmulationInputTag")) : edm::EDGetTokenT()), - l1SelectedTracksEmulationToken_(iConfig.getParameter("processEmulatedTracks") + l1SelectedTracksEmulationToken_(processEmulatedTracks_ ? consumes(iConfig.getParameter( "l1SelectedTracksEmulationInputTag")) : edm::EDGetTokenT()), @@ -187,8 +189,6 @@ L1TrackVertexAssociationProducer::L1TrackVertexAssociationProducer(const edm::Pa deltaZMaxEtaBounds_(cutSet_.getParameter>("deltaZMaxEtaBounds")), deltaZMax_(cutSet_.getParameter>("deltaZMax")), useDisplacedTracksDeltaZOverride_(iConfig.getParameter("useDisplacedTracksDeltaZOverride")), - processSimulatedTracks_(iConfig.getParameter("processSimulatedTracks")), - processEmulatedTracks_(iConfig.getParameter("processEmulatedTracks")), debug_(iConfig.getParameter("debug")) { // Confirm the the configuration makes sense if (!processSimulatedTracks_ && !processEmulatedTracks_) { @@ -204,26 +204,10 @@ L1TrackVertexAssociationProducer::L1TrackVertexAssociationProducer(const edm::Pa } // Get additional input tags and define the EDM output based on the previous configuration parameters - doDeltaZCutSim_ = false; - doDeltaZCutEmu_ = false; - if (processSimulatedTracks_) { - if (iConfig.exists("l1VerticesInputTag")) { - // l1SelectedTracksToken_ = consumes(iConfig.getParameter("l1SelectedTracksInputTag")); - // l1VerticesToken_ = consumes(iConfig.getParameter("l1VerticesInputTag")); - doDeltaZCutSim_ = true; - produces(outputCollectionName_); - } - } - if (processEmulatedTracks_) { - if (iConfig.exists("l1VerticesEmulationInputTag")) { - // l1SelectedTracksEmulationToken_ = - // consumes(iConfig.getParameter("l1SelectedTracksEmulationInputTag")); - // l1VerticesEmulationToken_ = - // consumes(iConfig.getParameter("l1VerticesEmulationInputTag")); - doDeltaZCutEmu_ = true; - produces(outputCollectionName_ + "Emulation"); - } - } + if (processSimulatedTracks_) + produces(outputCollectionName_); + if (processEmulatedTracks_) + produces(outputCollectionName_ + "Emulation"); } L1TrackVertexAssociationProducer::~L1TrackVertexAssociationProducer() {} @@ -369,7 +353,7 @@ void L1TrackVertexAssociationProducer::produce(edm::StreamID, edm::Event& iEvent TTTrackDeltaZMaxSelector deltaZSel(deltaZMaxEtaBounds_, deltaZMax_); TTTrackWordDeltaZMaxSelector deltaZSelEmu(deltaZMaxEtaBounds_, deltaZMax_); - if (processSimulatedTracks_ && doDeltaZCutSim_) { + if (processSimulatedTracks_) { iEvent.getByToken(l1SelectedTracksToken_, l1SelectedTracksHandle); iEvent.getByToken(l1VerticesToken_, l1VerticesHandle); size_t nOutputApproximate = l1SelectedTracksHandle->size(); @@ -387,7 +371,7 @@ void L1TrackVertexAssociationProducer::produce(edm::StreamID, edm::Event& iEvent } iEvent.put(std::move(vTTTrackAssociatedOutput), outputCollectionName_); } - if (processEmulatedTracks_ && doDeltaZCutEmu_) { + if (processEmulatedTracks_) { iEvent.getByToken(l1SelectedTracksEmulationToken_, l1SelectedTracksEmulationHandle); iEvent.getByToken(l1VerticesEmulationToken_, l1VerticesEmulationHandle); size_t nOutputApproximateEmulation = l1SelectedTracksEmulationHandle->size();