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 std::pair< int, int > &)
 
float blade_coord (const DetId &, const PixelDigi *)
 
float blade_coord (const DetId &, const SiPixelCluster *)
 
float blade_coord (const SiPixelRecHit *)
 
float blade_coord (const TrackingRecHit *)
 
float blade_panel_coord (const DetId &, const std::pair< int, int > &)
 
float blade_panel_coord (const DetId &, const PixelDigi *)
 
float blade_panel_coord (const DetId &, const SiPixelCluster *)
 
float blade_panel_coord (const SiPixelRecHit *)
 
float blade_panel_coord (const TrackingRecHit *)
 
int channel (const DetId &, const std::pair< int, int > &)
 
int channel (const DetId &, const PixelDigi *)
 
int channel (const DetId &, const SiPixelCluster *)
 
int channel (const SiPixelRecHit *)
 
int channel (const TrackingRecHit *)
 
int disk (const DetId &)
 
float disk_coord (const DetId &, const std::pair< int, int > &)
 
float disk_coord (const DetId &, const PixelDigi *)
 
float disk_coord (const DetId &, const SiPixelCluster *)
 
float disk_coord (const SiPixelRecHit *)
 
float disk_coord (const TrackingRecHit *)
 
float disk_ring_coord (const DetId &, const std::pair< int, int > &)
 
float disk_ring_coord (const DetId &, const PixelDigi *)
 
float disk_ring_coord (const DetId &, const SiPixelCluster *)
 
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 std::pair< int, int > &)
 
float ladder_coord (const DetId &, const PixelDigi *)
 
float ladder_coord (const DetId &, const SiPixelCluster *)
 
float ladder_coord (const SiPixelRecHit *)
 
float ladder_coord (const TrackingRecHit *)
 
int layer (const DetId &)
 
int module (const DetId &)
 
float module_coord (const DetId &, const std::pair< int, int > &)
 
float module_coord (const DetId &, const PixelDigi *)
 
float module_coord (const DetId &, const SiPixelCluster *)
 
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 std::pair< int, int > &)
 
float ring_coord (const DetId &, const PixelDigi *)
 
float ring_coord (const DetId &, const SiPixelCluster *)
 
float ring_coord (const SiPixelRecHit *)
 
float ring_coord (const TrackingRecHit *)
 
int roc (const DetId &, const std::pair< int, int > &)
 
int roc (const DetId &, const PixelDigi *)
 
int roc (const DetId &, const SiPixelCluster *)
 
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 std::pair< int, int > &)
 
float signed_blade_coord (const DetId &, const PixelDigi *)
 
float signed_blade_coord (const DetId &, const SiPixelCluster *)
 
float signed_blade_coord (const SiPixelRecHit *)
 
float signed_blade_coord (const TrackingRecHit *)
 
float signed_blade_panel_coord (const DetId &, const std::pair< int, int > &)
 
float signed_blade_panel_coord (const DetId &, const PixelDigi *)
 
float signed_blade_panel_coord (const DetId &, const SiPixelCluster *)
 
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 std::pair< int, int > &)
 
float signed_disk_coord (const DetId &, const PixelDigi *)
 
float signed_disk_coord (const DetId &, const SiPixelCluster *)
 
float signed_disk_coord (const SiPixelRecHit *)
 
float signed_disk_coord (const TrackingRecHit *)
 
float signed_disk_ring_coord (const DetId &, const std::pair< int, int > &)
 
float signed_disk_ring_coord (const DetId &, const PixelDigi *)
 
float signed_disk_ring_coord (const DetId &, const SiPixelCluster *)
 
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 std::pair< int, int > &)
 
float signed_ladder_coord (const DetId &, const PixelDigi *)
 
float signed_ladder_coord (const DetId &, const SiPixelCluster *)
 
float signed_ladder_coord (const SiPixelRecHit *)
 
float signed_ladder_coord (const TrackingRecHit *)
 
int signed_module (const DetId &)
 
float signed_module_coord (const DetId &, const std::pair< int, int > &)
 
float signed_module_coord (const DetId &, const PixelDigi *)
 
float signed_module_coord (const DetId &, const SiPixelCluster *)
 
float signed_module_coord (const SiPixelRecHit *)
 
float signed_module_coord (const TrackingRecHit *)
 
float signed_shifted_blade_panel_coord (const DetId &, const std::pair< int, int > &)
 
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 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.

References phase_.

22 { phase_ = -1; }

◆ SiPixelCoordinates() [2/2]

SiPixelCoordinates::SiPixelCoordinates ( int  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.

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

Referenced by blade_coord(), and blade_panel_coord().

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 }
unsigned int pxfBlade(const DetId &id) const
const TrackerTopology * tTopo_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::unordered_map< uint32_t, int > blade_
bool isFPix_(const DetId &)

◆ blade_coord() [1/5]

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

Definition at line 855 of file SiPixelCoordinates.cc.

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().

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 }
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
int side(const DetId &)
int blade(const DetId &)
float blade_coord(const DetId &, const std::pair< int, int > &)
int module(const DetId &)
int panel(const DetId &)
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ blade_coord() [2/5]

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

