CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelCoordinates Class Reference

#include <SiPixelCoordinates.h>

Public Member Functions

int blade (const DetId &)
 
float blade_coord (const DetId &, const PixelDigi *)
 
float blade_coord (const DetId &, const SiPixelCluster *)
 
float blade_coord (const DetId &, const std::pair< int, int > &)
 
float blade_coord (const SiPixelRecHit *)
 
float blade_coord (const TrackingRecHit *)
 
float blade_panel_coord (const DetId &, const PixelDigi *)
 
float blade_panel_coord (const DetId &, const SiPixelCluster *)
 
float blade_panel_coord (const DetId &, const std::pair< int, int > &)
 
float blade_panel_coord (const SiPixelRecHit *)
 
float blade_panel_coord (const TrackingRecHit *)
 
int channel (const DetId &, const PixelDigi *)
 
int channel (const DetId &, const SiPixelCluster *)
 
int channel (const DetId &, const std::pair< int, int > &)
 
int channel (const SiPixelRecHit *)
 
int channel (const TrackingRecHit *)
 
int disk (const DetId &)
 
float disk_coord (const DetId &, const PixelDigi *)
 
float disk_coord (const DetId &, const SiPixelCluster *)
 
float disk_coord (const DetId &, const std::pair< int, int > &)
 
float disk_coord (const SiPixelRecHit *)
 
float disk_coord (const TrackingRecHit *)
 
float disk_ring_coord (const DetId &, const PixelDigi *)
 
float disk_ring_coord (const DetId &, const SiPixelCluster *)
 
float disk_ring_coord (const DetId &, const std::pair< int, int > &)
 
float disk_ring_coord (const SiPixelRecHit *)
 
float disk_ring_coord (const TrackingRecHit *)
 
unsigned int fedid (const DetId &)
 
int flipped (const DetId &)
 
int half (const DetId &)
 
void init (const TrackerTopology *, const TrackerGeometry *, const SiPixelFedCablingMap *)
 
int ladder (const DetId &)
 
float ladder_coord (const DetId &, const PixelDigi *)
 
float ladder_coord (const DetId &, const SiPixelCluster *)
 
float ladder_coord (const DetId &, const std::pair< int, int > &)
 
float ladder_coord (const SiPixelRecHit *)
 
float ladder_coord (const TrackingRecHit *)
 
int layer (const DetId &)
 
int module (const DetId &)
 
float module_coord (const DetId &, const PixelDigi *)
 
float module_coord (const DetId &, const SiPixelCluster *)
 
float module_coord (const DetId &, const std::pair< int, int > &)
 
float module_coord (const SiPixelRecHit *)
 
float module_coord (const TrackingRecHit *)
 
int outer (const DetId &)
 
int panel (const DetId &)
 
int quadrant (const DetId &)
 
int ring (const DetId &)
 
float ring_coord (const DetId &, const PixelDigi *)
 
float ring_coord (const DetId &, const SiPixelCluster *)
 
float ring_coord (const DetId &, const std::pair< int, int > &)
 
float ring_coord (const SiPixelRecHit *)
 
float ring_coord (const TrackingRecHit *)
 
int roc (const DetId &, const PixelDigi *)
 
int roc (const DetId &, const SiPixelCluster *)
 
int roc (const DetId &, const std::pair< int, int > &)
 
int roc (const SiPixelRecHit *)
 
int roc (const TrackingRecHit *)
 
int sector (const DetId &)
 
int side (const DetId &)
 
int signed_blade (const DetId &)
 
float signed_blade_coord (const DetId &, const PixelDigi *)
 
float signed_blade_coord (const DetId &, const SiPixelCluster *)
 
float signed_blade_coord (const DetId &, const std::pair< int, int > &)
 
float signed_blade_coord (const SiPixelRecHit *)
 
float signed_blade_coord (const TrackingRecHit *)
 
float signed_blade_panel_coord (const DetId &, const PixelDigi *)
 
float signed_blade_panel_coord (const DetId &, const SiPixelCluster *)
 
float signed_blade_panel_coord (const DetId &, const std::pair< int, int > &)
 
float signed_blade_panel_coord (const SiPixelRecHit *)
 
float signed_blade_panel_coord (const TrackingRecHit *)
 
int signed_disk (const DetId &)
 
float signed_disk_coord (const DetId &, const PixelDigi *)
 
float signed_disk_coord (const DetId &, const SiPixelCluster *)
 
float signed_disk_coord (const DetId &, const std::pair< int, int > &)
 
float signed_disk_coord (const SiPixelRecHit *)
 
float signed_disk_coord (const TrackingRecHit *)
 
float signed_disk_ring_coord (const DetId &, const PixelDigi *)
 
float signed_disk_ring_coord (const DetId &, const SiPixelCluster *)
 
float signed_disk_ring_coord (const DetId &, const std::pair< int, int > &)
 
float signed_disk_ring_coord (const SiPixelRecHit *)
 
float signed_disk_ring_coord (const TrackingRecHit *)
 
int signed_ladder (const DetId &)
 
float signed_ladder_coord (const DetId &, const PixelDigi *)
 
float signed_ladder_coord (const DetId &, const SiPixelCluster *)
 
float signed_ladder_coord (const DetId &, const std::pair< int, int > &)
 
float signed_ladder_coord (const SiPixelRecHit *)
 
float signed_ladder_coord (const TrackingRecHit *)
 
int signed_module (const DetId &)
 
float signed_module_coord (const DetId &, const PixelDigi *)
 
float signed_module_coord (const DetId &, const SiPixelCluster *)
 
float signed_module_coord (const DetId &, const std::pair< int, int > &)
 
float signed_module_coord (const SiPixelRecHit *)
 
float signed_module_coord (const TrackingRecHit *)
 
float signed_shifted_blade_panel_coord (const DetId &, const PixelDigi *)
 
float signed_shifted_blade_panel_coord (const DetId &, const SiPixelCluster *)
 
float signed_shifted_blade_panel_coord (const DetId &, const std::pair< int, int > &)
 
float signed_shifted_blade_panel_coord (const SiPixelRecHit *)
 
float signed_shifted_blade_panel_coord (const TrackingRecHit *)
 
 SiPixelCoordinates ()
 
 SiPixelCoordinates (int)
 
virtual ~SiPixelCoordinates ()
 

Private Member Functions

bool isBPix_ (const DetId &)
 
bool isFPix_ (const DetId &)
 
bool isPixel_ (const DetId &)
 
std::pair< int, int > pixel_ (const PixelDigi *)
 
std::pair< int, int > pixel_ (const SiPixelCluster *)
 
std::pair< int, int > pixel_ (const SiPixelRecHit *)
 
float xcoord_on_module_ (const DetId &, const std::pair< int, int > &)
 
float ycoord_on_module_ (const DetId &, const std::pair< int, int > &)
 

Private Attributes

std::unordered_map< uint32_t, int > blade_
 
const SiPixelFedCablingMapcablingMap_
 
