From 85682e83cb3b0ae36f7199d98da705419c7be18f Mon Sep 17 00:00:00 2001 From: Manos Vourliotis Date: Mon, 10 Jun 2024 09:08:42 -0700 Subject: [PATCH] Resolving PR comments LST folder --- .../python/HighPtTripletStep_cff.py | 2 +- RecoTracker/LST/interface/LSTOutput.h | 20 +++--- .../LST/interface/LSTPhase2OTHitsInput.h | 24 +++---- RecoTracker/LST/interface/LSTPixelSeedInput.h | 64 +++++++++---------- RecoTracker/LST/plugins/LSTOutputConverter.cc | 18 +++--- .../plugins/LSTPhase2OTHitsInputProducer.cc | 10 ++- .../LST/plugins/LSTPixelSeedInputProducer.cc | 44 ++++++------- RecoTracker/LST/plugins/alpaka/LSTProducer.cc | 4 +- RecoTracker/LST/python/lstProducer_cff.py | 7 +- ...SeedTracks_cfi.py => lstSeedTracks_cff.py} | 0 RecoTracker/LST/python/lst_cff.py | 2 +- 11 files changed, 91 insertions(+), 104 deletions(-) rename RecoTracker/LST/python/{lstSeedTracks_cfi.py => lstSeedTracks_cff.py} (100%) diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index 3c6127d5794b2..fc98c2a6d8664 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -425,7 +425,7 @@ _HighPtTripletStepTask_LST = HighPtTripletStepTask.copy() from RecoLocalTracker.Phase2TrackerRecHits.Phase2TrackerRecHits_cfi import siPhase2RecHits -from RecoTracker.LST.lstSeedTracks_cfi import lstInitialStepSeedTracks,lstHighPtTripletStepSeedTracks +from RecoTracker.LST.lstSeedTracks_cff import lstInitialStepSeedTracks,lstHighPtTripletStepSeedTracks from RecoTracker.LST.lstPixelSeedInputProducer_cfi import lstPixelSeedInputProducer from RecoTracker.LST.lstPhase2OTHitsInputProducer_cfi import lstPhase2OTHitsInputProducer from RecoTracker.LST.lstProducer_cff import * diff --git a/RecoTracker/LST/interface/LSTOutput.h b/RecoTracker/LST/interface/LSTOutput.h index e1c3b5544e825..765be209201d9 100644 --- a/RecoTracker/LST/interface/LSTOutput.h +++ b/RecoTracker/LST/interface/LSTOutput.h @@ -7,20 +7,20 @@ class LSTOutput { public: LSTOutput() = default; + LSTOutput(std::vector> hitIdx, + std::vector len, + std::vector seedIdx, + std::vector trackCandidateType) { + hitIdx_ = std::move(hitIdx); + len_ = std::move(len); + seedIdx_ = std::move(seedIdx); + trackCandidateType_ = std::move(trackCandidateType); + } + ~LSTOutput() = default; enum LSTTCType { T5 = 4, pT3 = 5, pT5 = 7, pLS = 8 }; - void setLSTOutputTraits(std::vector> hitIdx, - std::vector len, - std::vector seedIdx, - std::vector trackCandidateType) { - hitIdx_ = hitIdx; - len_ = len; - seedIdx_ = seedIdx; - trackCandidateType_ = trackCandidateType; - } - std::vector> const& hitIdx() const { return hitIdx_; } std::vector const& len() const { return len_; } std::vector const& seedIdx() const { return seedIdx_; } diff --git a/RecoTracker/LST/interface/LSTPhase2OTHitsInput.h b/RecoTracker/LST/interface/LSTPhase2OTHitsInput.h index 2d55b467b1d1b..524a06be1250a 100644 --- a/RecoTracker/LST/interface/LSTPhase2OTHitsInput.h +++ b/RecoTracker/LST/interface/LSTPhase2OTHitsInput.h @@ -9,20 +9,20 @@ class LSTPhase2OTHitsInput { public: LSTPhase2OTHitsInput() = default; - ~LSTPhase2OTHitsInput() = default; - - void setLSTPhase2OTHitsTraits(std::vector detId, - std::vector x, - std::vector y, - std::vector z, - std::vector hits) { - detId_ = detId; - x_ = x; - y_ = y; - z_ = z; - hits_ = hits; + LSTPhase2OTHitsInput(std::vector detId, + std::vector x, + std::vector y, + std::vector z, + std::vector hits) { + detId_ = std::move(detId); + x_ = std::move(x); + y_ = std::move(y); + z_ = std::move(z); + hits_ = std::move(hits); } + ~LSTPhase2OTHitsInput() = default; + std::vector const& detId() const { return detId_; } std::vector const& x() const { return x_; } std::vector const& y() const { return y_; } diff --git a/RecoTracker/LST/interface/LSTPixelSeedInput.h b/RecoTracker/LST/interface/LSTPixelSeedInput.h index e7ef033360671..14681f266de2f 100644 --- a/RecoTracker/LST/interface/LSTPixelSeedInput.h +++ b/RecoTracker/LST/interface/LSTPixelSeedInput.h @@ -7,40 +7,40 @@ class LSTPixelSeedInput { public: LSTPixelSeedInput() = default; - ~LSTPixelSeedInput() = default; - - void setLSTPixelSeedTraits(std::vector px, - std::vector py, - std::vector pz, - std::vector dxy, - std::vector dz, - std::vector ptErr, - std::vector etaErr, - std::vector stateTrajGlbX, - std::vector stateTrajGlbY, - std::vector stateTrajGlbZ, - std::vector stateTrajGlbPx, - std::vector stateTrajGlbPy, - std::vector stateTrajGlbPz, - std::vector q, - std::vector> hitIdx) { - px_ = px; - py_ = py; - pz_ = pz; - dxy_ = dxy; - dz_ = dz; - ptErr_ = ptErr; - etaErr_ = etaErr; - stateTrajGlbX_ = stateTrajGlbX; - stateTrajGlbY_ = stateTrajGlbY; - stateTrajGlbZ_ = stateTrajGlbZ; - stateTrajGlbPx_ = stateTrajGlbPx; - stateTrajGlbPy_ = stateTrajGlbPy; - stateTrajGlbPz_ = stateTrajGlbPz; - q_ = q; - hitIdx_ = hitIdx; + LSTPixelSeedInput(std::vector px, + std::vector py, + std::vector pz, + std::vector dxy, + std::vector dz, + std::vector ptErr, + std::vector etaErr, + std::vector stateTrajGlbX, + std::vector stateTrajGlbY, + std::vector stateTrajGlbZ, + std::vector stateTrajGlbPx, + std::vector stateTrajGlbPy, + std::vector stateTrajGlbPz, + std::vector q, + std::vector> hitIdx) { + px_ = std::move(px); + py_ = std::move(py); + pz_ = std::move(pz); + dxy_ = std::move(dxy); + dz_ = std::move(dz); + ptErr_ = std::move(ptErr); + etaErr_ = std::move(etaErr); + stateTrajGlbX_ = std::move(stateTrajGlbX); + stateTrajGlbY_ = std::move(stateTrajGlbY); + stateTrajGlbZ_ = std::move(stateTrajGlbZ); + stateTrajGlbPx_ = std::move(stateTrajGlbPx); + stateTrajGlbPy_ = std::move(stateTrajGlbPy); + stateTrajGlbPz_ = std::move(stateTrajGlbPz); + q_ = std::move(q); + hitIdx_ = std::move(hitIdx); } + ~LSTPixelSeedInput() = default; + std::vector const& px() const { return px_; } std::vector const& py() const { return py_; } std::vector const& pz() const { return pz_; } diff --git a/RecoTracker/LST/plugins/LSTOutputConverter.cc b/RecoTracker/LST/plugins/LSTOutputConverter.cc index c0611bfd6991a..de528395d7c46 100644 --- a/RecoTracker/LST/plugins/LSTOutputConverter.cc +++ b/RecoTracker/LST/plugins/LSTOutputConverter.cc @@ -41,8 +41,8 @@ class LSTOutputConverter : public edm::global::EDProducer<> { const bool includeT5s_; const bool includeNonpLSTSs_; const edm::ESGetToken mfToken_; - edm::ESGetToken propagatorAlongToken_; - edm::ESGetToken propagatorOppositeToken_; + const edm::ESGetToken propagatorAlongToken_; + const edm::ESGetToken propagatorOppositeToken_; const edm::ESGetToken tGeomToken_; std::unique_ptr seedCreator_; const edm::EDPutTokenT trajectorySeedPutToken_; @@ -57,11 +57,9 @@ class LSTOutputConverter : public edm::global::EDProducer<> { }; LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig) - : lstOutputToken_(consumes(iConfig.getUntrackedParameter("lstOutput"))), - lstPhase2OTHitsInputToken_{ - consumes(iConfig.getUntrackedParameter("phase2OTHits"))}, - lstPixelSeedToken_{ - consumes(iConfig.getUntrackedParameter("lstPixelSeeds"))}, + : lstOutputToken_(consumes(iConfig.getParameter("lstOutput"))), + lstPhase2OTHitsInputToken_{consumes(iConfig.getParameter("phase2OTHits"))}, + lstPixelSeedToken_{consumes(iConfig.getParameter("lstPixelSeeds"))}, includeT5s_(iConfig.getParameter("includeT5s")), includeNonpLSTSs_(iConfig.getParameter("includeNonpLSTSs")), mfToken_(esConsumes()), @@ -92,9 +90,9 @@ LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig) void LSTOutputConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.addUntracked("lstOutput", edm::InputTag("lstProducer")); - desc.addUntracked("phase2OTHits", edm::InputTag("lstPhase2OTHitsInputProducer")); - desc.addUntracked("lstPixelSeeds", edm::InputTag("lstPixelSeedInputProducer")); + desc.add("lstOutput", edm::InputTag("lstProducer")); + desc.add("phase2OTHits", edm::InputTag("lstPhase2OTHitsInputProducer")); + desc.add("lstPixelSeeds", edm::InputTag("lstPixelSeedInputProducer")); desc.add("includeT5s", true); desc.add("includeNonpLSTSs", false); desc.add("propagatorAlong", edm::ESInputTag{"", "PropagatorWithMaterial"}); diff --git a/RecoTracker/LST/plugins/LSTPhase2OTHitsInputProducer.cc b/RecoTracker/LST/plugins/LSTPhase2OTHitsInputProducer.cc index dbf2654381e28..4b0d797db0d4f 100644 --- a/RecoTracker/LST/plugins/LSTPhase2OTHitsInputProducer.cc +++ b/RecoTracker/LST/plugins/LSTPhase2OTHitsInputProducer.cc @@ -21,14 +21,14 @@ class LSTPhase2OTHitsInputProducer : public edm::global::EDProducer<> { }; LSTPhase2OTHitsInputProducer::LSTPhase2OTHitsInputProducer(edm::ParameterSet const& iConfig) - : phase2OTRecHitToken_(consumes( - iConfig.getUntrackedParameter("phase2OTRecHits"))), + : phase2OTRecHitToken_( + consumes(iConfig.getParameter("phase2OTRecHits"))), lstPhase2OTHitsInputPutToken_(produces()) {} void LSTPhase2OTHitsInputProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.addUntracked("phase2OTRecHits", edm::InputTag("siPhase2RecHits")); + desc.add("phase2OTRecHits", edm::InputTag("siPhase2RecHits")); descriptions.addWithDefaultLabel(desc); } @@ -38,8 +38,6 @@ void LSTPhase2OTHitsInputProducer::produce(edm::StreamID iID, edm::Event& iEvent auto const& phase2OTHits = iEvent.get(phase2OTRecHitToken_); // Vector definitions - LSTPhase2OTHitsInput phase2OTHitsInput; - std::vector ph2_detId; std::vector ph2_x; std::vector ph2_y; @@ -57,7 +55,7 @@ void LSTPhase2OTHitsInputProducer::produce(edm::StreamID iID, edm::Event& iEvent } } - phase2OTHitsInput.setLSTPhase2OTHitsTraits(ph2_detId, ph2_x, ph2_y, ph2_z, ph2_hits); + LSTPhase2OTHitsInput phase2OTHitsInput(ph2_detId, ph2_x, ph2_y, ph2_z, ph2_hits); iEvent.emplace(lstPhase2OTHitsInputPutToken_, std::move(phase2OTHitsInput)); } diff --git a/RecoTracker/LST/plugins/LSTPixelSeedInputProducer.cc b/RecoTracker/LST/plugins/LSTPixelSeedInputProducer.cc index 6cd86b2d6ac6c..b4f42476b1ce9 100644 --- a/RecoTracker/LST/plugins/LSTPixelSeedInputProducer.cc +++ b/RecoTracker/LST/plugins/LSTPixelSeedInputProducer.cc @@ -39,22 +39,21 @@ class LSTPixelSeedInputProducer : public edm::global::EDProducer<> { LSTPixelSeedInputProducer::LSTPixelSeedInputProducer(edm::ParameterSet const& iConfig) : mfToken_(esConsumes()), - beamSpotToken_(consumes(iConfig.getUntrackedParameter("beamSpot"))), + beamSpotToken_(consumes(iConfig.getParameter("beamSpot"))), lstPixelSeedInputPutToken_(produces()), lstPixelSeedsPutToken_(produces()) { - seedTokens_ = edm::vector_transform(iConfig.getUntrackedParameter>("seedTracks"), + seedTokens_ = edm::vector_transform(iConfig.getParameter>("seedTracks"), [&](const edm::InputTag& tag) { return consumes>(tag); }); } void LSTPixelSeedInputProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.addUntracked("beamSpot", edm::InputTag("offlineBeamSpot")); + desc.add("beamSpot", edm::InputTag("offlineBeamSpot")); - desc.addUntracked>( - "seedTracks", - std::vector{edm::InputTag("lstInitialStepSeedTracks"), - edm::InputTag("lstHighPtTripletStepSeedTracks")}); + desc.add>("seedTracks", + std::vector{edm::InputTag("lstInitialStepSeedTracks"), + edm::InputTag("lstHighPtTripletStepSeedTracks")}); descriptions.addWithDefaultLabel(desc); } @@ -65,7 +64,6 @@ void LSTPixelSeedInputProducer::produce(edm::StreamID iID, edm::Event& iEvent, c auto const& bs = iEvent.get(beamSpotToken_); // Vector definitions - LSTPixelSeedInput pixelSeedInput; std::vector see_px; std::vector see_py; std::vector see_pz; @@ -151,21 +149,21 @@ void LSTPixelSeedInputProducer::produce(edm::StreamID iID, edm::Event& iEvent, c } } - pixelSeedInput.setLSTPixelSeedTraits(see_px, - see_py, - see_pz, - see_dxy, - see_dz, - see_ptErr, - see_etaErr, - see_stateTrajGlbX, - see_stateTrajGlbY, - see_stateTrajGlbZ, - see_stateTrajGlbPx, - see_stateTrajGlbPy, - see_stateTrajGlbPz, - see_q, - see_hitIdx); + LSTPixelSeedInput pixelSeedInput(see_px, + see_py, + see_pz, + see_dxy, + see_dz, + see_ptErr, + see_etaErr, + see_stateTrajGlbX, + see_stateTrajGlbY, + see_stateTrajGlbZ, + see_stateTrajGlbPx, + see_stateTrajGlbPy, + see_stateTrajGlbPz, + see_q, + see_hitIdx); iEvent.emplace(lstPixelSeedInputPutToken_, std::move(pixelSeedInput)); iEvent.emplace(lstPixelSeedsPutToken_, std::move(see_seeds)); } diff --git a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc index 4aca0528539ef..0875eebe9f620 100644 --- a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc +++ b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc @@ -66,9 +66,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { void produce(device::Event& event, device::EventSetup const&) override { // Output - LSTOutput lstOutput; - lstOutput.setLSTOutputTraits(lst_.hits(), lst_.len(), lst_.seedIdx(), lst_.trackCandidateType()); - + LSTOutput lstOutput(lst_.hits(), lst_.len(), lst_.seedIdx(), lst_.trackCandidateType()); event.emplace(lstOutputToken_, std::move(lstOutput)); } diff --git a/RecoTracker/LST/python/lstProducer_cff.py b/RecoTracker/LST/python/lstProducer_cff.py index c60357fcbbe1c..fc910d1272bad 100644 --- a/RecoTracker/LST/python/lstProducer_cff.py +++ b/RecoTracker/LST/python/lstProducer_cff.py @@ -2,11 +2,6 @@ from RecoTracker.LST.lstProducer_cfi import lstProducer -from Configuration.ProcessModifiers.gpu_cff import gpu -(~gpu).toModify(lstProducer.alpaka, backend = 'serial_sync') - -from RecoTracker.LST.lstModulesDevESProducer_cfi import lstModulesDevESProducer -(~gpu).toModify(lstModulesDevESProducer.alpaka, backend = 'serial_sync') - # not scheduled task to get the framework to hide the producer +from RecoTracker.LST.lstModulesDevESProducer_cfi import lstModulesDevESProducer dummyLSTModulesDevESProducerTask = cms.Task(lstModulesDevESProducer) diff --git a/RecoTracker/LST/python/lstSeedTracks_cfi.py b/RecoTracker/LST/python/lstSeedTracks_cff.py similarity index 100% rename from RecoTracker/LST/python/lstSeedTracks_cfi.py rename to RecoTracker/LST/python/lstSeedTracks_cff.py diff --git a/RecoTracker/LST/python/lst_cff.py b/RecoTracker/LST/python/lst_cff.py index 03bea461c443c..af3a80ae77e18 100644 --- a/RecoTracker/LST/python/lst_cff.py +++ b/RecoTracker/LST/python/lst_cff.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from RecoTracker.LST.lstSeedTracks_cfi import * +from RecoTracker.LST.lstSeedTracks_cff import * from RecoTracker.LST.lstPixelSeedInputProducer_cfi import * from RecoTracker.LST.lstPhase2OTHitsInputProducer_cfi import * from RecoTracker.LST.lstOutputConverter_cfi import *