Definition at line 872 of file SiPixelCoordinates.cc.

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

872  {
873  if (!isFPix_(detid))
874  return -9999;
875  return blade_coord(detid, pixel_(digi));
876 }
float blade_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ blade_coord() [3/5]

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

Definition at line 877 of file SiPixelCoordinates.cc.

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

877  {
878  if (!isFPix_(detid))
879  return -9999;
880  return blade_coord(detid, pixel_(cluster));
881 }
float blade_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ blade_coord() [4/5]

float SiPixelCoordinates::blade_coord ( const SiPixelRecHit rechit)

Definition at line 882 of file SiPixelCoordinates.cc.

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

882  {
883  if (!isFPix_(rechit->geographicalId()))
884  return -9999;
885  return blade_coord(rechit->geographicalId(), pixel_(rechit));
886 }
float blade_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
bool isFPix_(const DetId &)

◆ blade_coord() [5/5]

float SiPixelCoordinates::blade_coord ( const TrackingRecHit rechit)

Definition at line 887 of file SiPixelCoordinates.cc.

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

887  {
888  if (!isFPix_(rechit->geographicalId()))
889  return -9999;
890  return blade_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
891 }
float blade_coord(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
bool isFPix_(const DetId &)

◆ blade_panel_coord() [1/5]

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

Definition at line 943 of file SiPixelCoordinates.cc.

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

Referenced by blade_panel_coord().

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 }
int blade(const DetId &)
float blade_coord(const DetId &, const std::pair< int, int > &)
int panel(const DetId &)
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ blade_panel_coord() [2/5]

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

Definition at line 951 of file SiPixelCoordinates.cc.

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

951  {
952  if (!isFPix_(detid))
953  return -9999;
954  return blade_panel_coord(detid, pixel_(digi));
955 }
std::pair< int, int > pixel_(const PixelDigi *)
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ blade_panel_coord() [3/5]

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

Definition at line 956 of file SiPixelCoordinates.cc.

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

956  {
957  if (!isFPix_(detid))
958  return -9999;
959  return blade_panel_coord(detid, pixel_(cluster));
960 }
std::pair< int, int > pixel_(const PixelDigi *)
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ blade_panel_coord() [4/5]

float SiPixelCoordinates::blade_panel_coord ( const SiPixelRecHit rechit)

Definition at line 961 of file SiPixelCoordinates.cc.

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

961  {
962  if (!isFPix_(rechit->geographicalId()))
963  return -9999;
964  return blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
965 }
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ blade_panel_coord() [5/5]

float SiPixelCoordinates::blade_panel_coord ( const TrackingRecHit rechit)

Definition at line 966 of file SiPixelCoordinates.cc.

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

966  {
967  if (!isFPix_(rechit->geographicalId()))
968  return -9999;
969  return blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
970 }
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ channel() [1/5]

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

Definition at line 371 of file SiPixelCoordinates.cc.

References cablingMap_, channel_, PixelTopology::colsperroc(), 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().

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 }
std::unordered_map< uint64_t, unsigned int > channel_
bool isPixel_(const DetId &)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int side(const DetId &)
virtual int rowsperroc() const =0
unsigned int fedid(const DetId &)
int half(const DetId &)
virtual int colsperroc() const =0
const SiPixelFedCablingMap * cablingMap_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int roc(const DetId &, const std::pair< int, int > &)
unsigned long long uint64_t
Definition: Time.h:13
const TrackerGeometry * tGeom_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::unordered_map< uint64_t, unsigned int > roc_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37

◆ channel() [2/5]

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

Definition at line 408 of file SiPixelCoordinates.cc.

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

408  {
409  if (!isPixel_(detid))
410  return -9999;
411  return channel(detid, pixel_(digi));
412 }
bool isPixel_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int channel(const DetId &, const std::pair< int, int > &)

◆ channel() [3/5]

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

Definition at line 413 of file SiPixelCoordinates.cc.

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

413  {
414  if (!isPixel_(detid))
415  return -9999;
416  return channel(detid, pixel_(cluster));
417 }
bool isPixel_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int channel(const DetId &, const std::pair< int, int > &)

◆ channel() [4/5]

int SiPixelCoordinates::channel ( const SiPixelRecHit rechit)

Definition at line 418 of file SiPixelCoordinates.cc.

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

418  {
419  if (!isPixel_(rechit->geographicalId()))
420  return -9999;
421  return channel(rechit->geographicalId(), pixel_(rechit));
422 }
bool isPixel_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int channel(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const

◆ channel() [5/5]

int SiPixelCoordinates::channel ( const TrackingRecHit rechit)

Definition at line 423 of file SiPixelCoordinates.cc.

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

423  {
424  if (!isPixel_(rechit->geographicalId()))
425  return -9999;
426  return channel(static_cast<const SiPixelRecHit*>(rechit->hit()));
427 }
bool isPixel_(const DetId &)
int channel(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const

◆ disk()

int SiPixelCoordinates::disk ( const DetId detid)

Definition at line 196 of file SiPixelCoordinates.cc.

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

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

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 }
const TrackerTopology * tTopo_
unsigned int pxfDisk(const DetId &id) const
std::unordered_map< uint32_t, int > disk_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isFPix_(const DetId &)

◆ disk_coord() [1/5]

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

Definition at line 713 of file SiPixelCoordinates.cc.

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

Referenced by disk_coord().

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 }
float ring_coord(const DetId &, const std::pair< int, int > &)
float disk_coord(const DetId &, const std::pair< int, int > &)
int ring(const DetId &)
int disk(const DetId &)
bool isFPix_(const DetId &)

