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