LayerBuilder interface method - returning Endcap-like layers.
93 ATH_MSG_DEBUG(
"calling HGTD_LayerBuilderCond::discLayers()" );
97 ATH_MSG_ERROR(
"HGTD Detector Manager or ID Helper could not be retrieved - giving up.");
103 if(*readHandle ==
nullptr){
115 for (; hgtdDetIter != readCdo->end(); ++hgtdDetIter){
116 Identifier currentId((*hgtdDetIter)->identify());
125 ATH_MSG_DEBUG(
"Configured to build " << nlayers <<
" *2 disc-like layers (+ additional support layers)." );
128 std::vector<float> discZpos(2*nlayers,0.);
129 std::vector< std::vector<Trk::SurfaceOrderPosition> > discSurfaces(2*nlayers, std::vector<Trk::SurfaceOrderPosition>());
132 int sumCheckhgtdModules = 0;
133 unsigned int currentlayer = 0;
138 hgtdDetIter = readCdo->begin();
139 for (; hgtdDetIter != readCdo->end(); ++hgtdDetIter){
142 if ( (*hgtdDetIter) ) {
144 Identifier currentId((*hgtdDetIter)->identify());
155 float currentZ = (*hgtdDetIter)->center().z();
159 currentlayer += currentZ > 0. ? nlayers : 0;
164 discZpos[currentlayer] = currentZ;
167 float currentRmin = (*hgtdDetIter)->rMin();
168 float currentRmax = (*hgtdDetIter)->rMax();
169 ATH_MSG_DEBUG(
" ---- rmin/rmax: " << currentRmin <<
"/" << currentRmax );
170 if (maxRmax<currentRmax)
171 maxRmax = currentRmax;
172 if (minRmin>currentRmin)
173 minRmin = currentRmin;
177 const Amg::Vector3D& orderPosition = (*hgtdDetIter)->center();
194 std::shared_ptr<Trk::Surface> sharedSurface(mutableSurace,[](
Trk::Surface*) {});
198 discSurfaces[currentlayer].push_back(surfaceOrder);
200 }
else if (!(*hgtdDetIter))
201 ATH_MSG_WARNING(
"Not valid pointer to HGTD Detector element... something wrong with the Id dictionary?");
209 auto discLayers = std::make_unique<std::vector<Trk::DiscLayer*> >();
214 for (
auto& thisDiscZpos : discZpos) {
219 ATH_MSG_DEBUG(
" -> With Rmin/Rmax (est) : " << minRmin <<
" / " << maxRmax );
223 std::vector<float> rBins = {minRmin};
224 std::vector<std::vector<float>> phiBins = {{}};
231 auto subBinUtilitiesPhi = std::vector<Trk::BinUtility>();
234 for (
unsigned int bin = 0;
bin < rBins.size()-1;
bin++) {
236 subBinUtilitiesPhi.push_back(BinUtilityY);
241 auto currentBinnedArray =
242 std::make_unique<Trk::BinnedArray1D1D<Trk::Surface>>(
243 discSurfaces[discCounter], BinUtilityR, subBinUtilitiesPhi);
247 int discSurfacesNum = (discSurfaces[discCounter]).
size();
249 ATH_MSG_DEBUG(
"Constructed BinnedArray for DiscLayer with "<< discSurfacesNum <<
" SubSurfaces." );
256 std::map< const Trk::Surface*,Amg::Vector3D > uniqueSurfaceMap;
259 std::span<Trk::Surface * const> arraySurfaces = currentBinnedArray->arrayObjects();
260 size_t dsumCheckSurfaces = 0;
262 for (
const auto & asurfIter : arraySurfaces){
265 usmIter = uniqueSurfaceMap.find(asurfIter);
266 lastPhi = asurfIter->center().phi();
267 if (usmIter != uniqueSurfaceMap.end()) {
269 << asurfIter->center().eta() <<
" / "
270 << asurfIter->center().phi());
272 uniqueSurfaceMap[asurfIter] = asurfIter->center();
276 "valid phi value was = "
277 << lastPhi <<
" --> discCounter: " << discCounter);
280 sumCheckhgtdModules += dsumCheckSurfaces;
290 auto activeLayerBounds = std::make_shared<Trk::DiscBounds>(minRmin, maxRmax);
292 auto olDescriptor = std::make_unique<HGTD_OverlapDescriptor>(
293 currentBinnedArray.get(), rBins, phiBins);
296 std::span<Trk::Surface * const> layerSurfaces = currentBinnedArray->arrayObjects();
301 std::move(currentBinnedArray),
304 std::move(olDescriptor));
313 ATH_MSG_DEBUG( hgtdModules <<
" HGTD Modules parsed for Disc Layer dimensions." );
315 ATH_MSG_DEBUG( sumCheckhgtdModules <<
" HGTD Modules filled in Disc Layer Arrays." );
316 if ( hgtdModules-sumCheckhgtdModules )
317 ATH_MSG_WARNING( hgtdModules-sumCheckhgtdModules <<
" Modules not registered properly in binned array." );