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 IActsExtrapolationTool &extrapolator,
16  Acts::BoundTrackParameters perigee_parameters,
17  double pathLimit) {
19  perigee_parameters,
20  Acts::Direction::Forward,
21  pathLimit);
22  std::array<unsigned int,4> expected_layer_pattern {0u,0u,0u,0u};
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) {
32  detEl = dynamic_cast<const InDetDD::SiDetectorElement *>(actsDetEl->upstreamDetectorElement());
33  if (detEl) {
34  if (detEl->isPixel()) {
36  unsigned int pattern_idx = type==InDetDD::PixelBarrel ? 0 : 1;
37  const PixelID* pixel_id = static_cast<const PixelID *>(detEl->getIdHelper());
38  expected_layer_pattern[pattern_idx] |= (1<< pixel_id->layer_disk(detEl->identify()) );
39  }
40  else if (detEl->isSCT()) {
41  // @TODO SCT/strip layer number should be shifted by total number of pixel layers ...
42  const SCT_ID* sct_id = static_cast<const SCT_ID *>(detEl->getIdHelper());
43  unsigned int pattern_idx = detEl->isBarrel() ? 2 : 3;
44  expected_layer_pattern[pattern_idx] |= (1<< sct_id->layer_disk(detEl->identify()) );
45  }
46  }
47  }
48  }
49  }
50  }
51  return expected_layer_pattern;
52  }
53 
54 }
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
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::detail::expectedLayerPattern
std::array< unsigned int, 4 > expectedLayerPattern(const EventContext &ctx, const IActsExtrapolationTool &extrapolator, Acts::BoundTrackParameters perigee_parameters, double pathLimit)
Extrapolate from the perigee outwards and gather information which detector layers should have hits.
Definition: ExpectedHitUtils.cxx:14
ActsDetectorElement::upstreamDetectorElement
const GeoVDetectorElement * upstreamDetectorElement() const
Returns the underllying GeoModel detectorelement that this one is based on.
Definition: ActsDetectorElement.cxx:288
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
InDetDD::SolidStateDetectorElementBase::getIdHelper
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
IActsExtrapolationTool
Definition: IActsExtrapolationTool.h:31
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:42
ActsDetectorElement.h
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
InDetDD::PixelBarrel
@ PixelBarrel
Definition: DetectorDesign.h:46
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
SiDetectorElement.h
SCT_ID
Definition: SCT_ID.h:68
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArCellBinning.step
step
Definition: LArCellBinning.py:158
InDetDD::SiDetectorElement::isSCT
bool isSCT() const
ActsTrk::detail
Definition: Decoration.h:15
IActsExtrapolationTool::propagationSteps
virtual ActsPropagationOutput propagationSteps(const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, Acts::Direction navDir=Acts::Direction::Forward, double pathLimit=std::numeric_limits< double >::max()) const =0
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID
Definition: PixelID.h:67
ExpectedHitUtils.h
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
ActsPropagationOutput
std::pair< std::vector< Acts::detail::Step >, ActsRecordedMaterial > ActsPropagationOutput
Finally the output of the propagation test.
Definition: IActsExtrapolationTool.h:25