Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import FWCore.ParameterSet.Config as cms

hltLSTGeometry = cms.ESProducer('LSTGeometryESProducer',
ptCut = cms.double(0.8),
)
1 change: 1 addition & 0 deletions HLTrigger/Configuration/python/HLT_75e33_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@

fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi")

fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltLSTGeometry_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPModulesDevLST_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPTTRHBuilderWithoutRefit_cfi")

Expand Down
1 change: 1 addition & 0 deletions HLTrigger/Configuration/python/HLT_75e33_timing_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@

fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi")

fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltLSTGeometry_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPModulesDevLST_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPTTRHBuilderWithoutRefit_cfi")

Expand Down
1 change: 1 addition & 0 deletions HLTrigger/Configuration/python/HLT_NGTScouting_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPKFTrajectorySmootherForL2Muon_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/trackdnn_source_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltLSTGeometry_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPModulesDevLST_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPTTRHBuilderWithoutRefit_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPMkFit_cfi")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,12 @@

_HighPtTripletStepTask_LST = HighPtTripletStepTask.copy()
from RecoLocalTracker.Phase2TrackerRecHits.Phase2TrackerRecHits_cfi import siPhase2RecHits
from RecoTracker.LSTGeometry.lstGeometryESProducer_cfi import lstGeometryESProducer
from RecoTracker.LST.lstSeedTracks_cff import lstInitialStepSeedTracks,lstHighPtTripletStepSeedTracks
from RecoTracker.LST.lstInputProducer_cfi import lstInputProducer
from RecoTracker.LST.lstProducerTask_cff import *

_HighPtTripletStepTask_LST.add(siPhase2RecHits, lstInitialStepSeedTracks, lstHighPtTripletStepSeedTracks, lstInputProducer,
_HighPtTripletStepTask_LST.add(siPhase2RecHits, lstInitialStepSeedTracks, lstHighPtTripletStepSeedTracks, lstGeometryESProducer, lstInputProducer,
lstProducerTask, highPtTripletStepLSTpTracks, highPtTripletStepLSTT4T5Tracks, highPtTripletStepSelectorLSTT4T5)
(trackingPhase2PU140 & trackingLST).toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_LST)

Expand Down
17 changes: 12 additions & 5 deletions RecoTracker/LST/plugins/alpaka/LSTModulesDevESProducer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// LST includes
#include "RecoTracker/LSTCore/interface/alpaka/LST.h"
#include "RecoTracker/LSTGeometry/interface/Common.h"
#include "RecoTracker/LSTGeometry/interface/Geometry.h"

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

