50 if( !manager.range( id_range ) ) {
51 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << manager.key());
63 std::vector<Identifier>::const_iterator idfirst = helper->module_begin();
64 std::vector<Identifier>::const_iterator idlast = helper->module_end();
66 const IdContext ModuleContext = helper->module_context();
70 std::unique_ptr<RegSelSiLUT> lut = std::make_unique<RegSelSiLUT>();
74 for ( std::vector<Identifier>::const_iterator itr=idfirst ; itr!=idlast ; ++itr ) {
78 helper->get_hash(Id, Idhash, &ModuleContext);
81 if (helper->get_expanded_id( Id, exp_id, &ModuleContext)) {
82 ATH_MSG_DEBUG(
"Failed retrieving ExpandedIdentifier for PRD Identifier = " << Id.
getString() <<
". Skipping to the next PRD.");
86 int detid = ( exp_id[2]<0 ? -1 : 1 );
87 int layerid = exp_id[1]+1;
98 Id2ndLayer = helper->parentID(Id);
99 Id2ndLayer = helper->channelID(Id2ndLayer, chamberLayer, 1, 0, 1);
100 csc = manager->getCscReadoutElement(Id2ndLayer);
108 double eta_min = 99999999.;
109 double eta_max = -99999999.;
110 double phi_min = 999999.;
111 double phi_max = -999999.;
113 double zmin = 999999999;
114 double zmax = -999999999;
119 double phi_test = 0.;
127 int chlayer_inc = helper->chamberLayerMax(Id)-1;
128 if ( chlayer_inc<1 ) chlayer_inc = 1;
129 for (
int chlayer=1 ; chlayer<=helper->chamberLayerMax(Id) ; chlayer+=chlayer_inc ) {
132 int wlayer_inc = helper->wireLayerMax(Id)-1;
133 if ( wlayer_inc<1 ) wlayer_inc = 1;
134 for (
int wlayer=1 ; wlayer<=helper->wireLayerMax(Id) ; wlayer+=wlayer_inc ){
136 for (
int phis=1 ; phis<=csc->
NphiStrips(wlayer) ; phis++ ) {
139 Identifier phis_id = helper->channelID(Id, chlayer, wlayer, 1, phis);
150 phis_x1[2] = phis_x.z()-phis_lenght/2.0;
151 phis_x2[2] = phis_x.z()+phis_lenght/2.0;
156 phi_test=gphis_x1.phi();
159 if(exp_id[1]!=51 || exp_id[3]!=1)
if (phi_test < 0) phi_test += 2.*
M_PI;
162 if ( zmin>gphis_x1.z() ) zmin = gphis_x1.z();
163 if ( zmax<gphis_x1.z() ) zmax = gphis_x1.z();
165 if ( rmin==0 || rmin>gphis_x1.perp() ) rmin = gphis_x1.perp();
166 if ( rmax==0 || rmax<gphis_x1.perp() ) rmax = gphis_x1.perp();
168 if ( zmin>gphis_x2.z() ) zmin = gphis_x2.z();
169 if ( zmax<gphis_x2.z() ) zmax = gphis_x2.z();
171 if ( rmin==0 || rmin>gphis_x2.perp() ) rmin = gphis_x2.perp();
172 if ( rmax==0 || rmax<gphis_x2.perp() ) rmax = gphis_x2.perp();
179 if ( rmin==0 || rmin>gphis_x.perp() ) rmin = gphis_x.perp();
180 if ( rmax==0 || rmax<gphis_x.perp() ) rmax = gphis_x.perp();
183 if(phi_test > phi_max){
187 if(phi_test < phi_min){
192 if(gphis_x1.eta() > eta_max) {
194 eta_max=gphis_x1.eta();
196 if(gphis_x1.eta() < eta_min) {
198 eta_min=gphis_x1.eta();
201 phi_test=gphis_x2.phi();
204 if(exp_id[1]!=51 || exp_id[3]!=1)
if (phi_test < 0) phi_test += 2.*
M_PI;
207 if(phi_test > phi_max) {
211 if(phi_test < phi_min) {
216 if(gphis_x2.eta() > eta_max) {
218 eta_max=gphis_x2.eta();
220 if(gphis_x2.eta() < eta_min) {
222 eta_min=gphis_x2.eta();
230 if ( eta_inc<1 ) eta_inc = 1;
231 for (
int etas=1 ; etas<=csc->
NetaStrips(wlayer) ; etas+=eta_inc ) {
234 Identifier etas_id = helper->channelID(Id, chlayer, wlayer, 0, etas);
245 etas_x1[1] = etas_x.y()-etas_lenght/2.0;
246 etas_x2[1] = etas_x.y()+etas_lenght/2.0;
251 if ( zmin>getas_x1.z() ) zmin = getas_x1.z();
252 if ( zmax<getas_x1.z() ) zmax = getas_x1.z();
254 if ( zmin>getas_x2.z() ) zmin = getas_x2.z();
255 if ( zmax<getas_x2.z() ) zmax = getas_x2.z();
257 if ( rmin==0 || rmin>getas_x1.perp() ) rmin = getas_x1.perp();
258 if ( rmax==0 || rmax<getas_x1.perp() ) rmax = getas_x1.perp();
260 if ( rmin==0 || rmin>getas_x2.perp() ) rmin = getas_x2.perp();
261 if ( rmax==0 || rmax<getas_x2.perp() ) rmax = getas_x2.perp();
267 if ( rmin==0 || rmin>getas_x.perp() ) rmin = getas_x.perp();
268 if ( rmax==0 || rmax<getas_x.perp() ) rmax = getas_x.perp();
270 phi_test = getas_x1.phi();
273 if(exp_id[1]!=51 || exp_id[3]!=1)
if (phi_test < 0) phi_test += 2.*
M_PI;
275 if(phi_test > phi_max){
279 if(phi_test < phi_min){
284 if(getas_x1.eta() > eta_max) {
286 eta_max=getas_x1.eta();
288 if(getas_x1.eta() < eta_min) {
290 eta_min=getas_x1.eta();
293 phi_test = getas_x2.phi();
296 if (exp_id[1]!=51 || exp_id[3]!=1)
if (phi_test < 0) phi_test += 2.*
M_PI;
298 if(phi_test > phi_max){
302 if(phi_test < phi_min){
307 if(getas_x2.eta() > eta_max) {
309 eta_max=getas_x2.eta();
311 if(getas_x2.eta() < eta_min) {
313 eta_min=getas_x2.eta();
322 if(exp_id[1]==51 && exp_id[3]==1) {
323 if (phi_max < 0) phi_max += 2.*
M_PI;
324 if (phi_min < 0) phi_min += 2.*
M_PI;
327 uint16_t subDetectorId = (detid == -1) ? 0x6a : 0x69;
328 uint32_t cscrob = 0x0;
329 cabling->hash2Rob(Idhash.
value(),cscrob);
330 cscrob = ((subDetectorId << 16) | cscrob);
331 RegSelModule m( zmin, zmax, rmin, rmax, phi_min, phi_max, layerid, detid, cscrob, Idhash );
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...