Skip to content

Commit

Permalink
Resolving PR comments LST folder
Browse files Browse the repository at this point in the history
  • Loading branch information
VourMa committed Jun 10, 2024
1 parent 314e95d commit 85682e8
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
20 changes: 10 additions & 10 deletions RecoTracker/LST/interface/LSTOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
class LSTOutput {
public:
LSTOutput() = default;
LSTOutput(std::vector<std::vector<unsigned int>> hitIdx,
std::vector<unsigned int> len,
std::vector<int> seedIdx,
std::vector<short> 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<std::vector<unsigned int>> hitIdx,
std::vector<unsigned int> len,
std::vector<int> seedIdx,
std::vector<short> trackCandidateType) {
hitIdx_ = hitIdx;
len_ = len;
seedIdx_ = seedIdx;
trackCandidateType_ = trackCandidateType;
}

std::vector<std::vector<unsigned int>> const& hitIdx() const { return hitIdx_; }
std::vector<unsigned int> const& len() const { return len_; }
std::vector<int> const& seedIdx() const { return seedIdx_; }
Expand Down
24 changes: 12 additions & 12 deletions RecoTracker/LST/interface/LSTPhase2OTHitsInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
class LSTPhase2OTHitsInput {
public:
LSTPhase2OTHitsInput() = default;
~LSTPhase2OTHitsInput() = default;

void setLSTPhase2OTHitsTraits(std::vector<unsigned int> detId,
std::vector<float> x,
std::vector<float> y,
std::vector<float> z,
std::vector<TrackingRecHit const*> hits) {
detId_ = detId;
x_ = x;
y_ = y;
z_ = z;
hits_ = hits;
LSTPhase2OTHitsInput(std::vector<unsigned int> detId,
std::vector<float> x,
std::vector<float> y,
std::vector<float> z,
std::vector<TrackingRecHit const*> 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<unsigned int> const& detId() const { return detId_; }
std::vector<float> const& x() const { return x_; }
std::vector<float> const& y() const { return y_; }
Expand Down
64 changes: 32 additions & 32 deletions RecoTracker/LST/interface/LSTPixelSeedInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@
class LSTPixelSeedInput {
public:
LSTPixelSeedInput() = default;
~LSTPixelSeedInput() = default;

void setLSTPixelSeedTraits(std::vector<float> px,
std::vector<float> py,
std::vector<float> pz,
std::vector<float> dxy,
std::vector<float> dz,
std::vector<float> ptErr,
std::vector<float> etaErr,
std::vector<float> stateTrajGlbX,
std::vector<float> stateTrajGlbY,
std::vector<float> stateTrajGlbZ,
std::vector<float> stateTrajGlbPx,
std::vector<float> stateTrajGlbPy,
std::vector<float> stateTrajGlbPz,
std::vector<int> q,
std::vector<std::vector<int>> 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<float> px,
std::vector<float> py,
std::vector<float> pz,
std::vector<float> dxy,
std::vector<float> dz,
std::vector<float> ptErr,
std::vector<float> etaErr,
std::vector<float> stateTrajGlbX,
std::vector<float> stateTrajGlbY,
std::vector<float> stateTrajGlbZ,
std::vector<float> stateTrajGlbPx,
std::vector<float> stateTrajGlbPy,
std::vector<float> stateTrajGlbPz,
std::vector<int> q,
std::vector<std::vector<int>> 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<float> const& px() const { return px_; }
std::vector<float> const& py() const { return py_; }
std::vector<float> const& pz() const { return pz_; }
Expand Down
18 changes: 8 additions & 10 deletions RecoTracker/LST/plugins/LSTOutputConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class LSTOutputConverter : public edm::global::EDProducer<> {
const bool includeT5s_;
const bool includeNonpLSTSs_;
const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> mfToken_;
edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorAlongToken_;
edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorOppositeToken_;
const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorAlongToken_;
const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorOppositeToken_;
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tGeomToken_;
std::unique_ptr<SeedCreator> seedCreator_;
const edm::EDPutTokenT<TrajectorySeedCollection> trajectorySeedPutToken_;
Expand All @@ -57,11 +57,9 @@ class LSTOutputConverter : public edm::global::EDProducer<> {
};

LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig)
: lstOutputToken_(consumes<LSTOutput>(iConfig.getUntrackedParameter<edm::InputTag>("lstOutput"))),
lstPhase2OTHitsInputToken_{
consumes<LSTPhase2OTHitsInput>(iConfig.getUntrackedParameter<edm::InputTag>("phase2OTHits"))},
lstPixelSeedToken_{
consumes<TrajectorySeedCollection>(iConfig.getUntrackedParameter<edm::InputTag>("lstPixelSeeds"))},
: lstOutputToken_(consumes<LSTOutput>(iConfig.getParameter<edm::InputTag>("lstOutput"))),
lstPhase2OTHitsInputToken_{consumes<LSTPhase2OTHitsInput>(iConfig.getParameter<edm::InputTag>("phase2OTHits"))},
lstPixelSeedToken_{consumes<TrajectorySeedCollection>(iConfig.getParameter<edm::InputTag>("lstPixelSeeds"))},
includeT5s_(iConfig.getParameter<bool>("includeT5s")),
includeNonpLSTSs_(iConfig.getParameter<bool>("includeNonpLSTSs")),
mfToken_(esConsumes()),
Expand Down Expand Up @@ -92,9 +90,9 @@ LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig)
void LSTOutputConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;

desc.addUntracked<edm::InputTag>("lstOutput", edm::InputTag("lstProducer"));
desc.addUntracked<edm::InputTag>("phase2OTHits", edm::InputTag("lstPhase2OTHitsInputProducer"));
desc.addUntracked<edm::InputTag>("lstPixelSeeds", edm::InputTag("lstPixelSeedInputProducer"));
desc.add<edm::InputTag>("lstOutput", edm::InputTag("lstProducer"));
desc.add<edm::InputTag>("phase2OTHits", edm::InputTag("lstPhase2OTHitsInputProducer"));
desc.add<edm::InputTag>("lstPixelSeeds", edm::InputTag("lstPixelSeedInputProducer"));
desc.add<bool>("includeT5s", true);
desc.add<bool>("includeNonpLSTSs", false);
desc.add("propagatorAlong", edm::ESInputTag{"", "PropagatorWithMaterial"});
Expand Down
10 changes: 4 additions & 6 deletions RecoTracker/LST/plugins/LSTPhase2OTHitsInputProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class LSTPhase2OTHitsInputProducer : public edm::global::EDProducer<> {
};

LSTPhase2OTHitsInputProducer::LSTPhase2OTHitsInputProducer(edm::ParameterSet const& iConfig)
: phase2OTRecHitToken_(consumes<Phase2TrackerRecHit1DCollectionNew>(
iConfig.getUntrackedParameter<edm::InputTag>("phase2OTRecHits"))),
: phase2OTRecHitToken_(
consumes<Phase2TrackerRecHit1DCollectionNew>(iConfig.getParameter<edm::InputTag>("phase2OTRecHits"))),
lstPhase2OTHitsInputPutToken_(produces<LSTPhase2OTHitsInput>()) {}

void LSTPhase2OTHitsInputProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;

desc.addUntracked<edm::InputTag>("phase2OTRecHits", edm::InputTag("siPhase2RecHits"));
desc.add<edm::InputTag>("phase2OTRecHits", edm::InputTag("siPhase2RecHits"));

descriptions.addWithDefaultLabel(desc);
}
Expand All @@ -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<unsigned int> ph2_detId;
std::vector<float> ph2_x;
std::vector<float> ph2_y;
Expand All @@ -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));
}

Expand Down
44 changes: 21 additions & 23 deletions RecoTracker/LST/plugins/LSTPixelSeedInputProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,21 @@ class LSTPixelSeedInputProducer : public edm::global::EDProducer<> {

LSTPixelSeedInputProducer::LSTPixelSeedInputProducer(edm::ParameterSet const& iConfig)
: mfToken_(esConsumes()),
beamSpotToken_(consumes<reco::BeamSpot>(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot"))),
beamSpotToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
lstPixelSeedInputPutToken_(produces<LSTPixelSeedInput>()),
lstPixelSeedsPutToken_(produces<TrajectorySeedCollection>()) {
seedTokens_ = edm::vector_transform(iConfig.getUntrackedParameter<std::vector<edm::InputTag>>("seedTracks"),
seedTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag>>("seedTracks"),
[&](const edm::InputTag& tag) { return consumes<edm::View<reco::Track>>(tag); });
}

void LSTPixelSeedInputProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;

desc.addUntracked<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));

desc.addUntracked<std::vector<edm::InputTag>>(
"seedTracks",
std::vector<edm::InputTag>{edm::InputTag("lstInitialStepSeedTracks"),
edm::InputTag("lstHighPtTripletStepSeedTracks")});
desc.add<std::vector<edm::InputTag>>("seedTracks",
std::vector<edm::InputTag>{edm::InputTag("lstInitialStepSeedTracks"),
edm::InputTag("lstHighPtTripletStepSeedTracks")});

descriptions.addWithDefaultLabel(desc);
}
Expand All @@ -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<float> see_px;
std::vector<float> see_py;
std::vector<float> see_pz;
Expand Down Expand Up @@ -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));
}
Expand Down
4 changes: 1 addition & 3 deletions RecoTracker/LST/plugins/alpaka/LSTProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
7 changes: 1 addition & 6 deletions RecoTracker/LST/python/lstProducer_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
File renamed without changes.
2 changes: 1 addition & 1 deletion RecoTracker/LST/python/lst_cff.py
Original file line number Diff line number Diff line change
@@ -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 *

0 comments on commit 85682e8

Please sign in to comment.