83 {
85 <<std::endl<<std::endl<<
m_geoUtilTool->dumpVolume(define.physVol));
86 const GeoShape* shape =
m_geoUtilTool->extractShape(define.physVol);
87 if (!shape) {
89 return StatusCode::FAILURE;
90 }
91
92 if (shape->typeID() != GeoTrd::getClassTypeID()) {
94 <<
" is expected to be a trapezoid "<<
m_geoUtilTool->dumpShape(shape));
95 return StatusCode::FAILURE;
96 }
97 const GeoTrd* chambTrd = static_cast<const GeoTrd*>(shape);
98 define.halfWidthShort = std::min(chambTrd->getYHalfLength1(), chambTrd->getYHalfLength2());
99 define.halfWidthLong = std::max(chambTrd->getYHalfLength1(), chambTrd->getYHalfLength2());
100 define.halfHeight = chambTrd->getZHalfLength();
101 define.halfThickness = chambTrd->getXHalfLength1();
103 std::vector<physVolWithTrans> allGasGaps =
m_geoUtilTool->findAllLeafNodesByName(define.physVol,
"TgcGas");
104 if (allGasGaps.empty()) {
107 return StatusCode::FAILURE;
108 }
112 if (!layerReadout) {
113 return StatusCode::SUCCESS;
114 }
115 unsigned layerIdx = static_cast<unsigned>(layerReadout->hash());
116 if (layerIdx >= define.sensorLayouts.size()) {
117 ATH_MSG_FATAL(
"The strip index "<<layerIdx<<
" is out of range for gasGap "<<gasGap);
118 return StatusCode::FAILURE;
119 }
120 define.sensorLayouts[layerIdx] = layerReadout;
121 return StatusCode::SUCCESS;
122 };
124 const std::string
key = std::format(
"{:}_{:}{:}",define.chambDesign, gasGap+1,
125 (
m_idHelperSvc->stationEta(define.detElId) > 0 ?
"A" :
"C"));
127 if (!wireReadout) {
131 <<" "<<define.chambDesign<<", gasGap "<<(gasGap+1));
132 return StatusCode::FAILURE;
133 }
134 const GeoShape* gapShape =
m_geoUtilTool->extractShape(pVolTrans.volume);
135 if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
137 return StatusCode::FAILURE;
138 }
139 const GeoTrd* gapTrd = static_cast<const GeoTrd*>(gapShape);
142 if (wireDesign) {
143 wireDesign = (*factoryCache.wireLayouts.insert(std::move(wireDesign)).first);
144 }
145 if (radDesign) {
146 radDesign = (*factoryCache.stripReadouts.insert(std::move(radDesign)).first);
147 }
149 if (!wireReadout && wireDesign) {
155 if (radDesign) {
156 wireReadout = std::make_unique<StripLayer>(factoryCache.trfNodeMaker.makeTransform(trans),
157 wireDesign, radDesign, layHash);
158 wireReadout->flipPhiRotation();
159 } else {
160 wireReadout = std::make_unique<StripLayer>(factoryCache.trfNodeMaker.makeTransform(trans),
161 wireDesign, layHash);
162 }
163 }
164 }
165 ATH_CHECK(assignReadoutLayer(wireReadout));
167 }
169 return StatusCode::SUCCESS;
170}
#define ATH_MSG_VERBOSE(x)
static IdentifierHash constructHash(unsigned measCh, unsigned gasGap, const bool isStrip)
Constructs the Hash out of the Identifier fields (channel, gasGap, isStrip)
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
Eigen::Affine3d Transform3D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
GeoModel::TransientConstSharedPtr< WireGroupDesign > WireDesignPtr
IMuonGeoUtilityTool::physVolWithTrans physVolWithTrans
GeoModel::TransientConstSharedPtr< StripLayer > StripLayerPtr
GeoModel::TransientConstSharedPtr< RadialStripDesign > RadialStripDesignPtr