std::unordered_map< uint64_t, unsigned int > channel_
 
std::unordered_map< uint32_t, int > disk_
 
std::unordered_map< uint32_t, unsigned int > fedid_
 
std::unordered_map< uint32_t, int > flipped_
 
std::unordered_map< uint32_t, int > half_
 
std::unordered_map< uint32_t, int > ladder_
 
std::unordered_map< uint32_t, int > layer_
 
std::unordered_map< uint32_t, int > module_
 
std::unordered_map< uint32_t, int > outer_
 
std::unordered_map< uint32_t, int > panel_
 
int phase_
 
std::unordered_map< uint32_t, int > quadrant_
 
std::unordered_map< uint32_t, int > ring_
 
std::unordered_map< uint64_t, unsigned int > roc_
 
std::unordered_map< uint32_t, int > sector_
 
std::unordered_map< uint32_t, int > side_
 
std::unordered_map< uint32_t, int > signed_blade_
 
std::unordered_map< uint32_t, int > signed_disk_
 
std::unordered_map< uint32_t, int > signed_ladder_
 
std::unordered_map< uint32_t, int > signed_module_
 
const TrackerGeometrytGeom_
 
const TrackerTopologytTopo_
 

Detailed Description

Definition at line 35 of file SiPixelCoordinates.h.

Constructor & Destructor Documentation

◆ SiPixelCoordinates() [1/2]

SiPixelCoordinates::SiPixelCoordinates ( )

Definition at line 22 of file SiPixelCoordinates.cc.

22 { phase_ = -1; }

References phase_.

◆ SiPixelCoordinates() [2/2]

SiPixelCoordinates::SiPixelCoordinates ( int  phase)

Definition at line 24 of file SiPixelCoordinates.cc.

24 : phase_(phase) {}

◆ ~SiPixelCoordinates()

SiPixelCoordinates::~SiPixelCoordinates ( )
virtual

Definition at line 26 of file SiPixelCoordinates.cc.

26 {}

Member Function Documentation

◆ blade()

int SiPixelCoordinates::blade ( const DetId detid)

Definition at line 247 of file SiPixelCoordinates.cc.

247  {
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 }

References blade_, isFPix_(), TrackerTopology::pxfBlade(), DetId::rawId(), and tTopo_.

Referenced by blade_coord(), and blade_panel_coord().

◆ blade_coord() [1/5]

float SiPixelCoordinates::blade_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 872 of file SiPixelCoordinates.cc.

872  {
873  if (!isFPix_(detid))
874  return -9999;
875  return blade_coord(detid, pixel_(digi));
876 }

References blade_coord(), isFPix_(), and pixel_().

◆ blade_coord() [2/5]

float SiPixelCoordinates::blade_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 877 of file SiPixelCoordinates.cc.

877  {
878  if (!isFPix_(detid))
879  return -9999;
880  return blade_coord(detid, pixel_(cluster));
881 }

References blade_coord(), isFPix_(), and pixel_().

◆ blade_coord() [3/5]

float SiPixelCoordinates::blade_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 855 of file SiPixelCoordinates.cc.

855  {
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 }

References blade(), isFPix_(), module(), panel(), phase_, muonClassificationByHits_cfi::pixel, side(), xcoord_on_module_(), and ycoord_on_module_().

Referenced by blade_coord(), and blade_panel_coord().

◆ blade_coord() [4/5]

float SiPixelCoordinates::blade_coord ( const SiPixelRecHit rechit)

Definition at line 882 of file SiPixelCoordinates.cc.

882  {
883  if (!isFPix_(rechit->geographicalId()))
884  return -9999;
885  return blade_coord(rechit->geographicalId(), pixel_(rechit));
886 }

References blade_coord(), TrackingRecHit::geographicalId(), isFPix_(), and pixel_().

◆ blade_coord() [5/5]

float SiPixelCoordinates::blade_coord ( const TrackingRecHit rechit)

Definition at line 887 of file SiPixelCoordinates.cc.

887  {
888  if (!isFPix_(rechit->geographicalId()))
889  return -9999;
890  return blade_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
891 }

References blade_coord(), TrackingRecHit::geographicalId(), TrackingRecHit::hit(), and isFPix_().

◆ blade_panel_coord() [1/5]

float SiPixelCoordinates::blade_panel_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 951 of file SiPixelCoordinates.cc.

951  {
952  if (!isFPix_(detid))
953  return -9999;
954  return blade_panel_coord(detid, pixel_(digi));
955 }

References blade_panel_coord(), isFPix_(), and pixel_().

◆ blade_panel_coord() [2/5]

float SiPixelCoordinates::blade_panel_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 956 of file SiPixelCoordinates.cc.

956  {
957  if (!isFPix_(detid))
958  return -9999;
959  return blade_panel_coord(detid, pixel_(cluster));
960 }

References blade_panel_coord(), isFPix_(), and pixel_().

◆ blade_panel_coord() [3/5]

float SiPixelCoordinates::blade_panel_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 943 of file SiPixelCoordinates.cc.

943  {
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 }

References blade(), blade_coord(), isFPix_(), panel(), and muonClassificationByHits_cfi::pixel.

Referenced by blade_panel_coord().

◆ blade_panel_coord() [4/5]

float SiPixelCoordinates::blade_panel_coord ( const SiPixelRecHit rechit)

Definition at line 961 of file SiPixelCoordinates.cc.

961  {
962  if (!isFPix_(rechit->geographicalId()))
963  return -9999;
964  return blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
965 }

References blade_panel_coord(), TrackingRecHit::geographicalId(), isFPix_(), and pixel_().

◆ blade_panel_coord() [5/5]

float SiPixelCoordinates::blade_panel_coord ( const TrackingRecHit rechit)

Definition at line 966 of file SiPixelCoordinates.cc.

966  {
967  if (!isFPix_(rechit->geographicalId()))
968  return -9999;
969  return blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
970 }

References blade_panel_coord(), TrackingRecHit::geographicalId(), TrackingRecHit::hit(), and isFPix_().

◆ channel() [1/5]

int SiPixelCoordinates::channel ( const DetId detid,
const PixelDigi digi 
)

Definition at line 408 of file SiPixelCoordinates.cc.

408  {
409  if (!isPixel_(detid))
410  return -9999;
411  return channel(detid, pixel_(digi));
412 }

References channel(), isPixel_(), and pixel_().

◆ channel() [2/5]

int SiPixelCoordinates::channel ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 413 of file SiPixelCoordinates.cc.

413  {
414  if (!isPixel_(detid))
415  return -9999;
416  return channel(detid, pixel_(cluster));
417 }

References channel(), isPixel_(), and pixel_().

◆ channel() [3/5]

int SiPixelCoordinates::channel ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 371 of file SiPixelCoordinates.cc.

371  {
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 }

