ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGPUPatternRecognition
src
DeviceTripletSeedingAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
DeviceTripletSeedingAlg.h
"
5
6
#include "
StoreGate/ReadHandle.h
"
7
#include "
StoreGate/WriteHandle.h
"
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
17
namespace
ActsTrk
{
18
19
// -----------------------------------------------------------------------
20
StatusCode
DeviceTripletSeedingAlg::initialize
()
21
{
22
ATH_MSG_DEBUG
(
"Initializing "
<< name());
23
24
ATH_CHECK
(
m_seedingAlgProviderTool
.retrieve());
25
ATH_CHECK
(
m_deviceMR
.retrieve());
26
ATH_CHECK
(
m_inputPixelSPKey
.initialize());
27
ATH_CHECK
(
m_outputPixelSeedsKey
.initialize());
28
29
ATH_CHECK
(
configureTripletSeeder
());
30
31
ATH_MSG_DEBUG
(
"Successfully initialized"
);
32
return
StatusCode::SUCCESS;
33
}
34
35
StatusCode
DeviceTripletSeedingAlg::configureTripletSeeder
()
36
{
37
38
ATH_MSG_INFO
(
"Setting up configs"
);
39
m_seedfinder
.zMin = -3000.f *
unit<traccc::scalar>::mm
;
40
m_seedfinder
.zMax = 3000.f *
unit<traccc::scalar>::mm
;
41
m_seedfinder
.rMax = 320.f *
unit<traccc::scalar>::mm
;
42
m_seedfinder
.rMin = 33.f *
unit<traccc::scalar>::mm
;
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)
53
m_seedfinder
.deltaRMin = 20 *
unit<traccc::scalar>::mm
;
54
m_seedfinder
.deltaRMax = 100 *
unit<traccc::scalar>::mm
;
55
m_seedfinder
.deltaZMax = 800 *
unit<traccc::scalar>::mm
;
56
57
m_seedfinder
.minPt = 900.f *
unit<traccc::scalar>::MeV
;
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
80
StatusCode
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
DeviceTripletSeedingAlg.h
unit
detray::unit< scalar_t > unit
Definition
DeviceTripletSeedingAlg.h:22
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
ActsTrk::DeviceTripletSeedingAlg::configureTripletSeeder
virtual StatusCode configureTripletSeeder()
Definition
DeviceTripletSeedingAlg.cxx:35
ActsTrk::DeviceTripletSeedingAlg::m_seedingAlgProviderTool
ToolHandle< IDeviceSeedingAlgProviderTool > m_seedingAlgProviderTool
Definition
DeviceTripletSeedingAlg.h:55
ActsTrk::DeviceTripletSeedingAlg::m_inputPixelSPKey
SG::ReadHandleKey< traccc::edm::spacepoint_collection::const_view > m_inputPixelSPKey
Definition
DeviceTripletSeedingAlg.h:64
ActsTrk::DeviceTripletSeedingAlg::m_seedfinder
traccc::seedfinder_config m_seedfinder
Definition
DeviceTripletSeedingAlg.h:75
ActsTrk::DeviceTripletSeedingAlg::m_outputPixelSeedsKey
SG::WriteHandleKey< traccc::edm::seed_collection::buffer > m_outputPixelSeedsKey
Definition
DeviceTripletSeedingAlg.h:70
ActsTrk::DeviceTripletSeedingAlg::m_seedfilter
traccc::seedfilter_config m_seedfilter
Definition
DeviceTripletSeedingAlg.h:76
ActsTrk::DeviceTripletSeedingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition
DeviceTripletSeedingAlg.cxx:80
ActsTrk::DeviceTripletSeedingAlg::initialize
virtual StatusCode initialize() override
Function initializing the algorithm.
Definition
DeviceTripletSeedingAlg.cxx:20
ActsTrk::DeviceTripletSeedingAlg::m_deviceMR
ToolHandle< AthDevice::IMemoryResourceTool > m_deviceMR
Definition
DeviceTripletSeedingAlg.h:59
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0