ATLAS Offline Software
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 
12 namespace 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()) {
28  const ActsDetectorElement *
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 }
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
get_generator_info.result
result
Definition: get_generator_info.py:21
ActsTrk::IExtrapolationTool::propagationSteps
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...
ActsDetectorElement::upstreamDetectorElement
const GeoVDetectorElement * upstreamDetectorElement() const
Returns the underllying GeoModel detectorelement that this one is based on.
Definition: ActsDetectorElement.cxx:286
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
InDetDD::SolidStateDetectorElementBase::getIdHelper
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
InDetDD::DetectorType
DetectorType
Definition: DetectorDesign.h:45
InDetDD::DetectorDesign::type
virtual DetectorType type() const
Type of element.
Definition: DetectorDesign.cxx:101
ActsDetectorElement
Definition: ActsDetectorElement.h:44
ActsDetectorElement.h
ActsTrk::IExtrapolationTool
Tool to extrapolate bound track parameters.
Definition: IExtrapolationTool.h:24
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:607
InDetDD::PixelBarrel
@ PixelBarrel
Definition: DetectorDesign.h:46
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:692
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
SiDetectorElement.h
SCT_ID
Definition: SCT_ID.h:68
LArCellBinning.step
step
Definition: LArCellBinning.py:158
InDetDD::SiDetectorElement::isSCT
bool isSCT() const
ActsTrk::detail
Athena definition of the Eigen plugin.
Definition: MeasurementCalibratorBase.h:19
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID
Definition: PixelID.h:67
ActsTrk::detail::expectedLayerPattern
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.
Definition: ExpectedHitUtils.cxx:14
ExpectedHitUtils.h
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
ActsTrk::detail::addToExpectedLayerPattern
void addToExpectedLayerPattern(std::array< unsigned int, 4 > &pattern, const ActsDetectorElement &detElement)
Definition: ExpectedHitUtils.cxx:40