ATLAS Offline Software
Loading...
Searching...
No Matches
ExpectedHitUtils.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
11
12namespace ActsTrk::detail {
13
14 std::array<unsigned int,4> expectedLayerPattern(const EventContext& ctx,
15 const IExtrapolationTool &extrapolator,
16 const Acts::BoundTrackParameters& perigee_parameters,
17 double pathLimit) {
18 std::array<unsigned int,4> expected_layer_pattern {0u,0u,0u,0u};
19 auto result = extrapolator.propagationSteps(ctx,
20 perigee_parameters,
21 Acts::Direction::Forward(),
22 pathLimit);
23 if (!result.ok()) {
24 return expected_layer_pattern;
25 }
26 for (const Acts::detail::Step &step : result->first ) {
27 // @TODO boundary check ?, does layer number match layer numbering in athena ?
28 // @TODO filter out dead modules
29 if (!step.geoID.sensitive()) {
30 continue;
31 }
32 const auto* actsDetEl = getActsDetectorElement(step.surface);
33 if (actsDetEl) {
34 addToExpectedLayerPattern(expected_layer_pattern, *actsDetEl);
35 }
36
37 }
38
39
40 return expected_layer_pattern;
41 }
42
43 void addToExpectedLayerPattern(std::array<unsigned int,4>& pattern, const ActsDetectorElement& detElement) {
45 detEl = dynamic_cast<const InDetDD::SiDetectorElement *>(detElement.upstreamDetectorElement());
46 if (detEl) {
47 if (detEl->isPixel()) {
49 unsigned int pattern_idx = type==InDetDD::PixelBarrel ? 0 : 1;
50 const PixelID* pixel_id = static_cast<const PixelID *>(detEl->getIdHelper());
51 pattern[pattern_idx] |= (1<< pixel_id->layer_disk(detEl->identify()) );
52 }
53 else if (detEl->isSCT()) {
54 // @TODO SCT/strip layer number should be shifted by total number of pixel layers ...
55 const SCT_ID* sct_id = static_cast<const SCT_ID *>(detEl->getIdHelper());
56 unsigned int pattern_idx = detEl->isBarrel() ? 2 : 3;
57 pattern[pattern_idx] |= (1<< sct_id->layer_disk(detEl->identify()) );
58 }
59 }
60 }
61}
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
const GeoVDetectorElement * upstreamDetectorElement() const
Returns the underllying GeoModel detectorelement that this one is based on.
Tool to extrapolate bound track parameters through the Acts::TrackingGeometry.
virtual Acts::Result< PropagationOutput > propagationSteps(const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, Acts::Direction navDir=Acts::Direction::Forward(), double pathLimit=1._km) const =0
Extrapolate the track parameters until the end of the world and record the performed steps & the allo...
virtual DetectorType type() const
Type of element.
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
virtual Identifier identify() const override final
identifier of this detector element (inline)
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline).
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
int layer_disk(const Identifier &id) const
Definition PixelID.h:602
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
int layer_disk(const Identifier &id) const
Definition SCT_ID.h:687
Hash functions to pack the source link into unordered_maps / unordered_sets.
std::array< unsigned int, 4 > expectedLayerPattern(const EventContext &ctx, const ActsTrk::IExtrapolationTool &extrapolator, const Acts::BoundTrackParameters &perigee_parameters, double pathLimit)
Extrapolate from the perigee outwards and gather information which detector layers should have hits.
void addToExpectedLayerPattern(std::array< unsigned int, 4 > &pattern, const ActsDetectorElement &detElement)