◆ disk_coord() [2/5]

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

Definition at line 720 of file SiPixelCoordinates.cc.

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

720  {
721  if (!isFPix_(detid))
722  return -9999;
723  return disk_coord(detid, pixel_(digi));
724 }
float disk_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ disk_coord() [3/5]

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

Definition at line 725 of file SiPixelCoordinates.cc.

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

725  {
726  if (!isFPix_(detid))
727  return -9999;
728  return disk_coord(detid, pixel_(cluster));
729 }
float disk_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ disk_coord() [4/5]

float SiPixelCoordinates::disk_coord ( const SiPixelRecHit rechit)

Definition at line 730 of file SiPixelCoordinates.cc.

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

730  {
731  if (!isFPix_(rechit->geographicalId()))
732  return -9999;
733  return disk_coord(rechit->geographicalId(), pixel_(rechit));
734 }
float disk_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
bool isFPix_(const DetId &)

◆ disk_coord() [5/5]

float SiPixelCoordinates::disk_coord ( const TrackingRecHit rechit)

Definition at line 735 of file SiPixelCoordinates.cc.

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

735  {
736  if (!isFPix_(rechit->geographicalId()))
737  return -9999;
738  return disk_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
739 }
float disk_coord(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
bool isFPix_(const DetId &)

◆ disk_ring_coord() [1/5]

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

Definition at line 777 of file SiPixelCoordinates.cc.

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

Referenced by disk_ring_coord().

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 }
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
float ring_coord(const DetId &, const std::pair< int, int > &)
int disk(const DetId &)
bool isFPix_(const DetId &)

◆ disk_ring_coord() [2/5]

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

Definition at line 787 of file SiPixelCoordinates.cc.

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

787  {
788  if (!isFPix_(detid))
789  return -9999;
790  return disk_ring_coord(detid, pixel_(digi));
791 }
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ disk_ring_coord() [3/5]

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

Definition at line 792 of file SiPixelCoordinates.cc.

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

792  {
793  if (!isFPix_(detid))
794  return -9999;
795  return disk_ring_coord(detid, pixel_(cluster));
796 }
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ disk_ring_coord() [4/5]

float SiPixelCoordinates::disk_ring_coord ( const SiPixelRecHit rechit)

Definition at line 797 of file SiPixelCoordinates.cc.

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

797  {
798  if (!isFPix_(rechit->geographicalId()))
799  return -9999;
800  return disk_ring_coord(rechit->geographicalId(), pixel_(rechit));
801 }
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
bool isFPix_(const DetId &)

◆ disk_ring_coord() [5/5]

float SiPixelCoordinates::disk_ring_coord ( const TrackingRecHit rechit)

Definition at line 802 of file SiPixelCoordinates.cc.

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

802  {
803  if (!isFPix_(rechit->geographicalId()))
804  return -9999;
805  return disk_ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
806 }
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
bool isFPix_(const DetId &)

◆ fedid()

unsigned int SiPixelCoordinates::fedid ( const DetId detid)

Definition at line 269 of file SiPixelCoordinates.cc.

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

Referenced by channel(), and roc().

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 }
bool isPixel_(const DetId &)
unsigned int fedid(const DetId &)
const SiPixelFedCablingMap * cablingMap_
std::vector< unsigned int > fedIds() const
bool hasDetUnit(uint32_t radId) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::unordered_map< uint32_t, unsigned int > fedid_

◆ flipped()

int SiPixelCoordinates::flipped ( const DetId detid)

Definition at line 184 of file SiPixelCoordinates.cc.

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

Referenced by ladder_coord(), and signed_ladder_coord().

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 }
int flipped(const DetId &)
bool isBPix_(const DetId &)
std::unordered_map< uint32_t, int > flipped_
int outer(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ half()

int SiPixelCoordinates::half ( const DetId detid)

Definition at line 147 of file SiPixelCoordinates.cc.

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

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

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 }
std::unordered_map< uint32_t, int > half_
const TrackerTopology * tTopo_
bool isBPix_(const DetId &)
bool isHalfModule() const
full or half module
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ init()

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

Definition at line 30 of file SiPixelCoordinates.cc.

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

Referenced by GeneralPurposeTrackAnalyzer::beginRun(), and SiPixelStatusHarvester::dqmEndRun().

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 }
const TrackerTopology * tTopo_
bool isThere(GeomDetEnumerators::SubDetector subdet) const
const SiPixelFedCablingMap * cablingMap_
const TrackerGeometry * tGeom_
std::unordered_map< uint32_t, unsigned int > det2fedMap() const final
std::unordered_map< uint32_t, unsigned int > fedid_

