ATLAS Offline Software
Loading...
Searching...
No Matches
ExpectedHitUtils.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#include "ExpectedHitUtils.h"
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 for (const Acts::detail::Step &step : result.first ) {
24 // @TODO boundary check ?, does layer number match layer numbering in athena ?
25 // @TODO filter out dead modules
26 if (step.geoID.sensitive()) {
27 if (step.surface && step.surface->associatedDetectorElement()) {
29 actsDetEl = dynamic_cast<const ActsDetectorElement *>(step.surface->associatedDetectorElement());
30 if (actsDetEl) {
31 addToExpectedLayerPattern(expected_layer_pattern, *actsDetEl);
32 }
33 }
34 }
35 }
36
37 return expected_layer_pattern;
38 }
39
40 void addToExpectedLayerPattern(std::array<unsigned int,4>& pattern, const ActsDetectorElement& detElement) {
42 detEl = dynamic_cast<const InDetDD::SiDetectorElement *>(detElement.upstreamDetectorElement());
43 if (detEl) {
44 if (detEl->isPixel()) {
46 unsigned int pattern_idx = type==InDetDD::PixelBarrel ? 0 : 1;
47 const PixelID* pixel_id = static_cast<const PixelID *>(detEl->getIdHelper());
48 pattern[pattern_idx] |= (1<< pixel_id->layer_disk(detEl->identify()) );
49 }
50 else if (detEl->isSCT()) {
51 // @TODO SCT/strip layer number should be shifted by total number of pixel layers ...
52 const SCT_ID* sct_id = static_cast<const SCT_ID *>(detEl->getIdHelper());
53 unsigned int pattern_idx = detEl->isBarrel() ? 2 : 3;
54 pattern[pattern_idx] |= (1<< sct_id->layer_disk(detEl->identify()) );
55 }
56 }
57 }
58}
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.
virtual PropagationOutput propagationSteps(const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, Acts::Direction navDir=Acts::Direction::Forward(), double pathLimit=std::numeric_limits< double >::max()) 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:67
int layer_disk(const Identifier &id) const
Definition PixelID.h:607
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
Athena definition of the Eigen plugin.
std::array< unsigned int, 4 > expectedLayerPattern(const EventContext &ctx, const 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)