Creates and popules the DetectorElement -> Acts::Surface geo identifier map from the geometry service.
51 {
52
53 auto detector_element_to_geoid = std::make_unique<DetectorElementToActsGeometryIdMap>();
54
55 struct Counter{
56 unsigned n_sensitive_elements{0};
57 unsigned n_detector_elements{0};
58 unsigned n_wrong_type{0};
59 };
61 trackingGeometry()->visitSurfaces([
this, &counter, &detector_element_to_geoid](
const Acts::Surface *surface) {
62 if (!surface || !surface->associatedDetectorElement()) {
64 return;
65 }
67 const auto* detEl = dynamic_cast<const IDetectorElementBase*>(surface->associatedDetectorElement());
68 if (!detEl) {
69 return;
70 }
71
73 const IdentifierHash&
hash) {
77 };
78 switch(detEl->detectorType()) {
82 dynamic_cast<const ActsDetectorElement*>(detEl)->identifyHash());
83 break;
86 dynamic_cast<const ActsDetectorElement*>(detEl)->identifyHash());
87 break;
90 dynamic_cast<const ActsDetectorElement*>(detEl)->identifyHash());
91 break;
93 break;
94 }
102
104 break;
105 }
108 counter.n_detector_elements = 0;
109 return;
110 }
111 }, true );
113 <<
" (with " <<
counter.n_detector_elements <<
")" );
114 if (
counter.n_sensitive_elements > 0 &&
115 counter.n_detector_elements==0) {
116 ATH_MSG_ERROR(
"No surface with associated detector element" );
117 return nullptr;
118 }
120 ATH_MSG_WARNING(
"Surfaces associated to detector elements not of type Trk::TrkDetElementBase :" <<
counter.n_wrong_type);
121 }
122 return detector_element_to_geoid;
123}
#define ATH_MSG_WARNING(x)
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
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.
@ Trt
Maybe the Sct / Pixel for Itk become seperate entries?
@ UnDefined
Small Thing Gap chambers (NSW)
UncalibMeasType
Define the type of the uncalibrated measurement.
static const Acts::GeometryIdentifier & makeValue(const Acts::GeometryIdentifier &geo_id)