Skip to content

Commit

Permalink
Simplify consumes(), esConsumes(), produces() and code checks/format
Browse files Browse the repository at this point in the history
  • Loading branch information
VourMa committed Aug 21, 2024
1 parent 03da845 commit c4d12fc
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
30 changes: 14 additions & 16 deletions RecoTracker/LST/plugins/LSTOutputConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,14 @@ class LSTOutputConverter : public edm::global::EDProducer<> {
};

LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig)
: lstOutputToken_(consumes<LSTOutput>(iConfig.getParameter<edm::InputTag>("lstOutput"))),
lstPhase2OTHitsInputToken_{consumes<LSTPhase2OTHitsInput>(iConfig.getParameter<edm::InputTag>("phase2OTHits"))},
lstPixelSeedToken_{consumes<TrajectorySeedCollection>(iConfig.getParameter<edm::InputTag>("lstPixelSeeds"))},
: lstOutputToken_(consumes(iConfig.getParameter<edm::InputTag>("lstOutput"))),
lstPhase2OTHitsInputToken_{consumes(iConfig.getParameter<edm::InputTag>("phase2OTHits"))},
lstPixelSeedToken_{consumes(iConfig.getParameter<edm::InputTag>("lstPixelSeeds"))},
includeT5s_(iConfig.getParameter<bool>("includeT5s")),
includeNonpLSTSs_(iConfig.getParameter<bool>("includeNonpLSTSs")),
mfToken_(esConsumes()),
propagatorAlongToken_{
esConsumes<Propagator, TrackingComponentsRecord>(iConfig.getParameter<edm::ESInputTag>("propagatorAlong"))},
propagatorOppositeToken_{esConsumes<Propagator, TrackingComponentsRecord>(
iConfig.getParameter<edm::ESInputTag>("propagatorOpposite"))},
propagatorAlongToken_{esConsumes(iConfig.getParameter<edm::ESInputTag>("propagatorAlong"))},
propagatorOppositeToken_{esConsumes(iConfig.getParameter<edm::ESInputTag>("propagatorOpposite"))},
tGeomToken_(esConsumes()),
seedCreator_(SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator",
iConfig.getParameter<edm::ParameterSet>("SeedCreatorPSet"),
Expand All @@ -77,15 +75,15 @@ LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig)
// - The minimal set for TCs is t5TCsLST, pTTCsLST and pLSTCsLST.
// That would complicate the handling of collections though,
// so it is deferred to when we have a clearer picture of what's needed.
trajectorySeedPutToken_(produces<TrajectorySeedCollection>("")),
trajectorySeedpLSPutToken_(produces<TrajectorySeedCollection>("pLSTSsLST")),
trackCandidatePutToken_(produces<TrackCandidateCollection>("")),
trackCandidatepTCPutToken_(produces<TrackCandidateCollection>("pTCsLST")),
trackCandidateT5TCPutToken_(produces<TrackCandidateCollection>("t5TCsLST")),
trackCandidateNopLSTCPutToken_(produces<TrackCandidateCollection>("nopLSTCsLST")),
trackCandidatepTTCPutToken_(produces<TrackCandidateCollection>("pTTCsLST")),
trackCandidatepLSTCPutToken_(produces<TrackCandidateCollection>("pLSTCsLST")),
seedStopInfoPutToken_(produces<std::vector<SeedStopInfo>>()) {}
trajectorySeedPutToken_(produces("")),
trajectorySeedpLSPutToken_(produces("pLSTSsLST")),
trackCandidatePutToken_(produces("")),
trackCandidatepTCPutToken_(produces("pTCsLST")),
trackCandidateT5TCPutToken_(produces("t5TCsLST")),
trackCandidateNopLSTCPutToken_(produces("nopLSTCsLST")),
trackCandidatepTTCPutToken_(produces("pTTCsLST")),
trackCandidatepLSTCPutToken_(produces("pLSTCsLST")),
seedStopInfoPutToken_(produces()) {}

void LSTOutputConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
Expand Down
5 changes: 2 additions & 3 deletions RecoTracker/LST/plugins/LSTPhase2OTHitsInputProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ class LSTPhase2OTHitsInputProducer : public edm::global::EDProducer<> {
};

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