◆ isBPix_()

bool SiPixelCoordinates::isBPix_ ( const DetId detid)
private

Definition at line 295 of file SiPixelCoordinates.cc.

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().

295  {
296  if (detid.det() != DetId::Tracker)
297  return false;
299  return true;
300  return false;
301 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ isFPix_()

bool SiPixelCoordinates::isFPix_ ( const DetId detid)
private

Definition at line 302 of file SiPixelCoordinates.cc.

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

Referenced by blade(), blade_coord(), blade_panel_coord(), disk(), disk_coord(), disk_ring_coord(), panel(), ring(), ring_coord(), signed_blade(), signed_blade_coord(), signed_blade_panel_coord(), signed_disk(), signed_disk_coord(), signed_disk_ring_coord(), signed_shifted_blade_panel_coord(), and ycoord_on_module_().

302  {
303  if (detid.det() != DetId::Tracker)
304  return false;
306  return true;
307  return false;
308 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ isPixel_()

bool SiPixelCoordinates::isPixel_ ( const DetId detid)
private

Definition at line 286 of file SiPixelCoordinates.cc.

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

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

286  {
287  if (detid.det() != DetId::Tracker)
288  return false;
290  return true;
292  return true;
293  return false;
294 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ ladder()

int SiPixelCoordinates::ladder ( const DetId detid)

Definition at line 112 of file SiPixelCoordinates.cc.

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

Referenced by ladder_coord().

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 }
std::unordered_map< uint32_t, int > ladder_
const TrackerTopology * tTopo_
unsigned int pxbLadder(const DetId &id) const
bool isBPix_(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ ladder_coord() [1/5]

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

Definition at line 587 of file SiPixelCoordinates.cc.

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

Referenced by ladder_coord().

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 }
int flipped(const DetId &)
bool isBPix_(const DetId &)
int half(const DetId &)
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
int ladder(const DetId &)

◆ ladder_coord() [2/5]

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

Definition at line 596 of file SiPixelCoordinates.cc.

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

596  {
597  if (!isBPix_(detid))
598  return -9999;
599  return ladder_coord(detid, pixel_(digi));
600 }
float ladder_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)

◆ ladder_coord() [3/5]

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

Definition at line 601 of file SiPixelCoordinates.cc.

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

601  {
602  if (!isBPix_(detid))
603  return -9999;
604  return ladder_coord(detid, pixel_(cluster));
605 }
float ladder_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)

◆ ladder_coord() [4/5]

float SiPixelCoordinates::ladder_coord ( const SiPixelRecHit rechit)

Definition at line 606 of file SiPixelCoordinates.cc.

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

606  {
607  if (!isBPix_(rechit->geographicalId()))
608  return -9999;
609  return ladder_coord(rechit->geographicalId(), pixel_(rechit));
610 }
float ladder_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const

◆ ladder_coord() [5/5]

float SiPixelCoordinates::ladder_coord ( const TrackingRecHit rechit)

Definition at line 611 of file SiPixelCoordinates.cc.

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

611  {
612  if (!isBPix_(rechit->geographicalId()))
613  return -9999;
614  return ladder_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
615 }
float ladder_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const

◆ layer()

int SiPixelCoordinates::layer ( const DetId detid)

Definition at line 94 of file SiPixelCoordinates.cc.

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().

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 }
unsigned int pxbLayer(const DetId &id) const
const TrackerTopology * tTopo_
bool isBPix_(const DetId &)
std::unordered_map< uint32_t, int > layer_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ module()

int SiPixelCoordinates::module ( const DetId detid)

Definition at line 82 of file SiPixelCoordinates.cc.

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().

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 }
bool isPixel_(const DetId &)
unsigned int pxfModule(const DetId &id) const
const TrackerTopology * tTopo_
std::unordered_map< uint32_t, int > module_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int pxbModule(const DetId &id) const

◆ module_coord() [1/5]

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

Definition at line 531 of file SiPixelCoordinates.cc.

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

Referenced by module_coord().

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 }
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
int module(const DetId &)
bool isBPix_(const DetId &)

◆ module_coord() [2/5]

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

Definition at line 538 of file SiPixelCoordinates.cc.

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

538  {
539  if (!isBPix_(detid))
540  return -9999;
541  return module_coord(detid, pixel_(digi));
542 }
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
float module_coord(const DetId &, const std::pair< int, int > &)

◆ module_coord() [3/5]

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

Definition at line 543 of file SiPixelCoordinates.cc.

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

543  {
544  if (!isBPix_(detid))
545  return -9999;
546  return module_coord(detid, pixel_(cluster));
547 }
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
float module_coord(const DetId &, const std::pair< int, int > &)

◆ module_coord() [4/5]

float SiPixelCoordinates::module_coord ( const SiPixelRecHit rechit)

Definition at line 548 of file SiPixelCoordinates.cc.

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