References cablingMap_, channel_, hgcalTestNeighbor_cfi::detector, fedid(), l1tstage2_dqm_sourceclient-live_cfg::fedId, half(), sipixelobjects::PixelROC::idInDetUnit(), TrackerGeometry::idToDetUnit(), isPixel_(), sipixelobjects::ElectronicIndex::link, phase_, muonClassificationByHits_cfi::pixel, PixelSubdetector::PixelBarrel, DetId::rawId(), sipixelobjects::ElectronicIndex::roc, roc(), roc_, PixelTopology::rowsperroc(), side(), PixelGeomDetUnit::specificTopology(), DetId::subdetId(), and tGeom_.

Referenced by channel().

◆ channel() [4/5]

int SiPixelCoordinates::channel ( const SiPixelRecHit rechit)

Definition at line 418 of file SiPixelCoordinates.cc.

418  {
419  if (!isPixel_(rechit->geographicalId()))
420  return -9999;
421  return channel(rechit->geographicalId(), pixel_(rechit));
422 }

References channel(), TrackingRecHit::geographicalId(), isPixel_(), and pixel_().

◆ channel() [5/5]

int SiPixelCoordinates::channel ( const TrackingRecHit rechit)

Definition at line 423 of file SiPixelCoordinates.cc.

423  {
424  if (!isPixel_(rechit->geographicalId()))
425  return -9999;
426  return channel(static_cast<const SiPixelRecHit*>(rechit->hit()));
427 }

References channel(), TrackingRecHit::geographicalId(), TrackingRecHit::hit(), and isPixel_().

◆ disk()

int SiPixelCoordinates::disk ( const DetId detid)

Definition at line 196 of file SiPixelCoordinates.cc.

196  {
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 }

References disk_, isFPix_(), TrackerTopology::pxfDisk(), DetId::rawId(), and tTopo_.

Referenced by disk_coord(), disk_ring_coord(), and signed_disk().

◆ disk_coord() [1/5]

float SiPixelCoordinates::disk_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 720 of file SiPixelCoordinates.cc.

720  {
721  if (!isFPix_(detid))
722  return -9999;
723  return disk_coord(detid, pixel_(digi));
724 }

References disk_coord(), isFPix_(), and pixel_().

◆ disk_coord() [2/5]

float SiPixelCoordinates::disk_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 725 of file SiPixelCoordinates.cc.

725  {
726  if (!isFPix_(detid))
727  return -9999;
728  return disk_coord(detid, pixel_(cluster));
729 }

References disk_coord(), isFPix_(), and pixel_().

◆ disk_coord() [3/5]

float SiPixelCoordinates::disk_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 713 of file SiPixelCoordinates.cc.

713  {
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 }

References disk(), isFPix_(), muonClassificationByHits_cfi::pixel, ring(), and ring_coord().

Referenced by disk_coord().

◆ disk_coord() [4/5]

float SiPixelCoordinates::disk_coord ( const SiPixelRecHit rechit)

Definition at line 730 of file SiPixelCoordinates.cc.

730  {
731  if (!isFPix_(rechit->geographicalId()))
732  return -9999;
733  return disk_coord(rechit->geographicalId(), pixel_(rechit));
734 }

References disk_coord(), TrackingRecHit::geographicalId(), isFPix_(), and pixel_().

◆ disk_coord() [5/5]

float SiPixelCoordinates::disk_coord ( const TrackingRecHit rechit)

Definition at line 735 of file SiPixelCoordinates.cc.

735  {
736  if (!isFPix_(rechit->geographicalId()))
737  return -9999;
738  return disk_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
739 }

References disk_coord(), TrackingRecHit::geographicalId(), TrackingRecHit::hit(), and isFPix_().

◆ disk_ring_coord() [1/5]

float SiPixelCoordinates::disk_ring_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 787 of file SiPixelCoordinates.cc.

787  {
788  if (!isFPix_(detid))
789  return -9999;
790  return disk_ring_coord(detid, pixel_(digi));
791 }

References disk_ring_coord(), isFPix_(), and pixel_().

◆ disk_ring_coord() [2/5]

float SiPixelCoordinates::disk_ring_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 792 of file SiPixelCoordinates.cc.

792  {
793  if (!isFPix_(detid))
794  return -9999;
795  return disk_ring_coord(detid, pixel_(cluster));
796 }

References disk_ring_coord(), isFPix_(), and pixel_().

◆ disk_ring_coord() [3/5]

float SiPixelCoordinates::disk_ring_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 777 of file SiPixelCoordinates.cc.

777  {
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 }

References disk(), isFPix_(), muonClassificationByHits_cfi::pixel, and ring_coord().

Referenced by disk_ring_coord().

◆ disk_ring_coord() [4/5]

float SiPixelCoordinates::disk_ring_coord ( const SiPixelRecHit rechit)

Definition at line 797 of file SiPixelCoordinates.cc.

797  {
798  if (!isFPix_(rechit->geographicalId()))
799  return -9999;
800  return disk_ring_coord(rechit->geographicalId(), pixel_(rechit));
801 }

References disk_ring_coord(), TrackingRecHit::geographicalId(), isFPix_(), and pixel_().

◆ disk_ring_coord() [5/5]

float SiPixelCoordinates::disk_ring_coord ( const TrackingRecHit rechit)

Definition at line 802 of file SiPixelCoordinates.cc.

802  {
803  if (!isFPix_(rechit->geographicalId()))
804  return -9999;
805  return disk_ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
806 }

References disk_ring_coord(), TrackingRecHit::geographicalId(), TrackingRecHit::hit(), and isFPix_().

◆ fedid()

unsigned int SiPixelCoordinates::fedid ( const DetId detid)

Definition at line 269 of file SiPixelCoordinates.cc.

269  {
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 }

References cablingMap_, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedid_, SiPixelFedCablingMap::fedIds(), SiPixelFrameConverter::hasDetUnit(), isPixel_(), and DetId::rawId().

Referenced by channel(), and roc().

◆ flipped()

int SiPixelCoordinates::flipped ( const DetId detid)

Definition at line 184 of file SiPixelCoordinates.cc.

184  {
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 }

References flipped_, isBPix_(), outer(), phase_, and DetId::rawId().

Referenced by ladder_coord(), and signed_ladder_coord().

◆ half()

int SiPixelCoordinates::half ( const DetId detid)

Definition at line 147 of file SiPixelCoordinates.cc.

147  {
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 }

References half_, isBPix_(), PixelBarrelName::isHalfModule(), phase_, DetId::rawId(), and tTopo_.

Referenced by channel(), ladder_coord(), roc(), and signed_ladder_coord().

◆ init()

void SiPixelCoordinates::init ( const TrackerTopology trackerTopology,
const TrackerGeometry trackerGeometry,
const SiPixelFedCablingMap siPixelFedCablingMap 
)

Definition at line 30 of file SiPixelCoordinates.cc.

32  {
33  tTopo_ = trackerTopology;
34  tGeom_ = trackerGeometry;
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 }

References cablingMap_, SiPixelFedCablingMap::det2fedMap(), fedid_, TrackerGeometry::isThere(), GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, phase_, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, tGeom_, and tTopo_.

