Skip to content

Commit

Permalink
Merge pull request #88 from SegmentLinking/CMSSW_14_1_0_pre3_LST_X_LS…
Browse files Browse the repository at this point in the history
…TCore_realfiles_batch6

Batch 6 for updates to LST integration in cms-sw
  • Loading branch information
slava77 authored Sep 13, 2024
2 parents ff27cf3 + 46f7f22 commit 2bc333b
Show file tree
Hide file tree
Showing 33 changed files with 1,515 additions and 1,840 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
12 changes: 6 additions & 6 deletions RecoTracker/LST/plugins/alpaka/LSTModulesDevESProducer.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// LST includes
#include "RecoTracker/LSTCore/interface/Module.h"
#include "RecoTracker/LSTCore/interface/alpaka/LST.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "HeterogeneousCore/AlpakaCore/interface/alpaka/ESProducer.h"
Expand All @@ -7,10 +11,6 @@

#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"

// LST includes
#include "RecoTracker/LSTCore/interface/Module.h"
#include "RecoTracker/LSTCore/interface/alpaka/LST.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE {

class LSTModulesDevESProducer : public ESProducer {
Expand All @@ -22,8 +22,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
descriptions.addWithDefaultLabel(desc);
}

std::unique_ptr<::lst::LSTESData<DevHost>> produce(TrackerRecoGeometryRecord const& iRecord) {
return ::lst::loadAndFillESHost();
std::unique_ptr<lst::LSTESData<DevHost>> produce(TrackerRecoGeometryRecord const& iRecord) {
return lst::loadAndFillESHost();
}
};

Expand Down
11 changes: 5 additions & 6 deletions RecoTracker/LST/plugins/alpaka/LSTProducer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <alpaka/alpaka.hpp>

#include "RecoTracker/LSTCore/interface/alpaka/LST.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -19,16 +21,13 @@

#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"

#include "RecoTracker/LSTCore/interface/alpaka/LST.h"

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 Expand Up @@ -87,7 +86,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
private:
edm::EDGetTokenT<LSTPixelSeedInput> lstPixelSeedInputToken_;
edm::EDGetTokenT<LSTPhase2OTHitsInput> lstPhase2OTHitsInputToken_;
device::ESGetToken<::lst::LSTESData<Device>, TrackerRecoGeometryRecord> lstESToken_;
device::ESGetToken<lst::LSTESData<Device>, TrackerRecoGeometryRecord> lstESToken_;
const bool verbose_, nopLSDupClean_, tcpLSTriplets_;
edm::EDPutTokenT<LSTOutput> lstOutputToken_;

Expand Down
5 changes: 4 additions & 1 deletion RecoTracker/LSTCore/interface/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ namespace lst {
alpaka_common::Vec1D(static_cast<alpaka_common::Idx>(nElements)));
}

// Named constants for pixelTypes
enum PixelType : int8_t { kInvalid = -1, kHighPt = 0, kLowPtPosCurv = 1, kLowPtNegCurv = 2 };

// If a compile time flag does not define PT_CUT, default to 0.8 (GeV)
#ifndef PT_CUT
constexpr float PT_CUT = 0.8f;
Expand All @@ -52,7 +55,7 @@ namespace lst {

constexpr unsigned int size_superbins = 45000;

//defining the constant host device variables right up here
// Defining the constant host device variables right up here
// Currently pixel tracks treated as LSs with 2 double layers (IT layers 1+2 and 3+4) and 4 hits. To be potentially handled better in the future.
struct Params_pLS {
static constexpr int kLayers = 2, kHits = 4;
Expand Down
4 changes: 0 additions & 4 deletions RecoTracker/LSTCore/interface/EndcapGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
#define RecoTracker_LSTCore_interface_EndcapGeometry_h

#include <map>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <stdexcept>

namespace lst {
class EndcapGeometry {
Expand Down
4 changes: 3 additions & 1 deletion RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace lst {
struct EndcapGeometryBuffer {
Buf<TDev, unsigned int> geoMapDetId_buf;
Buf<TDev, float> geoMapPhi_buf;
EndcapGeometryDev data_;

EndcapGeometryBuffer(TDev const& dev, unsigned int nEndCapMap)
: geoMapDetId_buf(allocBufWrapper<unsigned int>(dev, nEndCapMap)),
Expand All @@ -49,6 +48,9 @@ namespace lst {
}

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

private:
EndcapGeometryDev data_;
};

} // namespace lst
Expand Down
8 changes: 3 additions & 5 deletions RecoTracker/LSTCore/interface/ModuleConnectionMap.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_ModuleConnectionMap_h
#define RecoTracker_LSTCore_interface_ModuleConnectionMap_h

#include <iostream>
#include <fstream>
#include <vector>
#include <array>
#include <map>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>

namespace lst {
class ModuleConnectionMap {
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/interface/PixelMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace lst {
std::vector<unsigned int> connectedPixelsIndexNeg;
std::vector<unsigned int> connectedPixelsSizesNeg;

int* pixelType;
const int* pixelType;

PixelMap(unsigned int sizef = size_superbins)
: pixelModuleIndex(0),
Expand Down
6 changes: 1 addition & 5 deletions RecoTracker/LSTCore/interface/TiltedGeometry.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#ifndef RecoTracker_LSTCore_interface_TiltedGeometry_h
#define RecoTracker_LSTCore_interface_TiltedGeometry_h

#include <vector>
#include <map>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <stdexcept>
#include <vector>

namespace lst {
class TiltedGeometry {
Expand Down
Loading

0 comments on commit 2bc333b

Please sign in to comment.