548  {
549  if (!isBPix_(rechit->geographicalId()))
550  return -9999;
551  return module_coord(rechit->geographicalId(), pixel_(rechit));
552 }
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float module_coord(const DetId &, const std::pair< int, int > &)

◆ module_coord() [5/5]

float SiPixelCoordinates::module_coord ( const TrackingRecHit rechit)

Definition at line 553 of file SiPixelCoordinates.cc.

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

553  {
554  if (!isBPix_(rechit->geographicalId()))
555  return -9999;
556  return module_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
557 }
bool isBPix_(const DetId &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
float module_coord(const DetId &, const std::pair< int, int > &)

◆ outer()

int SiPixelCoordinates::outer ( const DetId detid)

Definition at line 160 of file SiPixelCoordinates.cc.

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

Referenced by flipped().

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 }
unsigned int pxbLayer(const DetId &id) const
const TrackerTopology * tTopo_
unsigned int pxbLadder(const DetId &id) const
bool isBPix_(const DetId &)
int layer(const DetId &)
std::unordered_map< uint32_t, int > outer_
int outer(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ panel()

int SiPixelCoordinates::panel ( const DetId detid)

Definition at line 218 of file SiPixelCoordinates.cc.

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().

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 }
std::unordered_map< uint32_t, int > panel_
const TrackerTopology * tTopo_
unsigned int pxfPanel(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isFPix_(const DetId &)

◆ 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.

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

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 }
float y() const
float x() const
col
Definition: cuy.py:1009

◆ pixel_() [3/3]

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

Definition at line 320 of file SiPixelCoordinates.cc.

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

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 }
const GeomDetUnit * detUnit() const override
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
virtual int ncolumns() const =0
virtual int nrows() const =0
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
LocalPoint localPosition() const override
col
Definition: cuy.py:1009

◆ quadrant()

int SiPixelCoordinates::quadrant ( const DetId detid)

Definition at line 56 of file SiPixelCoordinates.cc.

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().

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 }
bool isPixel_(const DetId &)
const TrackerTopology * tTopo_
HalfCylinder halfCylinder() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Shell shell() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::unordered_map< uint32_t, int > quadrant_

◆ ring()

int SiPixelCoordinates::ring ( const DetId detid)

Definition at line 232 of file SiPixelCoordinates.cc.

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().

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 }
int ringName() const
ring Id
const TrackerTopology * tTopo_
int ring(const DetId &)
int module(const DetId &)
std::unordered_map< uint32_t, int > ring_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int panel(const DetId &)
bool isFPix_(const DetId &)

◆ ring_coord() [1/5]

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

Definition at line 654 of file SiPixelCoordinates.cc.

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().

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 }
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
float ring_coord(const DetId &, const std::pair< int, int > &)
int ring(const DetId &)
int module(const DetId &)
int panel(const DetId &)
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool isFPix_(const DetId &)

◆ ring_coord() [2/5]

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

Definition at line 686 of file SiPixelCoordinates.cc.

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

686  {
687  if (!isFPix_(detid))
688  return -9999;
689  return ring_coord(detid, pixel_(digi));
690 }
float ring_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ ring_coord() [3/5]

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

Definition at line 691 of file SiPixelCoordinates.cc.

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

691  {
692  if (!isFPix_(detid))
693  return -9999;
694  return ring_coord(detid, pixel_(cluster));
695 }
float ring_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ ring_coord() [4/5]

float SiPixelCoordinates::ring_coord ( const SiPixelRecHit rechit)

Definition at line 696 of file SiPixelCoordinates.cc.

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

696  {
697  if (!isFPix_(rechit->geographicalId()))
698  return -9999;
699  return ring_coord(rechit->geographicalId(), pixel_(rechit));
700 }
float ring_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
bool isFPix_(const DetId &)

◆ ring_coord() [5/5]

float SiPixelCoordinates::ring_coord ( const TrackingRecHit rechit)

Definition at line 701 of file SiPixelCoordinates.cc.

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

701  {
702  if (!isFPix_(rechit->geographicalId()))
703  return -9999;
704  return ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
705 }
float ring_coord(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
bool isFPix_(const DetId &)

◆ roc() [1/5]

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

Definition at line 442 of file SiPixelCoordinates.cc.

References cablingMap_, channel_, PixelTopology::colsperroc(), 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 GeneralPurposeTrackAnalyzer::analyze(), channel(), and roc().

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 }
std::unordered_map< uint64_t, unsigned int > channel_
bool isPixel_(const DetId &)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int side(const DetId &)
virtual int rowsperroc() const =0
unsigned int fedid(const DetId &)
int module(const DetId &)
int half(const DetId &)
virtual int colsperroc() const =0
const SiPixelFedCablingMap * cablingMap_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int roc(const DetId &, const std::pair< int, int > &)
unsigned long long uint64_t
Definition: Time.h:13
const TrackerGeometry * tGeom_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int panel(const DetId &)
std::unordered_map< uint64_t, unsigned int > roc_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37

◆ roc() [2/5]

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