Referenced by SiPixelStatusHarvester::dqmEndRun().

◆ isBPix_()

bool SiPixelCoordinates::isBPix_ ( const DetId detid)
private

Definition at line 295 of file SiPixelCoordinates.cc.

295  {
296  if (detid.det() != DetId::Tracker)
297  return false;
299  return true;
300  return false;
301 }

References DetId::det(), PixelSubdetector::PixelBarrel, DetId::subdetId(), and DetId::Tracker.

Referenced by flipped(), half(), ladder(), ladder_coord(), layer(), module_coord(), outer(), sector(), signed_ladder(), signed_ladder_coord(), signed_module(), and signed_module_coord().

◆ isFPix_()

bool SiPixelCoordinates::isFPix_ ( const DetId detid)
private

◆ isPixel_()

bool SiPixelCoordinates::isPixel_ ( const DetId detid)
private

Definition at line 286 of file SiPixelCoordinates.cc.

286  {
287  if (detid.det() != DetId::Tracker)
288  return false;
290  return true;
292  return true;
293  return false;
294 }

References DetId::det(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::subdetId(), and DetId::Tracker.

Referenced by channel(), fedid(), module(), quadrant(), roc(), and side().

◆ ladder()

int SiPixelCoordinates::ladder ( const DetId detid)

Definition at line 112 of file SiPixelCoordinates.cc.

112  {
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 }

References isBPix_(), ladder_, TrackerTopology::pxbLadder(), DetId::rawId(), and tTopo_.

Referenced by ladder_coord().

◆ ladder_coord() [1/5]

float SiPixelCoordinates::ladder_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 596 of file SiPixelCoordinates.cc.

596  {
597  if (!isBPix_(detid))
598  return -9999;
599  return ladder_coord(detid, pixel_(digi));
600 }

References isBPix_(), ladder_coord(), and pixel_().

◆ ladder_coord() [2/5]

float SiPixelCoordinates::ladder_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 601 of file SiPixelCoordinates.cc.

601  {
602  if (!isBPix_(detid))
603  return -9999;
604  return ladder_coord(detid, pixel_(cluster));
605 }

References isBPix_(), ladder_coord(), and pixel_().

◆ ladder_coord() [3/5]

float SiPixelCoordinates::ladder_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 587 of file SiPixelCoordinates.cc.

587  {
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 }

References flipped(), half(), isBPix_(), ladder(), muonClassificationByHits_cfi::pixel, Validation_hcalonly_cfi::sign, and xcoord_on_module_().

Referenced by ladder_coord().

◆ ladder_coord() [4/5]

float SiPixelCoordinates::ladder_coord ( const SiPixelRecHit rechit)

Definition at line 606 of file SiPixelCoordinates.cc.

606  {
607  if (!isBPix_(rechit->geographicalId()))
608  return -9999;
609  return ladder_coord(rechit->geographicalId(), pixel_(rechit));
610 }

References TrackingRecHit::geographicalId(), isBPix_(), ladder_coord(), and pixel_().

◆ ladder_coord() [5/5]

float SiPixelCoordinates::ladder_coord ( const TrackingRecHit rechit)

Definition at line 611 of file SiPixelCoordinates.cc.

611  {
612  if (!isBPix_(rechit->geographicalId()))
613  return -9999;
614  return ladder_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
615 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isBPix_(), and ladder_coord().

◆ layer()

int SiPixelCoordinates::layer ( const DetId detid)

Definition at line 94 of file SiPixelCoordinates.cc.

94  {
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 }

References isBPix_(), layer_, TrackerTopology::pxbLayer(), DetId::rawId(), and tTopo_.

Referenced by SiPixelStatusHarvester::dqmEndRun(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), outer(), SiPixelStatusHarvester::perLayerRingAverage(), and SiPixelStatusHarvester::substructure().

◆ module()

int SiPixelCoordinates::module ( const DetId detid)

Definition at line 82 of file SiPixelCoordinates.cc.

82  {
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 }

References isPixel_(), module_, PixelSubdetector::PixelBarrel, TrackerTopology::pxbModule(), TrackerTopology::pxfModule(), DetId::rawId(), DetId::subdetId(), and tTopo_.

Referenced by blade_coord(), module_coord(), ring(), ring_coord(), roc(), and signed_blade_coord().

◆ module_coord() [1/5]

float SiPixelCoordinates::module_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 538 of file SiPixelCoordinates.cc.

538  {
539  if (!isBPix_(detid))
540  return -9999;
541  return module_coord(detid, pixel_(digi));
542 }

References isBPix_(), module_coord(), and pixel_().

◆ module_coord() [2/5]

float SiPixelCoordinates::module_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 543 of file SiPixelCoordinates.cc.

543  {
544  if (!isBPix_(detid))
545  return -9999;
546  return module_coord(detid, pixel_(cluster));
547 }

References isBPix_(), module_coord(), and pixel_().

◆ module_coord() [3/5]

float SiPixelCoordinates::module_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 531 of file SiPixelCoordinates.cc.

531  {
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 }

References isBPix_(), module(), muonClassificationByHits_cfi::pixel, and ycoord_on_module_().

Referenced by module_coord().

◆ module_coord() [4/5]

float SiPixelCoordinates::module_coord ( const SiPixelRecHit rechit)

Definition at line 548 of file SiPixelCoordinates.cc.

548  {
549  if (!isBPix_(rechit->geographicalId()))
550  return -9999;
551  return module_coord(rechit->geographicalId(), pixel_(rechit));
552 }

References TrackingRecHit::geographicalId(), isBPix_(), module_coord(), and pixel_().

◆ module_coord() [5/5]

float SiPixelCoordinates::module_coord ( const TrackingRecHit rechit)

Definition at line 553 of file SiPixelCoordinates.cc.

553  {
554  if (!isBPix_(rechit->geographicalId()))
555  return -9999;
556  return module_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
557 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isBPix_(), and module_coord().

◆ outer()

int SiPixelCoordinates::outer ( const DetId detid)

Definition at line 160 of file SiPixelCoordinates.cc.

160  {
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 }

References isBPix_(), layer(), outer_, phase_, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), DetId::rawId(), and tTopo_.

Referenced by flipped().

◆ panel()

int SiPixelCoordinates::panel ( const DetId detid)

Definition at line 218 of file SiPixelCoordinates.cc.

218  {
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 }

References isFPix_(), panel_, TrackerTopology::pxfPanel(), DetId::rawId(), and tTopo_.

Referenced by blade_coord(), blade_panel_coord(), ring(), ring_coord(), roc(), signed_blade_coord(), signed_blade_panel_coord(), and signed_shifted_blade_panel_coord().

◆ pixel_() [1/3]

std::pair< int, int > SiPixelCoordinates::pixel_ ( const PixelDigi digi)
private

◆ pixel_() [2/3]

std::pair< int, int > SiPixelCoordinates::pixel_ ( const SiPixelCluster cluster)
private

Definition at line 313 of file SiPixelCoordinates.cc.

313  {
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 }

References cuy::col, SiPixelCluster::x(), and SiPixelCluster::y().

◆ pixel_() [3/3]

std::pair< int, int > SiPixelCoordinates::pixel_ ( const SiPixelRecHit rechit)
private

Definition at line 320 of file SiPixelCoordinates.cc.

320  {
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 }

References cuy::col, TrackerSingleRecHit::detUnit(), createfilelist::int, BaseTrackerRecHit::localPosition(), SiStripPI::max, min(), muonClassificationByHits_cfi::pixel, and PixelGeomDetUnit::specificTopology().

◆ quadrant()

int SiPixelCoordinates::quadrant ( const DetId detid)

Definition at line 56 of file SiPixelCoordinates.cc.

56  {
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 }

References PixelEndcapName::halfCylinder(), isPixel_(), phase_, PixelSubdetector::PixelBarrel, quadrant_, DetId::rawId(), PixelBarrelName::shell(), DetId::subdetId(), and tTopo_.

Referenced by side(), signed_blade(), signed_disk(), signed_ladder(), and signed_module().

◆ ring()

int SiPixelCoordinates::ring ( const DetId detid)

Definition at line 232 of file SiPixelCoordinates.cc.

232  {
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 }

References isFPix_(), module(), panel(), phase_, DetId::rawId(), ring_, PixelEndcapName::ringName(), and tTopo_.

Referenced by disk_coord(), SiPixelStatusHarvester::dqmEndRun(), geometryXMLparser.CSCAlignable::index(), SiPixelStatusHarvester::perLayerRingAverage(), ring_coord(), signed_disk_coord(), signed_shifted_blade_panel_coord(), and SiPixelStatusHarvester::substructure().

◆ ring_coord() [1/5]

float SiPixelCoordinates::ring_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 686 of file SiPixelCoordinates.cc.

686  {
687  if (!isFPix_(detid))
688  return -9999;
689  return ring_coord(detid, pixel_(digi));
690 }

References isFPix_(), pixel_(), and ring_coord().

◆ ring_coord() [2/5]

float SiPixelCoordinates::ring_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 691 of file SiPixelCoordinates.cc.

691  {
692  if (!isFPix_(detid))
693  return -9999;
694  return ring_coord(detid, pixel_(cluster));
695 }

References isFPix_(), pixel_(), and ring_coord().

◆ ring_coord() [3/5]

float SiPixelCoordinates::ring_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 654 of file SiPixelCoordinates.cc.

654  {
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 }

References isFPix_(), mod(), module(), panel(), phase_, muonClassificationByHits_cfi::pixel, ring(), xcoord_on_module_(), and ycoord_on_module_().

Referenced by disk_coord(), disk_ring_coord(), ring_coord(), signed_disk_coord(), and signed_disk_ring_coord().

◆ ring_coord() [4/5]

float SiPixelCoordinates::ring_coord ( const SiPixelRecHit rechit)

Definition at line 696 of file SiPixelCoordinates.cc.

696  {
697  if (!isFPix_(rechit->geographicalId()))
698  return -9999;
699  return ring_coord(rechit->geographicalId(), pixel_(rechit));
700 }

References TrackingRecHit::geographicalId(), isFPix_(), pixel_(), and ring_coord().

◆ ring_coord() [5/5]

float SiPixelCoordinates::ring_coord ( const TrackingRecHit rechit)

Definition at line 701 of file SiPixelCoordinates.cc.

701  {
702  if (!isFPix_(rechit->geographicalId()))
703  return -9999;
704  return ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
705 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isFPix_(), and ring_coord().

◆ roc() [1/5]

int SiPixelCoordinates::roc ( const DetId detid,
const PixelDigi digi 
)

Definition at line 505 of file SiPixelCoordinates.cc.

505  {
506  if (!isPixel_(detid))
507  return -9999;
508  return roc(detid, pixel_(digi));
509 }

References isPixel_(), pixel_(), and roc().

◆ roc() [2/5]

int SiPixelCoordinates::roc ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 510 of file SiPixelCoordinates.cc.

510  {
511  if (!isPixel_(detid))
512  return -9999;
513  return roc(detid, pixel_(cluster));
514 }

References isPixel_(), pixel_(), and roc().

◆ roc() [3/5]

int SiPixelCoordinates::roc ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 442 of file SiPixelCoordinates.cc.

442  {
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 }

References cablingMap_, channel_, hgcalTestNeighbor_cfi::detector, fedid(), l1tstage2_dqm_sourceclient-live_cfg::fedId, half(), sipixelobjects::PixelROC::idInDetUnit(), TrackerGeometry::idToDetUnit(), isPixel_(), sipixelobjects::ElectronicIndex::link, mod(), module(), panel(), phase_, muonClassificationByHits_cfi::pixel, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), sipixelobjects::ElectronicIndex::roc, roc_, PixelTopology::rowsperroc(), side(), PixelGeomDetUnit::specificTopology(), DetId::subdetId(), and tGeom_.

Referenced by channel(), and roc().

◆ roc() [4/5]

int SiPixelCoordinates::roc ( const SiPixelRecHit rechit)

Definition at line 515 of file SiPixelCoordinates.cc.

515  {
516  if (!isPixel_(rechit->geographicalId()))
517  return -9999;
518  return roc(rechit->geographicalId(), pixel_(rechit));
519 }

References TrackingRecHit::geographicalId(), isPixel_(), pixel_(), and roc().

◆ roc() [5/5]

int SiPixelCoordinates::roc ( const TrackingRecHit rechit)

Definition at line 520 of file SiPixelCoordinates.cc.

520  {
521  if (!isPixel_(rechit->geographicalId()))
522  return -9999;
523  return roc(static_cast<const SiPixelRecHit*>(rechit->hit()));
524 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isPixel_(), and roc().

◆ sector()

int SiPixelCoordinates::sector ( const DetId detid)

Definition at line 103 of file SiPixelCoordinates.cc.

103  {
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 }

References isBPix_(), phase_, DetId::rawId(), sector_, PixelBarrelName::sectorName(), and tTopo_.

Referenced by geometryXMLparser.DTAlignable::index().

◆ side()

int SiPixelCoordinates::side ( const DetId detid)

Definition at line 70 of file SiPixelCoordinates.cc.

70  {
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 }

References isPixel_(), PixelSubdetector::PixelBarrel, TrackerTopology::pxfSide(), quadrant(), DetId::rawId(), side_, DetId::subdetId(), and tTopo_.

Referenced by blade_coord(), channel(), roc(), and signed_blade_coord().

◆ signed_blade()

int SiPixelCoordinates::signed_blade ( const DetId detid)

Definition at line 257 of file SiPixelCoordinates.cc.

257  {
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 }

References PixelEndcapName::bladeName(), isFPix_(), phase_, quadrant(), DetId::rawId(), signed_blade_, and tTopo_.

Referenced by signed_blade_coord(), signed_blade_panel_coord(), and signed_shifted_blade_panel_coord().

◆ signed_blade_coord() [1/5]

float SiPixelCoordinates::signed_blade_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 917 of file SiPixelCoordinates.cc.

917  {
918  if (!isFPix_(detid))
919  return -9999;
920  return signed_blade_coord(detid, pixel_(digi));
921 }

References isFPix_(), pixel_(), and signed_blade_coord().

◆ signed_blade_coord() [2/5]

float SiPixelCoordinates::signed_blade_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 922 of file SiPixelCoordinates.cc.

922  {
923  if (!isFPix_(detid))
924  return -9999;
925  return signed_blade_coord(detid, pixel_(cluster));
926 }

References isFPix_(), pixel_(), and signed_blade_coord().

◆ signed_blade_coord() [3/5]

float SiPixelCoordinates::signed_blade_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 900 of file SiPixelCoordinates.cc.

900  {
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 }

References isFPix_(), module(), panel(), phase_, muonClassificationByHits_cfi::pixel, side(), signed_blade(), xcoord_on_module_(), and ycoord_on_module_().

Referenced by signed_blade_coord(), signed_blade_panel_coord(), and signed_shifted_blade_panel_coord().

◆ signed_blade_coord() [4/5]

float SiPixelCoordinates::signed_blade_coord ( const SiPixelRecHit rechit)

Definition at line 927 of file SiPixelCoordinates.cc.

927  {
928  if (!isFPix_(rechit->geographicalId()))
929  return -9999;
930  return signed_blade_coord(rechit->geographicalId(), pixel_(rechit));
931 }

References TrackingRecHit::geographicalId(), isFPix_(), pixel_(), and signed_blade_coord().

◆ signed_blade_coord() [5/5]

float SiPixelCoordinates::signed_blade_coord ( const TrackingRecHit rechit)

Definition at line 932 of file SiPixelCoordinates.cc.

932  {
933  if (!isFPix_(rechit->geographicalId()))
934  return -9999;
935  return signed_blade_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
936 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isFPix_(), and signed_blade_coord().

◆ signed_blade_panel_coord() [1/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 986 of file SiPixelCoordinates.cc.

986  {
987  if (!isFPix_(detid))
988  return -9999;
989  return signed_blade_panel_coord(detid, pixel_(digi));
990 }

References isFPix_(), pixel_(), and signed_blade_panel_coord().

◆ signed_blade_panel_coord() [2/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 991 of file SiPixelCoordinates.cc.

991  {
992  if (!isFPix_(detid))
993  return -9999;
994  return signed_blade_panel_coord(detid, pixel_(cluster));
995 }

References isFPix_(), pixel_(), and signed_blade_panel_coord().

◆ signed_blade_panel_coord() [3/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 978 of file SiPixelCoordinates.cc.

978  {
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 }

References isFPix_(), panel(), muonClassificationByHits_cfi::pixel, signed_blade(), and signed_blade_coord().

Referenced by signed_blade_panel_coord().

◆ signed_blade_panel_coord() [4/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const SiPixelRecHit rechit)

Definition at line 996 of file SiPixelCoordinates.cc.

996  {
997  if (!isFPix_(rechit->geographicalId()))
998  return -9999;
999  return signed_blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
1000 }

References TrackingRecHit::geographicalId(), isFPix_(), pixel_(), and signed_blade_panel_coord().

◆ signed_blade_panel_coord() [5/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const TrackingRecHit rechit)

Definition at line 1001 of file SiPixelCoordinates.cc.

1001  {
1002  if (!isFPix_(rechit->geographicalId()))
1003  return -9999;
1004  return signed_blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
1005 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isFPix_(), and signed_blade_panel_coord().

◆ signed_disk()

int SiPixelCoordinates::signed_disk ( const DetId detid)

Definition at line 206 of file SiPixelCoordinates.cc.

206  {
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 }

References disk(), isFPix_(), quadrant(), DetId::rawId(), and signed_disk_.

Referenced by signed_disk_coord(), and signed_disk_ring_coord().

◆ signed_disk_coord() [1/5]

float SiPixelCoordinates::signed_disk_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 754 of file SiPixelCoordinates.cc.

754  {
755  if (!isFPix_(detid))
756  return -9999;
757  return signed_disk_coord(detid, pixel_(digi));
758 }

References isFPix_(), pixel_(), and signed_disk_coord().

◆ signed_disk_coord() [2/5]

float SiPixelCoordinates::signed_disk_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 759 of file SiPixelCoordinates.cc.

759  {
760  if (!isFPix_(detid))
761  return -9999;
762  return signed_disk_coord(detid, pixel_(cluster));
763 }

References isFPix_(), pixel_(), and signed_disk_coord().

◆ signed_disk_coord() [3/5]

float SiPixelCoordinates::signed_disk_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 744 of file SiPixelCoordinates.cc.

744  {
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 }

References isFPix_(), muonClassificationByHits_cfi::pixel, ring(), ring_coord(), and signed_disk().

Referenced by signed_disk_coord().

◆ signed_disk_coord() [4/5]

float SiPixelCoordinates::signed_disk_coord ( const SiPixelRecHit rechit)

Definition at line 764 of file SiPixelCoordinates.cc.

764  {
765  if (!isFPix_(rechit->geographicalId()))
766  return -9999;
767  return signed_disk_coord(rechit->geographicalId(), pixel_(rechit));
768 }

References TrackingRecHit::geographicalId(), isFPix_(), pixel_(), and signed_disk_coord().

◆ signed_disk_coord() [5/5]

float SiPixelCoordinates::signed_disk_coord ( const TrackingRecHit rechit)

Definition at line 769 of file SiPixelCoordinates.cc.

769  {
770  if (!isFPix_(rechit->geographicalId()))
771  return -9999;
772  return signed_disk_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
773 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isFPix_(), and signed_disk_coord().

◆ signed_disk_ring_coord() [1/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 823 of file SiPixelCoordinates.cc.

823  {
824  if (!isFPix_(detid))
825  return -9999;
826  return signed_disk_ring_coord(detid, pixel_(digi));
827 }

References isFPix_(), pixel_(), and signed_disk_ring_coord().

◆ signed_disk_ring_coord() [2/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 828 of file SiPixelCoordinates.cc.

828  {
829  if (!isFPix_(detid))
830  return -9999;
831  return signed_disk_ring_coord(detid, pixel_(cluster));
832 }

References isFPix_(), pixel_(), and signed_disk_ring_coord().

◆ signed_disk_ring_coord() [3/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 810 of file SiPixelCoordinates.cc.

810  {
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 }

References isFPix_(), muonClassificationByHits_cfi::pixel, ring_coord(), and signed_disk().

Referenced by signed_disk_ring_coord().

◆ signed_disk_ring_coord() [4/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const SiPixelRecHit rechit)

Definition at line 833 of file SiPixelCoordinates.cc.

833  {
834  if (!isFPix_(rechit->geographicalId()))
835  return -9999;
836  return signed_disk_ring_coord(rechit->geographicalId(), pixel_(rechit));
837 }

References TrackingRecHit::geographicalId(), isFPix_(), pixel_(), and signed_disk_ring_coord().

◆ signed_disk_ring_coord() [5/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const TrackingRecHit rechit)

Definition at line 838 of file SiPixelCoordinates.cc.

838  {
839  if (!isFPix_(rechit->geographicalId()))
840  return -9999;
841  return signed_disk_ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
842 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isFPix_(), and signed_disk_ring_coord().

◆ signed_ladder()

int SiPixelCoordinates::signed_ladder ( const DetId detid)

Definition at line 122 of file SiPixelCoordinates.cc.

122  {
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 }

References isBPix_(), PixelBarrelName::ladderName(), phase_, quadrant(), DetId::rawId(), signed_ladder_, and tTopo_.

Referenced by signed_ladder_coord().

◆ signed_ladder_coord() [1/5]

float SiPixelCoordinates::signed_ladder_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 626 of file SiPixelCoordinates.cc.

626  {
627  if (!isBPix_(detid))
628  return -9999;
629  return signed_ladder_coord(detid, pixel_(digi));
630 }

References isBPix_(), pixel_(), and signed_ladder_coord().

◆ signed_ladder_coord() [2/5]

float SiPixelCoordinates::signed_ladder_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 631 of file SiPixelCoordinates.cc.

631  {
632  if (!isBPix_(detid))
633  return -9999;
634  return signed_ladder_coord(detid, pixel_(cluster));
635 }

References isBPix_(), pixel_(), and signed_ladder_coord().

◆ signed_ladder_coord() [3/5]

float SiPixelCoordinates::signed_ladder_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 617 of file SiPixelCoordinates.cc.

617  {
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 }

References flipped(), half(), isBPix_(), muonClassificationByHits_cfi::pixel, Validation_hcalonly_cfi::sign, signed_ladder(), and xcoord_on_module_().

Referenced by signed_ladder_coord().

◆ signed_ladder_coord() [4/5]

float SiPixelCoordinates::signed_ladder_coord ( const SiPixelRecHit rechit)

Definition at line 636 of file SiPixelCoordinates.cc.

636  {
637  if (!isBPix_(rechit->geographicalId()))
638  return -9999;
639  return signed_ladder_coord(rechit->geographicalId(), pixel_(rechit));
640 }

References TrackingRecHit::geographicalId(), isBPix_(), pixel_(), and signed_ladder_coord().

◆ signed_ladder_coord() [5/5]

float SiPixelCoordinates::signed_ladder_coord ( const TrackingRecHit rechit)

Definition at line 641 of file SiPixelCoordinates.cc.

641  {
642  if (!isBPix_(rechit->geographicalId()))
643  return -9999;
644  return signed_ladder_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
645 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isBPix_(), and signed_ladder_coord().

◆ signed_module()

int SiPixelCoordinates::signed_module ( const DetId detid)

Definition at line 135 of file SiPixelCoordinates.cc.

135  {
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 }

References isBPix_(), PixelBarrelName::moduleName(), phase_, quadrant(), DetId::rawId(), signed_module_, and tTopo_.

Referenced by signed_module_coord().

◆ signed_module_coord() [1/5]

float SiPixelCoordinates::signed_module_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 566 of file SiPixelCoordinates.cc.

566  {
567  if (!isBPix_(detid))
568  return -9999;
569  return signed_module_coord(detid, pixel_(digi));
570 }

References isBPix_(), pixel_(), and signed_module_coord().

◆ signed_module_coord() [2/5]

float SiPixelCoordinates::signed_module_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 571 of file SiPixelCoordinates.cc.

571  {
572  if (!isBPix_(detid))
573  return -9999;
574  return signed_module_coord(detid, pixel_(cluster));
575 }

References isBPix_(), pixel_(), and signed_module_coord().

◆ signed_module_coord() [3/5]

float SiPixelCoordinates::signed_module_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 559 of file SiPixelCoordinates.cc.

559  {
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 }

References isBPix_(), muonClassificationByHits_cfi::pixel, signed_module(), and ycoord_on_module_().

Referenced by signed_module_coord().

◆ signed_module_coord() [4/5]

float SiPixelCoordinates::signed_module_coord ( const SiPixelRecHit rechit)

Definition at line 576 of file SiPixelCoordinates.cc.

576  {
577  if (!isBPix_(rechit->geographicalId()))
578  return -9999;
579  return signed_module_coord(rechit->geographicalId(), pixel_(rechit));
580 }

References TrackingRecHit::geographicalId(), isBPix_(), pixel_(), and signed_module_coord().

◆ signed_module_coord() [5/5]

float SiPixelCoordinates::signed_module_coord ( const TrackingRecHit rechit)

Definition at line 581 of file SiPixelCoordinates.cc.

581  {
582  if (!isBPix_(rechit->geographicalId()))
583  return -9999;
584  return signed_module_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
585 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isBPix_(), and signed_module_coord().

◆ signed_shifted_blade_panel_coord() [1/5]

float SiPixelCoordinates::signed_shifted_blade_panel_coord ( const DetId detid,
const PixelDigi digi 
)

Definition at line 1022 of file SiPixelCoordinates.cc.

1022  {
1023  if (!isFPix_(detid))
1024  return -9999;
1025  return signed_shifted_blade_panel_coord(detid, pixel_(digi));
1026 }

References isFPix_(), pixel_(), and signed_shifted_blade_panel_coord().

◆ signed_shifted_blade_panel_coord() [2/5]

float SiPixelCoordinates::signed_shifted_blade_panel_coord ( const DetId detid,
const SiPixelCluster cluster 
)

Definition at line 1027 of file SiPixelCoordinates.cc.

1027  {
1028  if (!isFPix_(detid))
1029  return -9999;
1030  return signed_shifted_blade_panel_coord(detid, pixel_(cluster));
1031 }

References isFPix_(), pixel_(), and signed_shifted_blade_panel_coord().

◆ signed_shifted_blade_panel_coord() [3/5]

float SiPixelCoordinates::signed_shifted_blade_panel_coord ( const DetId detid,
const std::pair< int, int > &  pixel 
)

Definition at line 1012 of file SiPixelCoordinates.cc.

1012  {
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 }

References isFPix_(), panel(), phase_, muonClassificationByHits_cfi::pixel, ring(), signed_blade(), and signed_blade_coord().

Referenced by signed_shifted_blade_panel_coord().

◆ signed_shifted_blade_panel_coord() [4/5]

float SiPixelCoordinates::signed_shifted_blade_panel_coord ( const SiPixelRecHit rechit)

Definition at line 1032 of file SiPixelCoordinates.cc.

1032  {
1033  if (!isFPix_(rechit->geographicalId()))
1034  return -9999;
1035  return signed_shifted_blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
1036 }

References TrackingRecHit::geographicalId(), isFPix_(), pixel_(), and signed_shifted_blade_panel_coord().

◆ signed_shifted_blade_panel_coord() [5/5]

float SiPixelCoordinates::signed_shifted_blade_panel_coord ( const TrackingRecHit rechit)

Definition at line 1037 of file SiPixelCoordinates.cc.

1037  {
1038  if (!isFPix_(rechit->geographicalId()))
1039  return -9999;
1040  return signed_shifted_blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
1041 }

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), isFPix_(), and signed_shifted_blade_panel_coord().

◆ xcoord_on_module_()

float SiPixelCoordinates::xcoord_on_module_ ( const DetId detid,
const std::pair< int, int > &  pixel 
)
private

Definition at line 332 of file SiPixelCoordinates.cc.

332  {
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 }

References TrackerGeometry::idToDetUnit(), PixelTopology::nrows(), phase_, muonClassificationByHits_cfi::pixel, PixelGeomDetUnit::specificTopology(), and tGeom_.

Referenced by blade_coord(), ladder_coord(), ring_coord(), signed_blade_coord(), and signed_ladder_coord().

◆ ycoord_on_module_()

float SiPixelCoordinates::ycoord_on_module_ ( const DetId detid,
const std::pair< int, int > &  pixel 
)
private

Definition at line 346 of file SiPixelCoordinates.cc.

346  {
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 }

References TrackerGeometry::idToDetUnit(), isFPix_(), hgcalPlots::ncols, phase_, muonClassificationByHits_cfi::pixel, PixelGeomDetUnit::specificTopology(), and tGeom_.

Referenced by blade_coord(), module_coord(), ring_coord(), signed_blade_coord(), and signed_module_coord().

Member Data Documentation

◆ blade_

std::unordered_map<uint32_t, int> SiPixelCoordinates::blade_
private

Definition at line 187 of file SiPixelCoordinates.h.

Referenced by blade().

◆ cablingMap_

const SiPixelFedCablingMap* SiPixelCoordinates::cablingMap_
private

Definition at line 168 of file SiPixelCoordinates.h.

Referenced by channel(), fedid(), init(), and roc().

◆ channel_

std::unordered_map<uint64_t, unsigned int> SiPixelCoordinates::channel_
private

Definition at line 191 of file SiPixelCoordinates.h.

Referenced by channel(), and roc().

◆ disk_

std::unordered_map<uint32_t, int> SiPixelCoordinates::disk_
private

Definition at line 183 of file SiPixelCoordinates.h.

Referenced by disk().

◆ fedid_

std::unordered_map<uint32_t, unsigned int> SiPixelCoordinates::fedid_
private

Definition at line 190 of file SiPixelCoordinates.h.

Referenced by fedid(), and init().

◆ flipped_

std::unordered_map<uint32_t, int> SiPixelCoordinates::flipped_
private

Definition at line 182 of file SiPixelCoordinates.h.

Referenced by flipped().

◆ half_

std::unordered_map<uint32_t, int> SiPixelCoordinates::half_
private

Definition at line 180 of file SiPixelCoordinates.h.

Referenced by half().

◆ ladder_

std::unordered_map<uint32_t, int> SiPixelCoordinates::ladder_
private

Definition at line 177 of file SiPixelCoordinates.h.

Referenced by ladder().

◆ layer_

std::unordered_map<uint32_t, int> SiPixelCoordinates::layer_
private

Definition at line 175 of file SiPixelCoordinates.h.

Referenced by layer().

◆ module_

std::unordered_map<uint32_t, int> SiPixelCoordinates::module_
private

Definition at line 174 of file SiPixelCoordinates.h.

Referenced by module().

◆ outer_

std::unordered_map<uint32_t, int> SiPixelCoordinates::outer_
private

Definition at line 181 of file SiPixelCoordinates.h.

Referenced by outer().

◆ panel_

std::unordered_map<uint32_t, int> SiPixelCoordinates::panel_
private

Definition at line 185 of file SiPixelCoordinates.h.

Referenced by panel().

◆ phase_

int SiPixelCoordinates::phase_
private

◆ quadrant_

std::unordered_map<uint32_t, int> SiPixelCoordinates::quadrant_
private

Definition at line 172 of file SiPixelCoordinates.h.

Referenced by quadrant().

◆ ring_

std::unordered_map<uint32_t, int> SiPixelCoordinates::ring_
private

Definition at line 186 of file SiPixelCoordinates.h.

Referenced by ring().

◆ roc_

std::unordered_map<uint64_t, unsigned int> SiPixelCoordinates::roc_
private

Definition at line 192 of file SiPixelCoordinates.h.

Referenced by channel(), and roc().

◆ sector_

std::unordered_map<uint32_t, int> SiPixelCoordinates::sector_
private

Definition at line 176 of file SiPixelCoordinates.h.

Referenced by sector().

◆ side_

std::unordered_map<uint32_t, int> SiPixelCoordinates::side_
private

Definition at line 173 of file SiPixelCoordinates.h.

Referenced by side().

◆ signed_blade_

std::unordered_map<uint32_t, int> SiPixelCoordinates::signed_blade_
private

Definition at line 188 of file SiPixelCoordinates.h.

Referenced by signed_blade().

◆ signed_disk_

std::unordered_map<uint32_t, int> SiPixelCoordinates::signed_disk_
private

Definition at line 184 of file SiPixelCoordinates.h.

Referenced by signed_disk().

◆ signed_ladder_

std::unordered_map<uint32_t, int> SiPixelCoordinates::signed_ladder_
private

Definition at line 178 of file SiPixelCoordinates.h.

Referenced by signed_ladder().

◆ signed_module_

std::unordered_map<uint32_t, int> SiPixelCoordinates::signed_module_
private

Definition at line 179 of file SiPixelCoordinates.h.

Referenced by signed_module().

◆ tGeom_

const TrackerGeometry* SiPixelCoordinates::tGeom_
private

Definition at line 167 of file SiPixelCoordinates.h.

Referenced by channel(), init(), roc(), xcoord_on_module_(), and ycoord_on_module_().

◆ tTopo_

const TrackerTopology* SiPixelCoordinates::tTopo_
private
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
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
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
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
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
SiPixelCoordinates::channel_
std::unordered_map< uint64_t, unsigned int > channel_
Definition: SiPixelCoordinates.h:191
PixelEndcapName::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapName.h:42
SiPixelCoordinates::flipped_
std::unordered_map< uint32_t, int > flipped_
Definition: SiPixelCoordinates.h:182
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
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
GeomDetEnumerators::PixelBarrel
Definition: GeomDetEnumerators.h:11
SiPixelCoordinates::cablingMap_
const SiPixelFedCablingMap * cablingMap_
Definition: SiPixelCoordinates.h:168
PixelEndcapName
Definition: PixelEndcapName.h:16
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
SiPixelPI::phase
phase
Definition: SiPixelPayloadInspectorHelper.h:39
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
DetId::Tracker
Definition: DetId.h:25
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
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::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
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
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
BaseTrackerRecHit::localPosition
LocalPoint localPosition() const override
Definition: BaseTrackerRecHit.h:56
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
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
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
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