Expand All @@ -14,22 +16,27 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {

class LSTModulesDevESProducer : public ESProducer {
private:
std::string ptCutLabel_;
double ptCut_;
edm::ESGetToken<lstgeometry::Geometry, TrackerRecoGeometryRecord> lstGeoToken_;

public:
LSTModulesDevESProducer(edm::ParameterSet const& iConfig)
: ESProducer(iConfig), ptCutLabel_(iConfig.getParameter<std::string>("ptCutLabel")) {
setWhatProduced(this, ptCutLabel_);
: ESProducer(iConfig), ptCut_(iConfig.getParameter<double>("ptCut")) {
std::string ptCutStr = lstgeometry::floatToStr(ptCut_, 1);

auto cc = setWhatProduced(this, ptCutStr);
lstGeoToken_ = cc.consumes<lstgeometry::Geometry>(edm::ESInputTag("", ptCutStr));
}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::string>("ptCutLabel", "0.8");
desc.add<double>("ptCut", 0.8);
descriptions.addWithDefaultLabel(desc);
}

std::unique_ptr<lst::LSTESData<DevHost>> produce(TrackerRecoGeometryRecord const& iRecord) {
return lst::loadAndFillESHost(ptCutLabel_);
const auto& lstg = iRecord.get(lstGeoToken_);
return lst::fillESDataHost(lstg);
}
};

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

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

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
Expand All @@ -25,13 +26,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
public:
LSTProducer(edm::ParameterSet const& config)
: EDProducer(config),
lstInputToken_{consumes(config.getParameter<edm::InputTag>("lstInput"))},
lstESToken_{esConsumes(edm::ESInputTag("", config.getParameter<std::string>("ptCutLabel")))},
verbose_(config.getParameter<bool>("verbose")),
ptCut_(config.getParameter<double>("ptCut")),
ptCutStr_(lstgeometry::floatToStr(ptCut_, 1)),
clustSizeCut_(static_cast<uint16_t>(config.getParameter<uint32_t>("clustSizeCut"))),
nopLSDupClean_(config.getParameter<bool>("nopLSDupClean")),
tcpLSTriplets_(config.getParameter<bool>("tcpLSTriplets")),
lstInputToken_{consumes(config.getParameter<edm::InputTag>("lstInput"))},
lstESToken_{esConsumes(edm::ESInputTag("", ptCutStr_))},
lstOutputToken_{produces()} {}

void produce(edm::StreamID sid, device::Event& iEvent, const device::EventSetup& iSetup) const override {
Expand All @@ -42,7 +44,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {

lst.run(iEvent.queue(),
verbose_,
static_cast<float>(ptCut_),
ptCut_,
clustSizeCut_,
&lstESDeviceData,
&lstInputDC,
Expand All @@ -60,20 +62,20 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
desc.add<bool>("verbose", false);
desc.add<double>("ptCut", 0.8);
desc.add<uint32_t>("clustSizeCut", 16);
desc.add<std::string>("ptCutLabel", "0.8");
desc.add<bool>("nopLSDupClean", false);
desc.add<bool>("tcpLSTriplets", false);
descriptions.addWithDefaultLabel(desc);
}

private:
const device::EDGetToken<lst::LSTInputDeviceCollection> lstInputToken_;
const device::ESGetToken<lst::LSTESData<Device>, TrackerRecoGeometryRecord> lstESToken_;
const bool verbose_;
const double ptCut_;
const std::string ptCutStr_;
const uint16_t clustSizeCut_;
const bool nopLSDupClean_;
const bool tcpLSTriplets_;
const device::EDGetToken<lst::LSTInputDeviceCollection> lstInputToken_;
const device::ESGetToken<lst::LSTESData<Device>, TrackerRecoGeometryRecord> lstESToken_;
const device::EDPutToken<lst::TrackCandidatesBaseDeviceCollection> lstOutputToken_;
};

Expand Down
6 changes: 5 additions & 1 deletion RecoTracker/LST/python/lstProducerTask_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

from RecoTracker.LST.lstModulesDevESProducer_cfi import lstModulesDevESProducer

lstProducerTask = cms.Task(lstModulesDevESProducer, lstProducer)
from RecoTracker.LST.lstInputProducer_cfi import lstInputProducer

from RecoTracker.LSTGeometry.lstGeometryESProducer_cfi import lstGeometryESProducer

lstProducerTask = cms.Task(lstGeometryESProducer, lstModulesDevESProducer, lstInputProducer, lstProducer)
1 change: 1 addition & 0 deletions RecoTracker/LSTCore/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<use name="DataFormats/SoATemplate"/>
<use name="DataFormats/TrackerRecHit2D"/>
<use name="HeterogeneousCore/AlpakaInterface"/>
<use name="RecoTracker/LSTGeometry"/>
<flags ALPAKA_BACKENDS="1"/>
<export>
<lib name="1"/>
Expand Down
5 changes: 5 additions & 0 deletions RecoTracker/LSTCore/interface/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "DataFormats/Common/interface/StdArray.h"
#include "HeterogeneousCore/AlpakaInterface/interface/config.h"

#include "RecoTracker/LSTGeometry/interface/Common.h"

#if defined(FP16_Base)
#if defined ALPAKA_ACC_GPU_CUDA_ENABLED
#include <cuda_fp16.h>
Expand Down Expand Up @@ -42,6 +44,9 @@ namespace lst {
constexpr uint16_t kTCEmptyLowerModule = 0xFFFF; // Sentinel for empty lowerModule index
constexpr unsigned int kTCEmptyHitIdx = 0xFFFFFFFF; // Sentinel for empty hit slots

constexpr float kB = lstgeometry::kB;
constexpr float kC = lstgeometry::kC;

// Half precision wrapper functions.
#if defined(FP16_Base)
#define __F2H __float2half
Expand Down
7 changes: 6 additions & 1 deletion RecoTracker/LSTCore/interface/EndcapGeometry.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef RecoTracker_LSTCore_interface_EndcapGeometry_h
#define RecoTracker_LSTCore_interface_EndcapGeometry_h

#include "RecoTracker/LSTGeometry/interface/Sensor.h"
#include "RecoTracker/LSTGeometry/interface/Slope.h"

#include <map>
#include <string>
#include <vector>
Expand All @@ -18,9 +21,11 @@ namespace lst {
unsigned int nEndCapMap;

EndcapGeometry() = default;
EndcapGeometry(std::string const& filename);
EndcapGeometry(std::string const&);
EndcapGeometry(lstgeometry::Slopes const&, lstgeometry::Sensors const& sensors);

void load(std::string const&);
void load(lstgeometry::Slopes const&, lstgeometry::Sensors const& sensors);
void fillGeoMapArraysExplicit();
float getdxdy_slope(unsigned int detid) const;
};
Expand Down
4 changes: 3 additions & 1 deletion RecoTracker/LSTCore/interface/LSTESData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "RecoTracker/LSTCore/interface/EndcapGeometryDevHostCollection.h"
#include "RecoTracker/LSTCore/interface/ModulesHostCollection.h"
#include "RecoTracker/LSTCore/interface/PixelMap.h"
#include "RecoTracker/LSTGeometry/interface/Geometry.h"

#include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h"

Expand Down Expand Up @@ -40,7 +41,8 @@ namespace lst {
pixelMapping(pixelMappingIn) {}
};

std::unique_ptr<LSTESData<alpaka_common::DevHost>> loadAndFillESHost(std::string& ptCutLabel);
std::unique_ptr<LSTESData<alpaka_common::DevHost>> loadAndFillESDataHost(std::string& ptCutLabel);
std::unique_ptr<LSTESData<alpaka_common::DevHost>> fillESDataHost(lstgeometry::Geometry const& lstg);

} // namespace lst

Expand Down
6 changes: 4 additions & 2 deletions RecoTracker/LSTCore/interface/ModuleConnectionMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ namespace lst {
std::map<unsigned int, std::vector<unsigned int>> moduleConnections_;

public:
ModuleConnectionMap();
ModuleConnectionMap(std::string const& filename);
ModuleConnectionMap() = default;
ModuleConnectionMap(std::string const&);
ModuleConnectionMap(std::map<unsigned int, std::vector<unsigned int>> const&);

void load(std::string const&);
void load(std::map<unsigned int, std::vector<unsigned int>> const&);
void add(std::string const&);
void print();

Expand Down
6 changes: 5 additions & 1 deletion RecoTracker/LSTCore/interface/TiltedGeometry.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef RecoTracker_LSTCore_interface_TiltedGeometry_h
#define RecoTracker_LSTCore_interface_TiltedGeometry_h

#include "RecoTracker/LSTGeometry/interface/Slope.h"

#include <map>
#include <string>
#include <vector>
Expand All @@ -13,9 +15,11 @@ namespace lst {

public:
TiltedGeometry() = default;
TiltedGeometry(std::string const& filename);
TiltedGeometry(std::string const&);
TiltedGeometry(lstgeometry::Slopes const&);

void load(std::string const&);
void load(lstgeometry::Slopes const&);

float getDrDz(unsigned int detid) const;
float getDxDy(unsigned int detid) const;
Expand Down
6 changes: 2 additions & 4 deletions RecoTracker/LSTCore/interface/alpaka/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
25.007152356, 37.2186993757, 52.3104270826, 68.6658656666, 85.9770373007, 108.301772384};
HOST_DEVICE_CONSTANT float kMiniRminMeanEndcap[5] = {
130.992832231, 154.813883559, 185.352604327, 221.635123002, 265.022076742};
HOST_DEVICE_CONSTANT float k2Rinv1GeVf = (2.99792458e-3 * 3.8) / 2;
HOST_DEVICE_CONSTANT float kR1GeVf = 1. / (2.99792458e-3 * 3.8);
HOST_DEVICE_CONSTANT float k2Rinv1GeVf = (kC * kB) / 2;
HOST_DEVICE_CONSTANT float kR1GeVf = 1. / (kC * kB);
HOST_DEVICE_CONSTANT float kSinAlphaMax = 0.95;
HOST_DEVICE_CONSTANT float kDeltaZLum = 15.0;
HOST_DEVICE_CONSTANT float kPixelPSZpitch = 0.15;
Expand All @@ -44,8 +44,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
HOST_DEVICE_CONSTANT float kWidthPS = 0.01;
HOST_DEVICE_CONSTANT float kPt_betaMax = 7.0;
HOST_DEVICE_CONSTANT int kNTripletThreshold = 1000;
// To be updated with std::numeric_limits<float>::infinity() in the code and data files
HOST_DEVICE_CONSTANT float kVerticalModuleSlope = 123456789.0;
HOST_DEVICE_CONSTANT int kLogicalOTLayers = 11; // logical OT layers are 1..11

HOST_DEVICE_CONSTANT float kMiniDeltaTilted[3] = {0.26f, 0.26f, 0.26f};
Expand Down
21 changes: 20 additions & 1 deletion RecoTracker/LSTCore/src/EndcapGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

#include <fstream>
#include <iostream>
#include <limits>
#include <sstream>
#include <stdexcept>

lst::EndcapGeometry::EndcapGeometry(std::string const& filename) { load(filename); }

lst::EndcapGeometry::EndcapGeometry(lstgeometry::Slopes const& slopes, lstgeometry::Sensors const& sensors) {
load(slopes, sensors);
}

void lst::EndcapGeometry::load(std::string const& filename) {
dxdy_slope_.clear();
centroid_phis_.clear();
Expand All @@ -26,7 +31,9 @@ void lst::EndcapGeometry::load(std::string const& filename) {
ifile.read(reinterpret_cast<char*>(&centroid_phi), sizeof(centroid_phi));

if (ifile) {
dxdy_slope_[detid] = dxdy_slope;
// TODO: This is needed for now in case old geometry files are used. Remove once deemed unnecessary.
constexpr float kLegacyVerticalSlope = 123456789.0f;
dxdy_slope_[detid] = (dxdy_slope == kLegacyVerticalSlope) ? std::numeric_limits<float>::infinity() : dxdy_slope;
centroid_phis_[detid] = centroid_phi;
} else {
// End of file or read failed
Expand All @@ -39,6 +46,18 @@ void lst::EndcapGeometry::load(std::string const& filename) {
fillGeoMapArraysExplicit();
}

void lst::EndcapGeometry::load(lstgeometry::Slopes const& slopes, lstgeometry::Sensors const& sensors) {
dxdy_slope_.clear();
centroid_phis_.clear();

for (const auto& [detId, slope] : slopes) {
dxdy_slope_[detId] = slope.dxdy;
centroid_phis_[detId] = sensors.at(detId).centerPhi;
}

fillGeoMapArraysExplicit();
}

void lst::EndcapGeometry::fillGeoMapArraysExplicit() {
nEndCapMap = centroid_phis_.size();

Expand Down
Loading