Definition at line 505 of file SiPixelCoordinates.cc.

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

505  {
506  if (!isPixel_(detid))
507  return -9999;
508  return roc(detid, pixel_(digi));
509 }
bool isPixel_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int roc(const DetId &, const std::pair< int, int > &)

◆ roc() [3/5]

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

Definition at line 510 of file SiPixelCoordinates.cc.

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

510  {
511  if (!isPixel_(detid))
512  return -9999;
513  return roc(detid, pixel_(cluster));
514 }
bool isPixel_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int roc(const DetId &, const std::pair< int, int > &)

◆ roc() [4/5]

int SiPixelCoordinates::roc ( const SiPixelRecHit rechit)

Definition at line 515 of file SiPixelCoordinates.cc.

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

515  {
516  if (!isPixel_(rechit->geographicalId()))
517  return -9999;
518  return roc(rechit->geographicalId(), pixel_(rechit));
519 }
bool isPixel_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
int roc(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const

◆ roc() [5/5]

int SiPixelCoordinates::roc ( const TrackingRecHit rechit)

Definition at line 520 of file SiPixelCoordinates.cc.

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

520  {
521  if (!isPixel_(rechit->geographicalId()))
522  return -9999;
523  return roc(static_cast<const SiPixelRecHit*>(rechit->hit()));
524 }
bool isPixel_(const DetId &)
int roc(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const

◆ sector()

int SiPixelCoordinates::sector ( const DetId detid)

Definition at line 103 of file SiPixelCoordinates.cc.

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

Referenced by geometryXMLparser.DTAlignable::index().

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 }
std::unordered_map< uint32_t, int > sector_
const TrackerTopology * tTopo_
bool isBPix_(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int sectorName() const
sector id

◆ side()

int SiPixelCoordinates::side ( const DetId detid)

Definition at line 70 of file SiPixelCoordinates.cc.

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

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

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 }
bool isPixel_(const DetId &)
const TrackerTopology * tTopo_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int pxfSide(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::unordered_map< uint32_t, int > side_
int quadrant(const DetId &)

◆ signed_blade()

int SiPixelCoordinates::signed_blade ( const DetId detid)

Definition at line 257 of file SiPixelCoordinates.cc.

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().

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 }
int signed_blade(const DetId &)
int bladeName() const
blade id
const TrackerTopology * tTopo_
std::unordered_map< uint32_t, int > signed_blade_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int quadrant(const DetId &)
bool isFPix_(const DetId &)

◆ signed_blade_coord() [1/5]

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

Definition at line 900 of file SiPixelCoordinates.cc.

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().

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 }
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
int signed_blade(const DetId &)
int side(const DetId &)
int module(const DetId &)
int panel(const DetId &)
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_blade_coord() [2/5]

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

Definition at line 917 of file SiPixelCoordinates.cc.

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

917  {
918  if (!isFPix_(detid))
919  return -9999;
920  return signed_blade_coord(detid, pixel_(digi));
921 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_blade_coord() [3/5]

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

Definition at line 922 of file SiPixelCoordinates.cc.

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

922  {
923  if (!isFPix_(detid))
924  return -9999;
925  return signed_blade_coord(detid, pixel_(cluster));
926 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_blade_coord() [4/5]

float SiPixelCoordinates::signed_blade_coord ( const SiPixelRecHit rechit)

Definition at line 927 of file SiPixelCoordinates.cc.

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

927  {
928  if (!isFPix_(rechit->geographicalId()))
929  return -9999;
930  return signed_blade_coord(rechit->geographicalId(), pixel_(rechit));
931 }
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_blade_coord() [5/5]

float SiPixelCoordinates::signed_blade_coord ( const TrackingRecHit rechit)

Definition at line 932 of file SiPixelCoordinates.cc.

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

932  {
933  if (!isFPix_(rechit->geographicalId()))
934  return -9999;
935  return signed_blade_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
936 }
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_blade_panel_coord() [1/5]

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

Definition at line 978 of file SiPixelCoordinates.cc.

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

Referenced by signed_blade_panel_coord().

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 }
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
int signed_blade(const DetId &)
int panel(const DetId &)
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_blade_panel_coord() [2/5]

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

Definition at line 986 of file SiPixelCoordinates.cc.

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

986  {
987  if (!isFPix_(detid))
988  return -9999;
989  return signed_blade_panel_coord(detid, pixel_(digi));
990 }
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ signed_blade_panel_coord() [3/5]

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

Definition at line 991 of file SiPixelCoordinates.cc.

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

991  {
992  if (!isFPix_(detid))
993  return -9999;
994  return signed_blade_panel_coord(detid, pixel_(cluster));
995 }
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
bool isFPix_(const DetId &)

◆ signed_blade_panel_coord() [4/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const SiPixelRecHit rechit)

Definition at line 996 of file SiPixelCoordinates.cc.

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

996  {
997  if (!isFPix_(rechit->geographicalId()))
998  return -9999;
999  return signed_blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
1000 }
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
bool isFPix_(const DetId &)

◆ signed_blade_panel_coord() [5/5]

float SiPixelCoordinates::signed_blade_panel_coord ( const TrackingRecHit rechit)

Definition at line 1001 of file SiPixelCoordinates.cc.

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

1001  {
1002  if (!isFPix_(rechit->geographicalId()))
1003  return -9999;
1004  return signed_blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
1005 }
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
bool isFPix_(const DetId &)

◆ signed_disk()

int SiPixelCoordinates::signed_disk ( const DetId detid)

Definition at line 206 of file SiPixelCoordinates.cc.

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

Referenced by signed_disk_coord(), and signed_disk_ring_coord().

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 }
std::unordered_map< uint32_t, int > signed_disk_
int signed_disk(const DetId &)
int disk(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int quadrant(const DetId &)
bool isFPix_(const DetId &)

◆ signed_disk_coord() [1/5]

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

Definition at line 744 of file SiPixelCoordinates.cc.

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

Referenced by signed_disk_coord().

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 }
float ring_coord(const DetId &, const std::pair< int, int > &)
int signed_disk(const DetId &)
int ring(const DetId &)
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_coord() [2/5]

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

