ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceTripletSeedingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
8
9// traccc EDM
10#include "traccc/edm/silicon_cell_collection.hpp"
11#include "traccc/edm/measurement_collection.hpp"
12
13// vecmem
14#include "vecmem/memory/memory_resource.hpp"
15
16
17namespace ActsTrk {
18
19// -----------------------------------------------------------------------
21{
22 ATH_MSG_DEBUG("Initializing " << name());
23
25 ATH_CHECK(m_deviceMR.retrieve());
26 ATH_CHECK(m_inputPixelSPKey.initialize());
27 ATH_CHECK(m_outputPixelSeedsKey.initialize());
28
30
31 ATH_MSG_DEBUG("Successfully initialized");
32 return StatusCode::SUCCESS;
33}
34
36{
37
38 ATH_MSG_INFO("Setting up configs");
43 // 3 sigmas of max beam spot delta z for Run 3
44 // https://twiki.cern.ch/twiki/pub/AtlasPublic/BeamSpotPublicResults/BeamspotRun2vLumi_sig_z.png
45 m_seedfinder.collisionRegionMax = 3 * 38 * unit<traccc::scalar>::mm;
46 m_seedfinder.collisionRegionMin = -m_seedfinder.collisionRegionMax;
47 // Based on Pixel barrel layers layout:
48 // https://cds.cern.ch/record/2850865/files/ITK_schematic.png
49 // Barrel layers position: 33, 96, 126, 225, 286
50 // Minimum R distance between 2 layers: 30
51 // Max distance between N, N+2 layer (allowing one "hole"): 160
52 // Plus some margin (2 mm)
54 m_seedfinder.deltaRMax = 100 * unit<traccc::scalar>::mm;
55 m_seedfinder.deltaZMax = 800 * unit<traccc::scalar>::mm;
56
58 m_seedfinder.cotThetaMax = 27.2899f;
59 m_seedfinder.impactMax = 2.f * unit<traccc::scalar>::mm;
60 m_seedfinder.sigmaScattering = 3.0f;
61 m_seedfinder.maxPtScattering = 10.f * unit<traccc::scalar>::GeV;
62 m_seedfinder.radLengthPerSeed = 0.05f;
63 m_seedfinder.maxSeedsPerSpM = 2;
64 m_seedfinder.setup();
65
66 m_seedfilter.good_spB_min_radius = 150.f * unit<traccc::scalar>::mm;
67 m_seedfilter.good_spB_weight_increase = 400.f;
68 m_seedfilter.good_spT_max_radius = 150.f * unit<traccc::scalar>::mm;
69 m_seedfilter.good_spT_weight_increase = 200.f;
70 m_seedfilter.good_spB_min_weight = 380.f;
71 m_seedfilter.seed_min_weight = 200.f;
72 m_seedfilter.spB_min_radius = 43.f * unit<traccc::scalar>::mm;
73 m_seedfilter.compatSeedLimit = 1;
74 // m_seedfilter.deltaInvHelixDiameter = 0.00003f / unit<traccc::scalar>::mm;
75
76 return StatusCode::SUCCESS;
77
78}
79
80StatusCode DeviceTripletSeedingAlg::execute(const EventContext& ctx) const
81{
82 ATH_MSG_DEBUG("Executing device pixel seeding.");
83
84 // ---- 1. Read input traccc measurements from StoreGate --------------------------------
85 auto inputTracccPixelSpacepoints = SG::makeHandle(m_inputPixelSPKey, ctx);
86 ATH_CHECK(inputTracccPixelSpacepoints.isValid());
87 ATH_MSG_DEBUG("Read traccc spacepoints from '"
88 << inputTracccPixelSpacepoints.key() << "'");
89
90 // ---- 2. Get traccc seeding alg ---------------------------------------------
91
92 auto seeding_pair = m_seedingAlgProviderTool->getTripletSeedingAlgorithm(ctx, m_seedfinder, m_seedfilter);
93 std::shared_ptr<const traccc::device::triplet_seeding_algorithm> seeding_alg = seeding_pair.second;
94
95 // ---- 3. Run traccc pixel seed formation ---------------------------------------------
96 traccc::edm::seed_collection::buffer pixel_seeds_gpu_buffer = (*seeding_alg)(*inputTracccPixelSpacepoints);
97
98 ATH_MSG_DEBUG("Reconstructed " << (seeding_pair.first)->get_size(pixel_seeds_gpu_buffer) << " pixel seeds.");
99
100 // ---- 4. Write output traccc seeds to StoreGate -------------------------
101 auto outputTracccPixelSeeds = SG::makeHandle(m_outputPixelSeedsKey, ctx);
102 ATH_CHECK(outputTracccPixelSeeds.record(
103 std::make_unique<traccc::edm::seed_collection::buffer>(
104 std::move(pixel_seeds_gpu_buffer))));
105 ATH_MSG_DEBUG("Wrote seeds buffer to '" << m_outputPixelSeedsKey.key() << "'");
106
107 return StatusCode::SUCCESS;
108}
109
110
111
112} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
detray::unit< scalar_t > unit
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
ToolHandle< IDeviceSeedingAlgProviderTool > m_seedingAlgProviderTool
SG::ReadHandleKey< traccc::edm::spacepoint_collection::const_view > m_inputPixelSPKey
SG::WriteHandleKey< traccc::edm::seed_collection::buffer > m_outputPixelSeedsKey
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
virtual StatusCode initialize() override
Function initializing the algorithm.
ToolHandle< AthDevice::IMemoryResourceTool > m_deviceMR
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())