52 if( !cabling.range( id_range ) ) {
53 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << cabling.key());
59 if( !manager.range( id_range ) ) {
60 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << manager.key());
69 if( !conditions.
range( id_range ) ) {
73 conditions_ptr = conditions.
cptr();
82 std::unique_ptr<RegSelSiLUT> lut = std::make_unique<RegSelSiLUT>();
85 IdContext ModuleContext = helper->module_context();
87 std::vector<Identifier>::const_iterator itr = helper->module_begin();
88 std::vector<Identifier>::const_iterator idlast = helper->module_end();
90 for ( ; itr!=idlast; ++itr ) {
95 helper->get_hash(Id, Idhash, &ModuleContext);
98 if (helper->get_expanded_id( Id, exp_id, &ModuleContext)) {
99 ATH_MSG_DEBUG(
"Failed retrieving ExpandedIdentifier for PRD Identifier = " << Id.
getString() <<
". Skipping to the next PRD.");
102 if (conditions_ptr && !conditions_ptr->
isGood(Id)) {
106 int detid = ( exp_id[2]<0 ? -1 : 1 );
107 int layerid = exp_id[1]+1;
111 if (mdt1 ==
nullptr) {
115 Identifier Id2 = helper->channelID(Id, 2, 1, 1);
129 Idv[0] = helper->channelID(Id, 1, 1, 1);
130 Idv[1] = helper->channelID(Id, 1, 1, ntubesl1);
131 Idv[2] = helper->channelID(Id, 2, ntlay, 1);
132 Idv[3] = helper->channelID(Id, 2, ntlay, ntubesl2);
137 double rmin = 99999999.;
138 double rmax = -99999999.;
139 double zmin = 99999999.;
140 double zmax = -99999999.;
141 double emin = 99999999.;
142 double emax = -99999999.;
143 double phimin = 999999.;
144 double phimax = -999999.;
147 Identifier Idsl = helper->channelID(Id, 1, 2, 1);
152 zpos21 = (mdt1->
tubePos(Idsl)).perp()-(mdt1->
tubePos(Idv[0])).perp();
158 for (
int i=0; i<4; i++) {
162 if ( i<2 ) mdt = mdt1;
164 if (mdt ==
nullptr) {
167 Idv[2] = helper->channelID(Id, 1, ntlay, 1);
168 mdt = manager->getMdtReadoutElement(Idv[2]);
171 Idv[3] = helper->channelID(Id, 1, ntlay, ntubesl1);
172 mdt = manager->getMdtReadoutElement(Idv[3]);
186 double scaleMin = (mdtPos.perp()-tubePitch/2.)/mdtPos.perp();
187 double scalePlus = (mdtPos.perp()+tubePitch/2.)/mdtPos.perp();
194 mdtPos1[2] = mdtPos.z()-tubePitch/2.;
195 mdtPos2[2] = mdtPos.z()+tubePitch/2.;
200 mdtPos2[2] = mdtPos2.z()+tubePitch/2.;
202 else if (zpos21 < -1.) {
204 mdtPos1[2] = mdtPos1.z()-tubePitch/2.;
208 mdtPos1[0] *= scaleMin;
209 mdtPos1[1] *= scaleMin;
210 mdtPos2[0] *= scaleMin;
211 mdtPos2[1] *= scaleMin;
216 mdtPos1[0] *= scalePlus;
217 mdtPos1[1] *= scalePlus;
218 mdtPos2[0] *= scalePlus;
219 mdtPos2[1] *= scalePlus;
227 mdtPos1[0] *= scaleMin;
228 mdtPos1[1] *= scaleMin;
229 mdtPos2[0] *= scalePlus;
230 mdtPos2[1] *= scalePlus;
235 scalePlus = (mdtPos2.perp()+tubePitch/2.)/mdtPos2.perp();
236 mdtPos2[0] *= scalePlus;
237 mdtPos2[1] *= scalePlus;
240 else if (zpos21 < -1.) {
241 scaleMin = (mdtPos1.perp()-tubePitch/2.)/mdtPos1.perp();
242 mdtPos1[0] *= scaleMin;
243 mdtPos1[1] *= scaleMin;
250 mdtPos1[2] = mdtPos.z()-tubePitch/2.;
251 mdtPos2[2] = mdtPos.z()-tubePitch/2.;
256 mdtPos1[2] = mdtPos.z()+tubePitch/2.;
257 mdtPos2[2] = mdtPos.z()+tubePitch/2.;
264 mdtPos1[2] = mdtPos.z()+tubePitch/2.;
265 mdtPos2[2] = mdtPos.z()+tubePitch/2.;
270 mdtPos1[2] = mdtPos.z()-tubePitch/2.;
271 mdtPos2[2] = mdtPos.z()-tubePitch/2.;
285 eminMod = mdtPos1.eta();
286 emaxMod = mdtPos2.eta();
288 zminMod = mdtPos1.z();
289 zmaxMod = mdtPos2.z();
291 rminMod = mdtPos1.perp();
292 rmaxMod = mdtPos2.perp();
294 dphi = atan2(mdt->
getSsize()/2., (mdtPos.perp()-tubePitch/2.));
298 eminMod = mdtPos2.eta();
299 emaxMod = mdtPos1.eta();
301 zminMod = mdtPos2.z();
302 zmaxMod = mdtPos1.z();
304 rminMod = mdtPos1.perp();
305 rmaxMod = mdtPos2.perp();
308 eminMod = mdtPos1.eta();
309 emaxMod = mdtPos2.eta();
311 zminMod = mdtPos1.z();
312 zmaxMod = mdtPos2.z();
314 rminMod = mdtPos1.perp();
315 rmaxMod = mdtPos2.perp();
318 dphi = atan2(mdt->
tubeLength(Idv[i])/2., (mdtPos.perp()-tubePitch/2.));
321 double pminMod = mdtPos.phi() - dphi;
322 double pmaxMod = mdtPos.phi() + dphi;
324 if (zminMod < zmin) {
328 if (zmaxMod > zmax) {
332 if (pminMod < phimin) phimin = pminMod;
333 if (pmaxMod > phimax) phimax = pmaxMod;
334 if (eminMod < emin) emin = eminMod;
335 if (emaxMod > emax) emax = emaxMod;
336 if (rminMod < rmin) rmin = rminMod;
337 if (rmaxMod > rmax) rmax = rmaxMod;
343 if (phimin<0) phimin = phimin + 2*
M_PI;
344 if (phimax<0) phimax = phimax + 2*
M_PI;
350 if ( mdt1->
sideA() ) detid = 1;
351 else if ( mdt1->
sideC() ) detid = -1;
354 if ( mdt1->
sideA() ) detid = 2;
355 else if ( mdt1->
sideC() ) detid = -2;
367 uint32_t RobId = cabling->getROBId(Idhash, msgStream());
369 RegSelModule m( zmin, zmax, rmin, rmax, phimin, phimax, layerid, detid, RobId, Idhash );
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...