CMS 3D CMS Logo

SiPixelCoordinates.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Class: SiPixelCoordinates
4 //
5 // Implementations of the class
6 //
7 // Original Author: Janos Karancsi
8 
10 
19 
20 #include <boost/range/irange.hpp>
21 
22 // _________________________________________________________
23 // Constructors, destructor
25 
27 
29 
30 // _________________________________________________________
31 // init, called in the beginning of each event
33  // Get CablingMap (used for ROC number)
34  edm::ESHandle<SiPixelFedCablingMap> cablingMapHandle;
35  iSetup.get<SiPixelFedCablingMapRcd>().get(cablingMapHandle);
36  cablingMap_ = cablingMapHandle.product();
38 
39  // Get TrackerTopology
40  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
41  iSetup.get<TrackerTopologyRcd>().get(trackerTopologyHandle);
42  tTopo_ = trackerTopologyHandle.product();
43 
44  // Get TrackerGeometry
45  edm::ESHandle<TrackerGeometry> trackerGeometryHandle;
46  iSetup.get<TrackerDigiGeometryRecord>().get(trackerGeometryHandle);
47  tGeom_ = trackerGeometryHandle.product();
48 
49  // If not specified, determine from the geometry
50  if (phase_ == -1) {
52  phase_ = 0;
54  phase_ = 1;
56  phase_ = 2;
57  }
58 }
59 
60 // _________________________________________________________
61 // Offline/Online variables from TrackerTopology
62 // and pixel naming classes
63 
64 // Taken from pixel naming classes
65 // BmO (-z-x) = 1, BmI (-z+x) = 2 , BpO (+z-x) = 3 , BpI (+z+x) = 4
67  if (quadrant_.count(detid.rawId()))
68  return quadrant_[detid.rawId()];
69  if (!isPixel_(detid))
70  return quadrant_[detid.rawId()] = -9999;
72  return quadrant_[detid.rawId()] = PixelBarrelName(detid, tTopo_, phase_).shell();
73  else
74  return quadrant_[detid.rawId()] = PixelEndcapName(detid, tTopo_, phase_).halfCylinder();
75 }
76 
77 // Taken from Pixel naming class for barrel
78 // and TrackerTopology for endcap
79 // BmO/BmI = 1, BpO/BpI = 2
80 int SiPixelCoordinates::side(const DetId& detid) {
81  if (side_.count(detid.rawId()))
82  return side_[detid.rawId()];
83  if (!isPixel_(detid))
84  return side_[detid.rawId()] = -9999;
86  return side_[detid.rawId()] = 1 + (quadrant(detid) > 2);
87  else
88  return side_[detid.rawId()] = tTopo_->pxfSide(detid);
89 }
90 
91 // Offline module convention taken from TrackerTopology
92 int SiPixelCoordinates::module(const DetId& detid) {
93  if (module_.count(detid.rawId()))
94  return module_[detid.rawId()];
95  if (!isPixel_(detid))
96  return module_[detid.rawId()] = -9999;
98  return module_[detid.rawId()] = tTopo_->pxbModule(detid.rawId());
99  else
100  return module_[detid.rawId()] = tTopo_->pxfModule(detid.rawId());
101 }
102 
103 // Taken from TrackerTopology
104 int SiPixelCoordinates::layer(const DetId& detid) {
105  if (layer_.count(detid.rawId()))
106  return layer_[detid.rawId()];
107  if (!isBPix_(detid))
108  return layer_[detid.rawId()] = -9999;
109  return layer_[detid.rawId()] = tTopo_->pxbLayer(detid);
110 }
111 
112 // Taken from pixel naming class for barrel
114  if (sector_.count(detid.rawId()))
115  return sector_[detid.rawId()];
116  if (!isBPix_(detid))
117  return sector_[detid.rawId()] = -9999;
118  return sector_[detid.rawId()] = PixelBarrelName(detid, tTopo_, phase_).sectorName();
119 }
120 
121 // Offline ladder convention taken from TrackerTopology
123  if (ladder_.count(detid.rawId()))
124  return ladder_[detid.rawId()];
125  if (!isBPix_(detid))
126  return ladder_[detid.rawId()] = -9999;
127  return ladder_[detid.rawId()] = tTopo_->pxbLadder(detid);
128 }
129 
130 // Online ladder convention taken from pixel naming class for barrel
131 // Apply sign convention (- sign for BmO and BpO)
133  if (signed_ladder_.count(detid.rawId()))
134  return signed_ladder_[detid.rawId()];
135  if (!isBPix_(detid))
136  return signed_ladder_[detid.rawId()] = -9999;
138  if (quadrant(detid) % 2)
139  signed_ladder *= -1;
140  return signed_ladder_[detid.rawId()] = signed_ladder;
141 }
142 
143 // Online mdoule convention taken from pixel naming class for barrel
144 // Apply sign convention (- sign for BmO and BmI)
146  if (signed_module_.count(detid.rawId()))
147  return signed_module_[detid.rawId()];
148  if (!isBPix_(detid))
149  return signed_module_[detid.rawId()] = -9999;
151  if (quadrant(detid) < 3)
152  signed_module *= -1;
153  return signed_module_[detid.rawId()] = signed_module;
154 }
155 
156 // Half ladders taken from pixel naming class
157 int SiPixelCoordinates::half(const DetId& detid) {
158  if (half_.count(detid.rawId()))
159  return half_[detid.rawId()];
160  if (!isBPix_(detid))
161  return half_[detid.rawId()] = -9999;
162  return half_[detid.rawId()] = PixelBarrelName(detid, tTopo_, phase_).isHalfModule();
163 }
164 
165 // Using TrackerTopology
166 // Ladders have a staggered structure
167 // Non-flipped ladders are on the outer radius
168 // Phase 0: Outer ladders are odd for layer 1,3 and even for layer 2
169 // Phase 1: Outer ladders are odd for layer 4 and even for layer 1,2,3
170 int SiPixelCoordinates::outer(const DetId& detid) {
171  if (outer_.count(detid.rawId()))
172  return outer_[detid.rawId()];
173  if (!isBPix_(detid))
174  return outer_[detid.rawId()] = -9999;
175  int outer = -9999;
176  int layer = tTopo_->pxbLayer(detid.rawId());
177  bool odd_ladder = tTopo_->pxbLadder(detid.rawId()) % 2;
178  if (phase_ == 0) {
179  if (layer == 2)
180  outer = !odd_ladder;
181  else
182  outer = odd_ladder;
183  } else if (phase_ == 1) {
184  if (layer == 4)
185  outer = odd_ladder;
186  else
187  outer = !odd_ladder;
188  }
189  return outer_[detid.rawId()] = outer;
190 }
191 
192 // Using outer() method
193 // We call ladders in the inner radius flipped (see above)
195  if (flipped_.count(detid.rawId()))
196  return flipped_[detid.rawId()];
197  if (!isBPix_(detid))
198  return flipped_[detid.rawId()] = -9999;
199  int flipped = -9999;
200  if (phase_ < 2)
201  flipped = outer(detid) == 0;
202  return flipped_[detid.rawId()] = flipped;
203 }
204 
205 // Offline disk convention taken from TrackerTopology
206 int SiPixelCoordinates::disk(const DetId& detid) {
207  if (disk_.count(detid.rawId()))
208  return disk_[detid.rawId()];
209  if (!isFPix_(detid))
210  return disk_[detid.rawId()] = -9999;
211  return disk_[detid.rawId()] = tTopo_->pxfDisk(detid);
212 }
213 
214 // Online disk convention
215 // Apply sign convention (- sign for BmO and BmI)
217  if (signed_disk_.count(detid.rawId()))
218  return signed_disk_[detid.rawId()];
219  if (!isFPix_(detid))
220  return signed_disk_[detid.rawId()] = -9999;
221  int signed_disk = disk(detid);
222  if (quadrant(detid) < 3)
223  signed_disk *= -1;
224  return signed_disk_[detid.rawId()] = signed_disk;
225 }
226 
227 // Taken from TrackerTopology
228 int SiPixelCoordinates::panel(const DetId& detid) {
229  if (panel_.count(detid.rawId()))
230  return panel_[detid.rawId()];
231  if (!isFPix_(detid))
232  return panel_[detid.rawId()] = -9999;
233  return panel_[detid.rawId()] = tTopo_->pxfPanel(detid);
234 }
235 
236 // Phase 0: Ring was not an existing convention
237 // but the 7 plaquettes were split by HV group
238 // --> Derive Ring 1/2 for them
239 // Panel 1 plq 1-2, Panel 2, plq 1 = Ring 1
240 // Panel 1 plq 3-4, Panel 2, plq 2-3 = Ring 2
241 // Phase 1: Using pixel naming class for endcap
242 int SiPixelCoordinates::ring(const DetId& detid) {
243  if (ring_.count(detid.rawId()))
244  return ring_[detid.rawId()];
245  if (!isFPix_(detid))
246  return ring_[detid.rawId()] = -9999;
247  int ring = -9999;
248  if (phase_ == 0) {
249  ring = 1 + (panel(detid) + module(detid) > 3);
250  } else if (phase_ == 1) {
251  ring = PixelEndcapName(detid, tTopo_, phase_).ringName();
252  }
253  return ring_[detid.rawId()] = ring;
254 }
255 
256 // Offline blade convention taken from TrackerTopology
257 int SiPixelCoordinates::blade(const DetId& detid) {
258  if (blade_.count(detid.rawId()))
259  return blade_[detid.rawId()];
260  if (!isFPix_(detid))
261  return blade_[detid.rawId()] = -9999;
262  return blade_[detid.rawId()] = tTopo_->pxfBlade(detid);
263 }
264 
265 // Online blade convention taken from pixel naming class for endcap
266 // Apply sign convention (- sign for BmO and BpO)
268  if (signed_blade_.count(detid.rawId()))
269  return signed_blade_[detid.rawId()];
270  if (!isFPix_(detid))
271  return signed_blade_[detid.rawId()] = -9999;
273  if (quadrant(detid) % 2)
274  signed_blade *= -1;
275  return signed_blade_[detid.rawId()] = signed_blade;
276 }
277 
278 // Get the FED number using the cabling map
279 unsigned int SiPixelCoordinates::fedid(const DetId& detid) {
280  if (fedid_.count(detid.rawId()))
281  return fedid_[detid.rawId()];
282  if (!isPixel_(detid))
283  return fedid_[detid.rawId()] = 9999;
284  unsigned int fedid = 9999;
285  for (auto& fedId : cablingMap_->fedIds()) {
287  fedid = fedId;
288  break;
289  }
290  }
291  return fedid_[detid.rawId()] = fedid;
292 }
293 
294 // _________________________________________________________
295 // Private methods
297  if (detid.det() != DetId::Tracker)
298  return false;
300  return true;
302  return true;
303  return false;
304 }
305 bool SiPixelCoordinates::isBPix_(const DetId& detid) {
306  if (detid.det() != DetId::Tracker)
307  return false;
309  return true;
310  return false;
311 }
312 bool SiPixelCoordinates::isFPix_(const DetId& detid) {
313  if (detid.det() != DetId::Tracker)
314  return false;
316  return true;
317  return false;
318 }
319 
320 std::pair<int, int> SiPixelCoordinates::pixel_(const PixelDigi* digi) {
321  return std::make_pair(digi->row(), digi->column());
322 }
323 std::pair<int, int> SiPixelCoordinates::pixel_(const SiPixelCluster* cluster) {
324  // Cluster positions are already shifted by 0.5
325  // We remove this and add back later (for all pixels)
326  // The aim is to get the offline row/col number of the pixel
327  int row = cluster->x() - 0.5, col = cluster->y() - 0.5;
328  return std::make_pair(row, col);
329 }
330 std::pair<int, int> SiPixelCoordinates::pixel_(const SiPixelRecHit* rechit) {
331  // Convert RecHit local position to local pixel using Topology
332  const PixelGeomDetUnit* detUnit = static_cast<const PixelGeomDetUnit*>(rechit->detUnit());
333  const PixelTopology* topo = static_cast<const PixelTopology*>(&detUnit->specificTopology());
334  std::pair<float, float> pixel = topo->pixel(rechit->localPosition());
335  // We could leave it like this, but it's better to constrain pixel to be on the module
336  // Also truncate floating point to int (similar to digis)
337  int row = std::max(0, std::min(topo->nrows() - 1, (int)pixel.first));
338  int col = std::max(0, std::min(topo->ncolumns() - 1, (int)pixel.second));
339  return std::make_pair(row, col);
340 }
341 
342 float SiPixelCoordinates::xcoord_on_module_(const DetId& detid, const std::pair<int, int>& pixel) {
343  int nrows = 160;
344  // Leave it hard-coded for phase 0/1, read from geometry for phase 2
345  // no special treatment needed here for phase 0 1x8, 1x5 and 1x2 modules either
346  // because we do not want to scale coordinates (only shift if needed)
347  if (phase_ == 2) {
348  const PixelGeomDetUnit* detUnit = static_cast<const PixelGeomDetUnit*>(tGeom_->idToDetUnit(detid));
349  const PixelTopology* topo = static_cast<const PixelTopology*>(&detUnit->specificTopology());
350  nrows = topo->nrows();
351  }
352  // Shift to the middle of the pixel, for precision binning
353  return (pixel.first + 0.5) / nrows;
354 }
355 
356 float SiPixelCoordinates::ycoord_on_module_(const DetId& detid, const std::pair<int, int>& pixel) {
357  int ncols = 416;
358  // Leave it hard-coded for phase 0/1, read from geometry for phase 2
359  if (phase_ == 2) {
360  const PixelGeomDetUnit* detUnit = static_cast<const PixelGeomDetUnit*>(tGeom_->idToDetUnit(detid));
361  const PixelTopology* topo = static_cast<const PixelTopology*>(&detUnit->specificTopology());
362  ncols = topo->ncolumns();
363  } else if (phase_ == 0 && isFPix_(detid)) {
364  // Always use largest length for Phase 0 FPix modules (1x5 and 2x5)
365  // because we do not want to scale coordinates so ROC size remains fixed
366  // and only shifts are needed
367  ncols = 260;
368  }
369  // Shift to the middle of the pixel, for precision binning
370  return (pixel.second + 0.5) / ncols;
371 }
372 
373 // _________________________________________________________
374 // Online Link and ROC number
375 
376 // Get the FED channel (link) number
377 // Link may depend on the TBM side of the module
378 // so pixel location is needed
379 // Using the cabling map works for all detectors
380 // Taken from DQM/SiPixelMonitorClient/src/SiPixelInformationExtractor.cc
381 int SiPixelCoordinates::channel(const DetId& detid, const std::pair<int, int>& pixel) {
382  if (!isPixel_(detid))
383  return -9999;
384  // The method below may be slow when looping on a lot of pixels, so let's try to speed it up
385  // by quickly chategorizing pixels to ROC coordinates inside det units
386  int rowsperroc = 80, colsperroc = 52;
387  if (phase_ == 2) {
388  // Can get roc info from Geometry for Phase 2, this will need to be specified when it's final
389  const PixelGeomDetUnit* detUnit = static_cast<const PixelGeomDetUnit*>(tGeom_->idToDetUnit(detid));
390  const PixelTopology* topo = static_cast<const PixelTopology*>(&detUnit->specificTopology());
391  rowsperroc = topo->rowsperroc();
392  colsperroc = topo->colsperroc();
393  }
394  // It is unlikely a ROC would have more than 256 chips, so let's use this formula
395  // If a ROC number was ever found, then binary search in a map will be much quicker
396  uint64_t pseudo_roc_num =
397  uint64_t(1 << 16) * detid.rawId() + (1 << 8) * (pixel.first / rowsperroc) + pixel.second / colsperroc;
398  if (channel_.count(pseudo_roc_num))
399  return channel_[pseudo_roc_num];
400  // If not found previously, get the channel number
401  unsigned int fedId = fedid(detid);
403  sipixelobjects::DetectorIndex detector = {detid.rawId(), pixel.first, pixel.second};
405  converter.toCabling(cabling, detector);
406  // Time consuming part is over, so let's save the roc number too
407  const sipixelobjects::PixelROC* theRoc = converter.toRoc(cabling.link, cabling.roc);
408  int roc = theRoc->idInDetUnit();
409  if (detid.subdetId() == PixelSubdetector::PixelBarrel && side(detid) == 1 && half(detid))
410  roc += 8;
411  roc_[pseudo_roc_num] = roc;
412  //printf ("Online FED, LNK, LNKID, ROC: %2d %2d %2d %2d - Offline RAWID, ROW, COL: %9d [%3d,%3d] [%3d,%3d]\n",
413  // fedId, cabling.link, cabling.roc, roc, detid.rawId(),
414  // (pixel.first /rowsperroc)*rowsperroc, (pixel.first /rowsperroc+1)*rowsperroc-1,
415  // (pixel.second/colsperroc)*colsperroc, (pixel.second/colsperroc+1)*colsperroc-1);
416  return channel_[pseudo_roc_num] = cabling.link;
417 }
418 int SiPixelCoordinates::channel(const DetId& detid, const PixelDigi* digi) {
419  if (!isPixel_(detid))
420  return -9999;
421  return channel(detid, pixel_(digi));
422 }
423 int SiPixelCoordinates::channel(const DetId& detid, const SiPixelCluster* cluster) {
424  if (!isPixel_(detid))
425  return -9999;
426  return channel(detid, pixel_(cluster));
427 }
429  if (!isPixel_(rechit->geographicalId()))
430  return -9999;
431  return channel(rechit->geographicalId(), pixel_(rechit));
432 }
434  if (!isPixel_(rechit->geographicalId()))
435  return -9999;
436  return channel(static_cast<const SiPixelRecHit*>(rechit->hit()));
437 }
438 
439 // Using the cabling map works for all detectors
440 // Taken from DQM/SiPixelMonitorClient/src/SiPixelInformationExtractor.cc
441 // Although using coordinates (only available for Phase 0/1) is much faster
442 // The advantage is very visible when running on smaller statistics
443 // because the map will speed it up greatly after high enough ROCs were sampled
444 // The coordinate method is validated to give the same result as the cabling map
445 // Example for the barrel:
446 // ROC number is read out in a U shape from ROC 0 to 15 (or maxroc)
447 // row [80-159] col [0-51] is always ROC 0 on the +Z side of the barrel
448 // Both coordinates are mirrored on the -Z side (180 deg rotation effectively)
449 // -Z 8 9 10 11 12 13 14 15 +Z 0 1 2 3 4 5 6 7
450 // (0,0) 7 6 5 4 3 2 1 0 (0,0) 15 14 13 12 11 10 9 8
451 // Half modules on the -Z side should consider the second row of ROCs instead, etc. see below
452 int SiPixelCoordinates::roc(const DetId& detid, const std::pair<int, int>& pixel) {
453  if (!isPixel_(detid))
454  return -9999;
455  // The method below may be slow when looping on a lot of pixels, so let's try to speed it up
456  // by quickly chategorizing pixels to ROC coordinates inside det units
457  int rowsperroc = 80, colsperroc = 52;
458  if (phase_ == 2) {
459  // Can get roc info from Geometry for Phase 2, this will need to be specified when it's final
460  const PixelGeomDetUnit* detUnit = static_cast<const PixelGeomDetUnit*>(tGeom_->idToDetUnit(detid));
461  const PixelTopology* topo = static_cast<const PixelTopology*>(&detUnit->specificTopology());
462  rowsperroc = topo->rowsperroc();
463  colsperroc = topo->colsperroc();
464  }
465  // It is unlikely a ROC would have more than 256 chips, so let's use this formula
466  // If a ROC number was ever found, then binary search in a map will be much quicker
467  uint64_t pseudo_roc_num =
468  uint64_t(1 << 16) * detid.rawId() + (1 << 8) * (pixel.first / rowsperroc) + pixel.second / colsperroc;
469  if (roc_.count(pseudo_roc_num))
470  return roc_[pseudo_roc_num];
471  // If not found previously, get the ROC number
472  int roc = -9999;
473  // Use the Fed Cabling Map if specified by the bool
474  // or if using channel number too, or if it's the Phase 2 detector
475  if (phase_ == 2 || !channel_.empty()) {
476  unsigned int fedId = fedid(detid);
478  sipixelobjects::DetectorIndex detector = {detid.rawId(), pixel.first, pixel.second};
480  converter.toCabling(cabling, detector);
481  // Time consuming part is over, so let's save the channel number too
482  channel_[pseudo_roc_num] = cabling.link;
483  const sipixelobjects::PixelROC* theRoc = converter.toRoc(cabling.link, cabling.roc);
484  roc = theRoc->idInDetUnit();
485  if (detid.subdetId() == PixelSubdetector::PixelBarrel && side(detid) == 1 && half(detid))
486  roc += 8;
487  //printf ("Online FED, LNK, LNKID, ROC: %2d %2d %2d %2d - Offline RAWID, ROW, COL: %9d [%3d,%3d] [%3d,%3d]\n",
488  // fedId, cabling.link, cabling.roc, roc, detid.rawId(),
489  // (pixel.first /rowsperroc)*rowsperroc, (pixel.first /rowsperroc+1)*rowsperroc-1,
490  // (pixel.second/colsperroc)*colsperroc, (pixel.second/colsperroc+1)*colsperroc-1);
491  } else if (phase_ < 2) {
492  // This method is faster if only ROC number is needed
493  int pan = panel(detid), mod = module(detid), rocsY = 8;
494  if (phase_ == 0 && detid.subdetId() == PixelSubdetector::PixelEndcap)
495  rocsY = pan + mod;
496  int rocX = pixel.first / rowsperroc, rocY = pixel.second / colsperroc;
497  // Consider second row for all 1xN Phase 0 modules
498  if (phase_ == 0) {
499  int v1x8 = half(detid) == 1, v1x2 = (pan == 1 && mod == 1), v1x5 = (pan == 1 && mod == 4);
500  if (v1x8 || v1x2 || v1x5)
501  ++rocX;
502  }
503  // Mirror both coordinates for barrel -Z side
504  // and for endcap (but only Panel 2 for Phase 0)
505  if ((detid.subdetId() == PixelSubdetector::PixelBarrel && side(detid) == 1) ||
506  (detid.subdetId() == PixelSubdetector::PixelEndcap && ((phase_ == 0 && pan == 2) || phase_ == 1))) {
507  rocX = 1 - rocX;
508  rocY = rocsY - 1 - rocY;
509  }
510  // U-shape readout order
511  roc = rocX ? rocY : 2 * rocsY - 1 - rocY;
512  }
513  return roc_[pseudo_roc_num] = roc;
514 }
515 int SiPixelCoordinates::roc(const DetId& detid, const PixelDigi* digi) {
516  if (!isPixel_(detid))
517  return -9999;
518  return roc(detid, pixel_(digi));
519 }
520 int SiPixelCoordinates::roc(const DetId& detid, const SiPixelCluster* cluster) {
521  if (!isPixel_(detid))
522  return -9999;
523  return roc(detid, pixel_(cluster));
524 }
526  if (!isPixel_(rechit->geographicalId()))
527  return -9999;
528  return roc(rechit->geographicalId(), pixel_(rechit));
529 }
531  if (!isPixel_(rechit->geographicalId()))
532  return -9999;
533  return roc(static_cast<const SiPixelRecHit*>(rechit->hit()));
534 }
535 
536 // _________________________________________________________
537 // Floating point Pixel Coordinates similar to those
538 // given by TrackerTopology and naming classes
539 // but we add a shift within ]-0.5,+0.5[
540 // eg. std::round(coord) gives back the original int
541 float SiPixelCoordinates::module_coord(const DetId& detid, const std::pair<int, int>& pixel) {
542  if (!isBPix_(detid))
543  return -9999;
544  // offline module number is monotonously increasing with global z
545  // sign is negative because local y is antiparallel to global z
546  return module(detid) - (ycoord_on_module_(detid, pixel) - 0.5);
547 }
548 float SiPixelCoordinates::module_coord(const DetId& detid, const PixelDigi* digi) {
549  if (!isBPix_(detid))
550  return -9999;
551  return module_coord(detid, pixel_(digi));
552 }
553 float SiPixelCoordinates::module_coord(const DetId& detid, const SiPixelCluster* cluster) {
554  if (!isBPix_(detid))
555  return -9999;
556  return module_coord(detid, pixel_(cluster));
557 }
559  if (!isBPix_(rechit->geographicalId()))
560  return -9999;
561  return module_coord(rechit->geographicalId(), pixel_(rechit));
562 }
564  if (!isBPix_(rechit->geographicalId()))
565  return -9999;
566  return module_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
567 }
568 
569 float SiPixelCoordinates::signed_module_coord(const DetId& detid, const std::pair<int, int>& pixel) {
570  if (!isBPix_(detid))
571  return -9999;
572  // offline module number is monotonously increasing with global z
573  // sign is negative because local y is antiparallel to global z
574  return signed_module(detid) - (ycoord_on_module_(detid, pixel) - 0.5);
575 }
576 float SiPixelCoordinates::signed_module_coord(const DetId& detid, const PixelDigi* digi) {
577  if (!isBPix_(detid))
578  return -9999;
579  return signed_module_coord(detid, pixel_(digi));
580 }
581 float SiPixelCoordinates::signed_module_coord(const DetId& detid, const SiPixelCluster* cluster) {
582  if (!isBPix_(detid))
583  return -9999;
584  return signed_module_coord(detid, pixel_(cluster));
585 }
587  if (!isBPix_(rechit->geographicalId()))
588  return -9999;
589  return signed_module_coord(rechit->geographicalId(), pixel_(rechit));
590 }
592  if (!isBPix_(rechit->geographicalId()))
593  return -9999;
594  return signed_module_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
595 }
596 
597 float SiPixelCoordinates::ladder_coord(const DetId& detid, const std::pair<int, int>& pixel) {
598  if (!isBPix_(detid))
599  return -9999;
600  // offline ladder number is monotonously increasing with global phi
601  // flipped/inner ladders: lx parallel to global r-phi - positive sign
602  // non-flipped/outer ladders: lx anti-parallel to global r-phi - negative sign
603  int sign = flipped(detid) ? 1 : -1;
604  return ladder(detid) + sign * (xcoord_on_module_(detid, pixel) + half(detid) * 0.5 - 0.5);
605 }
606 float SiPixelCoordinates::ladder_coord(const DetId& detid, const PixelDigi* digi) {
607  if (!isBPix_(detid))
608  return -9999;
609  return ladder_coord(detid, pixel_(digi));
610 }
611 float SiPixelCoordinates::ladder_coord(const DetId& detid, const SiPixelCluster* cluster) {
612  if (!isBPix_(detid))
613  return -9999;
614  return ladder_coord(detid, pixel_(cluster));
615 }
617  if (!isBPix_(rechit->geographicalId()))
618  return -9999;
619  return ladder_coord(rechit->geographicalId(), pixel_(rechit));
620 }
622  if (!isBPix_(rechit->geographicalId()))
623  return -9999;
624  return ladder_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
625 }
626 
627 float SiPixelCoordinates::signed_ladder_coord(const DetId& detid, const std::pair<int, int>& pixel) {
628  if (!isBPix_(detid))
629  return -9999;
630  // online ladder number is monotonously decreasing with global phi
631  // flipped/inner ladders: lx parallel to global r-phi - negative sign
632  // non-flipped/outer ladders: lx anti-parallel to global r-phi - positive sign
633  int sign = flipped(detid) ? -1 : 1;
634  return signed_ladder(detid) + sign * (xcoord_on_module_(detid, pixel) + half(detid) * 0.5 - 0.5);
635 }
636 float SiPixelCoordinates::signed_ladder_coord(const DetId& detid, const PixelDigi* digi) {
637  if (!isBPix_(detid))
638  return -9999;
639  return signed_ladder_coord(detid, pixel_(digi));
640 }
641 float SiPixelCoordinates::signed_ladder_coord(const DetId& detid, const SiPixelCluster* cluster) {
642  if (!isBPix_(detid))
643  return -9999;
644  return signed_ladder_coord(detid, pixel_(cluster));
645 }
647  if (!isBPix_(rechit->geographicalId()))
648  return -9999;
649  return signed_ladder_coord(rechit->geographicalId(), pixel_(rechit));
650 }
652  if (!isBPix_(rechit->geographicalId()))
653  return -9999;
654  return signed_ladder_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
655 }
656 
657 // Rings are defined in the radial direction
658 // which is local x for phase 0 and local y for phase 1
659 // Rings were not defined for phase 0, but we had a similar
660 // convention, HV group, the 7 plaquettes were split like this
661 // Panel 1 plq 1-2, Panel 2, plq 1 = Ring 1 (HV grp 1)
662 // Panel 1 plq 3-4, Panel 2, plq 2-3 = Ring 2 (HV grp 2)
663 // A subdivision of 8 is suggested for both phase 0 and 1
664 float SiPixelCoordinates::ring_coord(const DetId& detid, const std::pair<int, int>& pixel) {
665  if (!isFPix_(detid))
666  return -9999;
667  float ring_coord = ring(detid), coord_shift = 0;
668  if (phase_ == 0) {
669  // local x on panel 1 is anti-parallel to global radius - sign is negative
670  // and parallel for panel 2 - sign is positive
671  int pan = panel(detid), mod = module(detid);
672  if (pan == 1) {
673  if (mod == 1)
674  coord_shift = (-xcoord_on_module_(detid, pixel)) / 4;
675  else if (mod == 2)
676  coord_shift = (-xcoord_on_module_(detid, pixel) + 2.0) / 4;
677  else if (mod == 3)
678  coord_shift = (-xcoord_on_module_(detid, pixel)) / 4;
679  else if (mod == 4)
680  coord_shift = (-xcoord_on_module_(detid, pixel) + 1.5) / 4;
681  } else {
682  if (mod == 1)
683  coord_shift = (xcoord_on_module_(detid, pixel)) / 4;
684  else if (mod == 2)
685  coord_shift = (xcoord_on_module_(detid, pixel) - 2.0) / 4;
686  else if (mod == 3)
687  coord_shift = (xcoord_on_module_(detid, pixel)) / 4;
688  }
689  } else if (phase_ == 1) {
690  // local y is parallel to global radius, so sign is positive
691  coord_shift = ycoord_on_module_(detid, pixel) - 0.5;
692  }
693  ring_coord += coord_shift;
694  return ring_coord;
695 }
696 float SiPixelCoordinates::ring_coord(const DetId& detid, const PixelDigi* digi) {
697  if (!isFPix_(detid))
698  return -9999;
699  return ring_coord(detid, pixel_(digi));
700 }
701 float SiPixelCoordinates::ring_coord(const DetId& detid, const SiPixelCluster* cluster) {
702  if (!isFPix_(detid))
703  return -9999;
704  return ring_coord(detid, pixel_(cluster));
705 }
707  if (!isFPix_(rechit->geographicalId()))
708  return -9999;
709  return ring_coord(rechit->geographicalId(), pixel_(rechit));
710 }
712  if (!isFPix_(rechit->geographicalId()))
713  return -9999;
714  return ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
715 }
716 
717 // Treat disk number as it is (parallel to global z)
718 // Subdivisions on the forward can be the radial direction
719 // Which is local x for phase 0 and local y for phase 1
720 // Closest radius is chosen to be closest to disk = 0
721 // Rings are not separated, 8 subdivisions are suggested
722 // Plot suitable for separate ring plots
723 float SiPixelCoordinates::disk_coord(const DetId& detid, const std::pair<int, int>& pixel) {
724  if (!isFPix_(detid))
725  return -9999;
726  float disk_coord = disk(detid), coord_shift = ring_coord(detid, pixel) - ring(detid);
727  disk_coord += coord_shift;
728  return disk_coord;
729 }
730 float SiPixelCoordinates::disk_coord(const DetId& detid, const PixelDigi* digi) {
731  if (!isFPix_(detid))
732  return -9999;
733  return disk_coord(detid, pixel_(digi));
734 }
735 float SiPixelCoordinates::disk_coord(const DetId& detid, const SiPixelCluster* cluster) {
736  if (!isFPix_(detid))
737  return -9999;
738  return disk_coord(detid, pixel_(cluster));
739 }
741  if (!isFPix_(rechit->geographicalId()))
742  return -9999;
743  return disk_coord(rechit->geographicalId(), pixel_(rechit));
744 }
746  if (!isFPix_(rechit->geographicalId()))
747  return -9999;
748  return disk_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
749 }
750 
751 // Same as above, but using online convention
752 // !!! Recommended for Phase 1 !!!
753 // Can be used for Phase 0 too for comparison purposes
754 float SiPixelCoordinates::signed_disk_coord(const DetId& detid, const std::pair<int, int>& pixel) {
755  if (!isFPix_(detid))
756  return -9999;
757  float signed_disk_coord = signed_disk(detid), coord_shift = ring_coord(detid, pixel) - ring(detid);
758  // Mirror -z side, so plots are symmetric
759  if (signed_disk_coord < 0)
760  coord_shift = -coord_shift;
761  signed_disk_coord += coord_shift;
762  return signed_disk_coord;
763 }
764 float SiPixelCoordinates::signed_disk_coord(const DetId& detid, const PixelDigi* digi) {
765  if (!isFPix_(detid))
766  return -9999;
767  return signed_disk_coord(detid, pixel_(digi));
768 }
769 float SiPixelCoordinates::signed_disk_coord(const DetId& detid, const SiPixelCluster* cluster) {
770  if (!isFPix_(detid))
771  return -9999;
772  return signed_disk_coord(detid, pixel_(cluster));
773 }
775  if (!isFPix_(rechit->geographicalId()))
776  return -9999;
777  return signed_disk_coord(rechit->geographicalId(), pixel_(rechit));
778 }
780  if (!isFPix_(rechit->geographicalId()))
781  return -9999;
782  return signed_disk_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
783 }
784 
785 // Same as the above two, but subdivisions incorporate rings as well
786 // 16 subdivisions are suggested
787 float SiPixelCoordinates::disk_ring_coord(const DetId& detid, const std::pair<int, int>& pixel) {
788  if (!isFPix_(detid))
789  return -9999;
790  float disk_ring_coord = disk(detid), coord_shift = 0;
791  //if (phase_==0) coord_shift = (ring_coord(detid,pixel) - 1.625) / 1.5;
792  //else if (phase_==1) coord_shift = (ring_coord(detid,pixel) - 1.5 ) / 2.0;
793  coord_shift = (ring_coord(detid, pixel) - 1.5) / 2.0;
794  disk_ring_coord += coord_shift;
795  return disk_ring_coord;
796 }
797 float SiPixelCoordinates::disk_ring_coord(const DetId& detid, const PixelDigi* digi) {
798  if (!isFPix_(detid))
799  return -9999;
800  return disk_ring_coord(detid, pixel_(digi));
801 }
802 float SiPixelCoordinates::disk_ring_coord(const DetId& detid, const SiPixelCluster* cluster) {
803  if (!isFPix_(detid))
804  return -9999;
805  return disk_ring_coord(detid, pixel_(cluster));
806 }
808  if (!isFPix_(rechit->geographicalId()))
809  return -9999;
810  return disk_ring_coord(rechit->geographicalId(), pixel_(rechit));
811 }
813  if (!isFPix_(rechit->geographicalId()))
814  return -9999;
815  return disk_ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
816 }
817 
818 // Same as above, but using online convention
819 // !!! Recommended for Phase 0 !!!
820 float SiPixelCoordinates::signed_disk_ring_coord(const DetId& detid, const std::pair<int, int>& pixel) {
821  if (!isFPix_(detid))
822  return -9999;
823  float signed_disk_ring_coord = signed_disk(detid), coord_shift = 0;
824  //if (phase_==0) coord_shift = (ring_coord(detid,pixel) - 1.625) / 1.5;
825  //else if (phase_==1) coord_shift = (ring_coord(detid,pixel) - 1.5 ) / 2.0;
826  coord_shift = (ring_coord(detid, pixel) - 1.5) / 2.0;
827  // Mirror -z side, so plots are symmetric
828  if (signed_disk_ring_coord < 0)
829  coord_shift = -coord_shift;
830  signed_disk_ring_coord += coord_shift;
831  return signed_disk_ring_coord;
832 }
834  if (!isFPix_(detid))
835  return -9999;
836  return signed_disk_ring_coord(detid, pixel_(digi));
837 }
839  if (!isFPix_(detid))
840  return -9999;
841  return signed_disk_ring_coord(detid, pixel_(cluster));
842 }
844  if (!isFPix_(rechit->geographicalId()))
845  return -9999;
846  return signed_disk_ring_coord(rechit->geographicalId(), pixel_(rechit));
847 }
849  if (!isFPix_(rechit->geographicalId()))
850  return -9999;
851  return signed_disk_ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
852 }
853 
854 // Offline blade convention
855 // Blade number is parallel to global phi
856 // For Phase 0: local y is parallel with phi
857 // On +Z side ly is parallel with phi
858 // On -Z side ly is anti-parallel
859 // Phase 1: local x is parallel with phi
860 // +Z Panel 1, -Z Panel 2 is parallel
861 // +Z Panel 2, -Z Panel 1 is anti-parallel
862 // Plot suitable for separate panel 1/2 plots
863 // 10 subdivisions are recommended for Phase 0 (Half-ROC granularity)
864 // 2 for Phase 1
865 float SiPixelCoordinates::blade_coord(const DetId& detid, const std::pair<int, int>& pixel) {
866  if (!isFPix_(detid))
867  return -9999;
868  float blade_coord = blade(detid), coord_shift = 0;
869  if (phase_ == 0) {
870  int rocsY = panel(detid) + module(detid);
871  coord_shift = ycoord_on_module_(detid, pixel) - rocsY / 10.;
872  if (side(detid) == 1)
873  coord_shift = -coord_shift;
874  } else if (phase_ == 1) {
875  coord_shift = xcoord_on_module_(detid, pixel) - 0.5;
876  if ((side(detid) + panel(detid)) % 2 == 0)
877  coord_shift = -coord_shift;
878  }
879  blade_coord += coord_shift;
880  return blade_coord;
881 }
882 float SiPixelCoordinates::blade_coord(const DetId& detid, const PixelDigi* digi) {
883  if (!isFPix_(detid))
884  return -9999;
885  return blade_coord(detid, pixel_(digi));
886 }
887 float SiPixelCoordinates::blade_coord(const DetId& detid, const SiPixelCluster* cluster) {
888  if (!isFPix_(detid))
889  return -9999;
890  return blade_coord(detid, pixel_(cluster));
891 }
893  if (!isFPix_(rechit->geographicalId()))
894  return -9999;
895  return blade_coord(rechit->geographicalId(), pixel_(rechit));
896 }
898  if (!isFPix_(rechit->geographicalId()))
899  return -9999;
900  return blade_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
901 }
902 
903 // Online blade convention
904 // Blade number is anti-parallel to global phi
905 // so signs are the opposite as above
906 // Plot suitable for separate panel 1/2 plots
907 // 10 subdivisions are recommended for Phase 0 (Half-ROC granularity)
908 // 2 for Phase 1
909 // !!! Recommended for Phase 0 |||
910 float SiPixelCoordinates::signed_blade_coord(const DetId& detid, const std::pair<int, int>& pixel) {
911  if (!isFPix_(detid))
912  return -9999;
913  float signed_blade_coord = signed_blade(detid), coord_shift = 0;
914  if (phase_ == 0) {
915  int rocsY = panel(detid) + module(detid);
916  coord_shift = ycoord_on_module_(detid, pixel) - rocsY / 10.;
917  if (side(detid) == 2)
918  coord_shift = -coord_shift;
919  } else if (phase_ == 1) {
920  coord_shift = xcoord_on_module_(detid, pixel) - 0.5;
921  if ((side(detid) + panel(detid)) % 2 == 1)
922  coord_shift = -coord_shift;
923  }
924  signed_blade_coord += coord_shift;
925  return signed_blade_coord;
926 }
927 float SiPixelCoordinates::signed_blade_coord(const DetId& detid, const PixelDigi* digi) {
928  if (!isFPix_(detid))
929  return -9999;
930  return signed_blade_coord(detid, pixel_(digi));
931 }
932 float SiPixelCoordinates::signed_blade_coord(const DetId& detid, const SiPixelCluster* cluster) {
933  if (!isFPix_(detid))
934  return -9999;
935  return signed_blade_coord(detid, pixel_(cluster));
936 }
938  if (!isFPix_(rechit->geographicalId()))
939  return -9999;
940  return signed_blade_coord(rechit->geographicalId(), pixel_(rechit));
941 }
943  if (!isFPix_(rechit->geographicalId()))
944  return -9999;
945  return signed_blade_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
946 }
947 
948 // Offline blade convention + alternating panels
949 // Same as above two, but subdivisions incorporate panels
950 // Panel 2 is towards higher phi values for Phase 1 (overlap for phase 0)
951 // 20 subdivisions are recommended for Phase 0 (Half-ROC granularity)
952 // 4 for Phase 1
953 float SiPixelCoordinates::blade_panel_coord(const DetId& detid, const std::pair<int, int>& pixel) {
954  if (!isFPix_(detid))
955  return -9999;
956  float blade_panel_coord = blade(detid);
957  float coord_shift = (blade_coord(detid, pixel) - blade_panel_coord + panel(detid) - 1.5) / 2;
958  blade_panel_coord += coord_shift;
959  return blade_panel_coord;
960 }
961 float SiPixelCoordinates::blade_panel_coord(const DetId& detid, const PixelDigi* digi) {
962  if (!isFPix_(detid))
963  return -9999;
964  return blade_panel_coord(detid, pixel_(digi));
965 }
966 float SiPixelCoordinates::blade_panel_coord(const DetId& detid, const SiPixelCluster* cluster) {
967  if (!isFPix_(detid))
968  return -9999;
969  return blade_panel_coord(detid, pixel_(cluster));
970 }
972  if (!isFPix_(rechit->geographicalId()))
973  return -9999;
974  return blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
975 }
977  if (!isFPix_(rechit->geographicalId()))
978  return -9999;
979  return blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
980 }
981 
982 // Online blade convention + alternating panels
983 // Blade number is anti-parallel to global phi
984 // so signs are the opposite as above
985 // 20 subdivisions are recommended for Phase 0 (Half-ROC granularity)
986 // 4 for Phase 1
987 // !!! Recommended for Phase 1 !!!
988 float SiPixelCoordinates::signed_blade_panel_coord(const DetId& detid, const std::pair<int, int>& pixel) {
989  if (!isFPix_(detid))
990  return -9999;
991  float signed_blade_panel_coord = signed_blade(detid);
992  float coord_shift = (signed_blade_coord(detid, pixel) - signed_blade_panel_coord - panel(detid) + 1.5) / 2;
993  signed_blade_panel_coord += coord_shift;
995 }
997  if (!isFPix_(detid))
998  return -9999;
999  return signed_blade_panel_coord(detid, pixel_(digi));
1000 }
1002  if (!isFPix_(detid))
1003  return -9999;
1004  return signed_blade_panel_coord(detid, pixel_(cluster));
1005 }
1007  if (!isFPix_(rechit->geographicalId()))
1008  return -9999;
1009  return signed_blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
1010 }
1012  if (!isFPix_(rechit->geographicalId()))
1013  return -9999;
1014  return signed_blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
1015 }
1016 
1017 // Same as above, but blade numbers are shifted for Phase 1 Ring 1
1018 // so one can plot Ring1+Ring2 while conserving geometrical
1019 // overlaps in phi
1020 // Ring 2: 17 blades x 4 ROC --> 68 bin
1021 // Ring 1: 2 gap, 4 ROC, alternating for 11 blades --> 68 bin
1022 float SiPixelCoordinates::signed_shifted_blade_panel_coord(const DetId& detid, const std::pair<int, int>& pixel) {
1023  if (!isFPix_(detid))
1024  return -9999;
1026  float coord_shift = (signed_blade_coord(detid, pixel) - signed_shifted_blade_panel_coord - panel(detid) + 1.5) / 2;
1027  if (phase_ == 1 && ring(detid) == 1)
1028  signed_shifted_blade_panel_coord *= 1.5;
1029  signed_shifted_blade_panel_coord += coord_shift;
1031 }
1033  if (!isFPix_(detid))
1034  return -9999;
1035  return signed_shifted_blade_panel_coord(detid, pixel_(digi));
1036 }
1038  if (!isFPix_(detid))
1039  return -9999;
1040  return signed_shifted_blade_panel_coord(detid, pixel_(cluster));
1041 }
1043  if (!isFPix_(rechit->geographicalId()))
1044  return -9999;
1045  return signed_shifted_blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
1046 }
1048  if (!isFPix_(rechit->geographicalId()))
1049  return -9999;
1050  return signed_shifted_blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
1051 }
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
int sector(const DetId &)
float signed_module_coord(const DetId &, const std::pair< int, int > &)
int row() const
Definition: PixelDigi.h:52
std::unordered_map< uint32_t, int > panel_
std::unordered_map< uint64_t, unsigned int > channel_
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
virtual int nrows() const =0
int signed_blade(const DetId &)
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
float ring_coord(const DetId &, const std::pair< int, int > &)
std::unordered_map< uint32_t, int > half_
virtual int rowsperroc() const =0
bool isPixel_(const DetId &)
std::unordered_map< uint32_t, int > sector_
int moduleName() const
module id (index in z)
std::unordered_map< uint32_t, int > ladder_
std::unordered_map< uint32_t, int > signed_disk_
void init(edm::EventSetup const &)
int side(const DetId &)
int blade(const DetId &)
unsigned int pxfDisk(const DetId &id) const
float ladder_coord(const DetId &, const std::pair< int, int > &)
int signed_disk(const DetId &)
float disk_coord(const DetId &, const std::pair< int, int > &)
const TrackerTopology * tTopo_
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
float blade_coord(const DetId &, const std::pair< int, int > &)
int ring(const DetId &)
unsigned int pxbModule(const DetId &id) const
unsigned int fedid(const DetId &)
int flipped(const DetId &)
int module(const DetId &)
bool isThere(GeomDetEnumerators::SubDetector subdet) const
bool isBPix_(const DetId &)
int layer(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int bladeName() const
blade id
std::unordered_map< uint32_t, int > signed_module_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::unordered_map< uint32_t, int > flipped_
std::unordered_map< uint32_t, int > ring_
std::unordered_map< uint32_t, int > outer_
int half(const DetId &)
bool isHalfModule() const
full or half module
virtual int colsperroc() const =0
std::unordered_map< uint32_t, int > layer_
std::unordered_map< uint32_t, int > module_
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int sectorName() const
sector id
int channel(const DetId &, const std::pair< int, int > &)
const SiPixelFedCablingMap * cablingMap_
int disk(const DetId &)
std::unordered_map< uint32_t, int > signed_blade_
int roc(const DetId &, const std::pair< int, int > &)
T min(T a, T b)
Definition: MathUtil.h:58
std::unordered_map< uint32_t, int > disk_
std::unordered_map< uint32_t, unsigned int > det2fedMap() const final
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:17
int outer(const DetId &)
virtual TrackingRecHit const * hit() const
int ladderName() const
ladder id (index in phi)
unsigned long long uint64_t
Definition: Time.h:13
std::unordered_map< uint32_t, int > signed_ladder_
const TrackerGeometry * tGeom_
int signed_module(const DetId &)
int toCabling(sipixelobjects::ElectronicIndex &cabling, const sipixelobjects::DetectorIndex &detector) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
std::unordered_map< uint32_t, int > quadrant_
const GeomDetUnit * detUnit() const override
std::unordered_map< uint32_t, int > side_
Shell shell() const
int quadrant(const DetId &)
int panel(const DetId &)
std::unordered_map< uint64_t, unsigned int > roc_
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
Pixel cluster – collection of neighboring pixels above threshold.
virtual int ncolumns() const =0
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
sipixelobjects::PixelROC const * toRoc(int link, int roc) const
T get() const
Definition: EventSetup.h:73
bool hasDetUnit(uint32_t radId) const
col
Definition: cuy.py:1010
float y() const
unsigned int pxfSide(const DetId &id) const
std::vector< unsigned int > fedIds() const
LocalPoint localPosition() const final
std::unordered_map< uint32_t, int > blade_
int ladder(const DetId &)
DetId geographicalId() const
float module_coord(const DetId &, const std::pair< int, int > &)
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
int ringName() const
ring Id
HalfCylinder halfCylinder() const
int column() const
Definition: PixelDigi.h:55
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
T const * product() const
Definition: ESHandle.h:86
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
float x() const
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
float signed_ladder_coord(const DetId &, const std::pair< int, int > &)
int signed_ladder(const DetId &)
std::unordered_map< uint32_t, unsigned int > fedid_
bool isFPix_(const DetId &)
Our base class.
Definition: SiPixelRecHit.h:23
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46