Definition at line 754 of file SiPixelCoordinates.cc.

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

754  {
755  if (!isFPix_(detid))
756  return -9999;
757  return signed_disk_coord(detid, pixel_(digi));
758 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_coord() [3/5]

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

Definition at line 759 of file SiPixelCoordinates.cc.

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

759  {
760  if (!isFPix_(detid))
761  return -9999;
762  return signed_disk_coord(detid, pixel_(cluster));
763 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_coord() [4/5]

float SiPixelCoordinates::signed_disk_coord ( const SiPixelRecHit rechit)

Definition at line 764 of file SiPixelCoordinates.cc.

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

764  {
765  if (!isFPix_(rechit->geographicalId()))
766  return -9999;
767  return signed_disk_coord(rechit->geographicalId(), pixel_(rechit));
768 }
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_coord() [5/5]

float SiPixelCoordinates::signed_disk_coord ( const TrackingRecHit rechit)

Definition at line 769 of file SiPixelCoordinates.cc.

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

769  {
770  if (!isFPix_(rechit->geographicalId()))
771  return -9999;
772  return signed_disk_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
773 }
DetId geographicalId() const
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
virtual TrackingRecHit const * hit() const
bool isFPix_(const DetId &)

◆ signed_disk_ring_coord() [1/5]

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

Definition at line 810 of file SiPixelCoordinates.cc.

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

Referenced by signed_disk_ring_coord().

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 }
float ring_coord(const DetId &, const std::pair< int, int > &)
int signed_disk(const DetId &)
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_ring_coord() [2/5]

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

Definition at line 823 of file SiPixelCoordinates.cc.

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

823  {
824  if (!isFPix_(detid))
825  return -9999;
826  return signed_disk_ring_coord(detid, pixel_(digi));
827 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_ring_coord() [3/5]

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

Definition at line 828 of file SiPixelCoordinates.cc.

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

828  {
829  if (!isFPix_(detid))
830  return -9999;
831  return signed_disk_ring_coord(detid, pixel_(cluster));
832 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_ring_coord() [4/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const SiPixelRecHit rechit)

Definition at line 833 of file SiPixelCoordinates.cc.

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

833  {
834  if (!isFPix_(rechit->geographicalId()))
835  return -9999;
836  return signed_disk_ring_coord(rechit->geographicalId(), pixel_(rechit));
837 }
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_disk_ring_coord() [5/5]

float SiPixelCoordinates::signed_disk_ring_coord ( const TrackingRecHit rechit)

Definition at line 838 of file SiPixelCoordinates.cc.

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

838  {
839  if (!isFPix_(rechit->geographicalId()))
840  return -9999;
841  return signed_disk_ring_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
842 }
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_ladder()

int SiPixelCoordinates::signed_ladder ( const DetId detid)

Definition at line 122 of file SiPixelCoordinates.cc.

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

Referenced by signed_ladder_coord().

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 }
const TrackerTopology * tTopo_
bool isBPix_(const DetId &)
std::unordered_map< uint32_t, int > signed_ladder_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int quadrant(const DetId &)
int ladderName() const
ladder id (index in phi)
int signed_ladder(const DetId &)

◆ signed_ladder_coord() [1/5]

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

Definition at line 617 of file SiPixelCoordinates.cc.

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

Referenced by signed_ladder_coord().

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 }
int flipped(const DetId &)
bool isBPix_(const DetId &)
int half(const DetId &)
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
int signed_ladder(const DetId &)

◆ signed_ladder_coord() [2/5]

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

Definition at line 626 of file SiPixelCoordinates.cc.

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

626  {
627  if (!isBPix_(detid))
628  return -9999;
629  return signed_ladder_coord(detid, pixel_(digi));
630 }
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
float signed_ladder_coord(const DetId &, const std::pair< int, int > &)

◆ signed_ladder_coord() [3/5]

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

Definition at line 631 of file SiPixelCoordinates.cc.

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

631  {
632  if (!isBPix_(detid))
633  return -9999;
634  return signed_ladder_coord(detid, pixel_(cluster));
635 }
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
float signed_ladder_coord(const DetId &, const std::pair< int, int > &)

◆ signed_ladder_coord() [4/5]

float SiPixelCoordinates::signed_ladder_coord ( const SiPixelRecHit rechit)

Definition at line 636 of file SiPixelCoordinates.cc.

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

636  {
637  if (!isBPix_(rechit->geographicalId()))
638  return -9999;
639  return signed_ladder_coord(rechit->geographicalId(), pixel_(rechit));
640 }
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float signed_ladder_coord(const DetId &, const std::pair< int, int > &)

◆ signed_ladder_coord() [5/5]

float SiPixelCoordinates::signed_ladder_coord ( const TrackingRecHit rechit)

Definition at line 641 of file SiPixelCoordinates.cc.

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

641  {
642  if (!isBPix_(rechit->geographicalId()))
643  return -9999;
644  return signed_ladder_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
645 }
bool isBPix_(const DetId &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
float signed_ladder_coord(const DetId &, const std::pair< int, int > &)

◆ signed_module()

int SiPixelCoordinates::signed_module ( const DetId detid)

Definition at line 135 of file SiPixelCoordinates.cc.

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

Referenced by signed_module_coord().

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 }
int moduleName() const
module id (index in z)
const TrackerTopology * tTopo_
bool isBPix_(const DetId &)
std::unordered_map< uint32_t, int > signed_module_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int signed_module(const DetId &)
int quadrant(const DetId &)

◆ signed_module_coord() [1/5]

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

Definition at line 559 of file SiPixelCoordinates.cc.

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

Referenced by signed_module_coord().

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 }
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
int signed_module(const DetId &)