void LSTPhase2OTHitsInputProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
Expand Down
6 changes: 3 additions & 3 deletions RecoTracker/LST/plugins/LSTPixelSeedInputProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class LSTPixelSeedInputProducer : public edm::global::EDProducer<> {

LSTPixelSeedInputProducer::LSTPixelSeedInputProducer(edm::ParameterSet const& iConfig)
: mfToken_(esConsumes()),
beamSpotToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
lstPixelSeedInputPutToken_(produces<LSTPixelSeedInput>()),
lstPixelSeedsPutToken_(produces<TrajectorySeedCollection>()) {
beamSpotToken_(consumes(iConfig.getParameter<edm::InputTag>("beamSpot"))),
lstPixelSeedInputPutToken_(produces()),
lstPixelSeedsPutToken_(produces()) {
seedTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag>>("seedTracks"),
[&](const edm::InputTag& tag) { return consumes<edm::View<reco::Track>>(tag); });
}
Expand Down
5 changes: 2 additions & 3 deletions RecoTracker/LST/plugins/alpaka/LSTProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
class LSTProducer : public stream::SynchronizingEDProducer<> {
public:
LSTProducer(edm::ParameterSet const& config)
: lstPixelSeedInputToken_{consumes<LSTPixelSeedInput>(config.getParameter<edm::InputTag>("pixelSeedInput"))},
lstPhase2OTHitsInputToken_{
consumes<LSTPhase2OTHitsInput>(config.getParameter<edm::InputTag>("phase2OTHitsInput"))},
: lstPixelSeedInputToken_{consumes(config.getParameter<edm::InputTag>("pixelSeedInput"))},
lstPhase2OTHitsInputToken_{consumes(config.getParameter<edm::InputTag>("phase2OTHitsInput"))},
lstESToken_{esConsumes()},
verbose_(config.getParameter<bool>("verbose")),
nopLSDupClean_(config.getParameter<bool>("nopLSDupClean")),
Expand Down
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ namespace lst {

inline EndcapGeometryDev const* data() const { return &data_; }

private:
EndcapGeometryDev data_;
private:
EndcapGeometryDev data_;
};

} // namespace lst
Expand Down
18 changes: 11 additions & 7 deletions RecoTracker/LSTCore/src/alpaka/Event.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,12 @@ void Event::createPixelTriplets() {

// TODO: check if a map/reduction to just eligible pLSs would speed up the kernel
// the current selection still leaves a significant fraction of unmatchable pLSs
for (unsigned int i = 0; i < nInnerSegments; i++) { // loop over # pLS
int pixelType = pixelTypes[i]; // Get pixel type for this pLS
int superbin = superbins[i]; // Get superbin for this pixel
if ((superbin < 0) or (superbin >= (int)size_superbins) or ((pixelType != ::lst::kPixelType::highPt) and (pixelType != ::lst::kPixelType::lowPtPosCurv) and (pixelType != ::lst::kPixelType::lowPtNegCurv))) {
for (unsigned int i = 0; i < nInnerSegments; i++) { // loop over # pLS
int pixelType = pixelTypes[i]; // Get pixel type for this pLS
int superbin = superbins[i]; // Get superbin for this pixel
if ((superbin < 0) or (superbin >= (int)size_superbins) or
((pixelType != ::lst::kPixelType::highPt) and (pixelType != ::lst::kPixelType::lowPtPosCurv) and
(pixelType != ::lst::kPixelType::lowPtNegCurv))) {
connectedPixelSize_host[i] = 0;
connectedPixelIndex_host[i] = 0;
continue;
Expand Down Expand Up @@ -931,9 +933,11 @@ void Event::createPixelQuintuplets() {

// Loop over # pLS
for (unsigned int i = 0; i < nInnerSegments; i++) {
int pixelType = pixelTypes[i]; // Get pixel type for this pLS
int superbin = superbins[i]; // Get superbin for this pixel
if ((superbin < 0) or (superbin >= (int)size_superbins) or ((pixelType != ::lst::kPixelType::highPt) and (pixelType != ::lst::kPixelType::lowPtPosCurv) and (pixelType != ::lst::kPixelType::lowPtNegCurv))) {
int pixelType = pixelTypes[i]; // Get pixel type for this pLS
int superbin = superbins[i]; // Get superbin for this pixel
if ((superbin < 0) or (superbin >= (int)size_superbins) or
((pixelType != ::lst::kPixelType::highPt) and (pixelType != ::lst::kPixelType::lowPtPosCurv) and
(pixelType != ::lst::kPixelType::lowPtNegCurv))) {
connectedPixelIndex_host[i] = 0;
connectedPixelSize_host[i] = 0;
continue;
Expand Down

0 comments on commit c4d12fc

Please sign in to comment.