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