◆ signed_module_coord() [2/5]

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

Definition at line 566 of file SiPixelCoordinates.cc.

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

566  {
567  if (!isBPix_(detid))
568  return -9999;
569  return signed_module_coord(detid, pixel_(digi));
570 }
float signed_module_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)

◆ signed_module_coord() [3/5]

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

Definition at line 571 of file SiPixelCoordinates.cc.

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

571  {
572  if (!isBPix_(detid))
573  return -9999;
574  return signed_module_coord(detid, pixel_(cluster));
575 }
float signed_module_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)

◆ signed_module_coord() [4/5]

float SiPixelCoordinates::signed_module_coord ( const SiPixelRecHit rechit)

Definition at line 576 of file SiPixelCoordinates.cc.

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

576  {
577  if (!isBPix_(rechit->geographicalId()))
578  return -9999;
579  return signed_module_coord(rechit->geographicalId(), pixel_(rechit));
580 }
float signed_module_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const

◆ signed_module_coord() [5/5]

float SiPixelCoordinates::signed_module_coord ( const TrackingRecHit rechit)

Definition at line 581 of file SiPixelCoordinates.cc.

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

581  {
582  if (!isBPix_(rechit->geographicalId()))
583  return -9999;
584  return signed_module_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
585 }
float signed_module_coord(const DetId &, const std::pair< int, int > &)
bool isBPix_(const DetId &)
DetId geographicalId() const
virtual TrackingRecHit const * hit() const

◆ signed_shifted_blade_panel_coord() [1/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.

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

Referenced by signed_shifted_blade_panel_coord().

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 }
int signed_blade(const DetId &)
int ring(const DetId &)
int panel(const DetId &)
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_shifted_blade_panel_coord() [2/5]

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

Definition at line 1022 of file SiPixelCoordinates.cc.

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

1022  {
1023  if (!isFPix_(detid))
1024  return -9999;
1025  return signed_shifted_blade_panel_coord(detid, pixel_(digi));
1026 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ signed_shifted_blade_panel_coord() [3/5]

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

Definition at line 1027 of file SiPixelCoordinates.cc.

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

1027  {
1028  if (!isFPix_(detid))
1029  return -9999;
1030  return signed_shifted_blade_panel_coord(detid, pixel_(cluster));
1031 }
std::pair< int, int > pixel_(const PixelDigi *)
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ 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.

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

1032  {
1033  if (!isFPix_(rechit->geographicalId()))
1034  return -9999;
1035  return signed_shifted_blade_panel_coord(rechit->geographicalId(), pixel_(rechit));
1036 }
std::pair< int, int > pixel_(const PixelDigi *)
DetId geographicalId() const
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ 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.

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

1037  {
1038  if (!isFPix_(rechit->geographicalId()))
1039  return -9999;
1040  return signed_shifted_blade_panel_coord(static_cast<const SiPixelRecHit*>(rechit->hit()));
1041 }
DetId geographicalId() const
virtual TrackingRecHit const * hit() const
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
bool isFPix_(const DetId &)

◆ 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.

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().

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 }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual int nrows() const =0
const TrackerGeometry * tGeom_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.

◆ 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.

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

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

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 }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual int ncolumns() const =0
const TrackerGeometry * tGeom_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
bool isFPix_(const DetId &)

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