Creates and popules the DetectorElement -> Acts::Surface geo identifier map from the geometry service.
54 {
55
56 auto detector_element_to_geoid = std::make_unique<DetectorElementToActsGeometryIdMap>();
57
58 struct Counter{
59 unsigned n_sensitive_elements{0};
60 unsigned n_detector_elements{0};
61 unsigned n_wrong_type{0};
62 };
64 trackingGeometry()->visitSurfaces([
this, &counter, &detector_element_to_geoid](
const Acts::Surface *surface) {
65 if (!surface || !surface->isSensitive()) {
67 return;
68 }
70 const auto* placement = dynamic_cast<const ISurfacePlacement*>(surface->surfacePlacement());
71 if (!placement) {
72 return;
73 }
74
76 const IdentifierHash&
hash) {
80 };
81 switch(placement->detectorType()) {
86 break;
90 break;
94 break;
96 break;
97 }
105
107 break;
108 }
111 counter.n_detector_elements = 0;
112 return;
113 }
114 }, true );
116 <<
" (with " <<
counter.n_detector_elements <<
")" );
117 if (
counter.n_sensitive_elements > 0 &&
118 counter.n_detector_elements==0) {
119 ATH_MSG_ERROR(
"No surface with associated detector element" );
120 return nullptr;
121 }
123 ATH_MSG_WARNING(
"Surfaces associated to detector elements not of type Trk::TrkDetElementBase :" <<
counter.n_wrong_type);
124 }
125 return detector_element_to_geoid;
126}
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
#define ATH_MSG_WARNING(x)
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ Rpc
Monitored Drift Tubes.
@ UnDefined
Small Thing Gap chambers (NSW).
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
UncalibMeasType
Define the type of the uncalibrated measurement.
static const Acts::GeometryIdentifier & makeValue(const Acts::GeometryIdentifier &geo_id)