9 #include "../interface/SiPixelCoordinates.h" 20 #include <boost/range/irange.hpp> 127 if (
quadrant(detid)%2) signed_ladder *= -1;
137 if (
quadrant(detid)<3) signed_module *= -1;
160 if (layer==2) outer = !odd_ladder;
161 else outer = odd_ladder;
163 if (layer==4) outer = odd_ladder;
164 else outer = !odd_ladder;
192 if (
quadrant(detid)<3) signed_disk *= -1;
234 if (
quadrant(detid)%2) signed_blade *= -1;
242 unsigned int fedid = 9999;
273 return std::make_pair(digi->
row(), digi->
column());
279 int row = cluster->
x()-0.5,
col = cluster->
y()-0.5;
280 return std::make_pair(row,
col);
291 return std::make_pair(row, col);
302 nrows = topo->
nrows();
305 return (pixel.first+0.5)/nrows;
323 return (pixel.second+0.5)/
ncols;
338 int rowsperroc = 80, colsperroc = 52;
348 uint64_t pseudo_roc_num =
uint64_t(1<<16) * detid.
rawId() + (1<<8) * (pixel.first/rowsperroc) + pixel.second/colsperroc;
351 unsigned int fedId =
fedid(detid);
381 return channel(static_cast<const SiPixelRecHit*>(rechit->
hit()));
402 int rowsperroc = 80, colsperroc = 52;
412 uint64_t pseudo_roc_num =
uint64_t(1<<16) * detid.
rawId() + (1<<8) * (pixel.first/rowsperroc) + pixel.second/colsperroc;
413 if (
roc_.count(pseudo_roc_num))
return roc_[pseudo_roc_num];
419 unsigned int fedId =
fedid(detid);
437 int rocX = pixel.first/rowsperroc, rocY = pixel.second/colsperroc;
440 int v1x8 =
half(detid)==1, v1x2 = (pan==1&&
mod==1), v1x5 = (pan==1&&
mod==4);
441 if (v1x8||v1x2||v1x5) ++rocX;
448 rocY = rocsY-1 - rocY;
451 roc = rocX ? rocY : 2*rocsY-1 - rocY;
453 return roc_[pseudo_roc_num] =
roc;
469 return roc(static_cast<const SiPixelRecHit*>(rechit->
hit()));
479 if (!
isBPix_(detid))
return -9999;
485 if (!
isBPix_(detid))
return -9999;
489 if (!
isBPix_(detid))
return -9999;
503 if (!
isBPix_(detid))
return -9999;
509 if (!
isBPix_(detid))
return -9999;
513 if (!
isBPix_(detid))
return -9999;
527 if (!
isBPix_(detid))
return -9999;
535 if (!
isBPix_(detid))
return -9999;
539 if (!
isBPix_(detid))
return -9999;
553 if (!
isBPix_(detid))
return -9999;
561 if (!
isBPix_(detid))
return -9999;
565 if (!
isBPix_(detid))
return -9999;
586 if (!
isFPix_(detid))
return -9999;
606 ring_coord += coord_shift;
610 if (!
isFPix_(detid))
return -9999;
614 if (!
isFPix_(detid))
return -9999;
623 return ring_coord(static_cast<const SiPixelRecHit*>(rechit->
hit()));
634 if (!
isFPix_(detid))
return -9999;
636 disk_coord += coord_shift;
640 if (!
isFPix_(detid))
return -9999;
644 if (!
isFPix_(detid))
return -9999;
653 return disk_coord(static_cast<const SiPixelRecHit*>(rechit->
hit()));
661 if (!
isFPix_(detid))
return -9999;
664 if (signed_disk_coord<0) coord_shift = -coord_shift;
665 signed_disk_coord += coord_shift;
669 if (!
isFPix_(detid))
return -9999;
673 if (!
isFPix_(detid))
return -9999;
688 if (!
isFPix_(detid))
return -9999;
692 coord_shift = (
ring_coord(detid,pixel) - 1.5 ) / 2.0;
693 disk_ring_coord += coord_shift;
697 if (!
isFPix_(detid))
return -9999;
701 if (!
isFPix_(detid))
return -9999;
717 if (!
isFPix_(detid))
return -9999;
721 coord_shift = (
ring_coord(detid,pixel) - 1.5 ) / 2.0;
723 if (signed_disk_ring_coord<0) coord_shift = -coord_shift;
724 signed_disk_ring_coord += coord_shift;
728 if (!
isFPix_(detid))
return -9999;
732 if (!
isFPix_(detid))
return -9999;
757 if (!
isFPix_(detid))
return -9999;
762 if (
side(detid)==1) coord_shift = -coord_shift;
765 if ((
side(detid)+
panel(detid))%2==0) coord_shift = -coord_shift;
767 blade_coord += coord_shift;
771 if (!
isFPix_(detid))
return -9999;
775 if (!
isFPix_(detid))
return -9999;
784 return blade_coord(static_cast<const SiPixelRecHit*>(rechit->
hit()));
796 if (!
isFPix_(detid))
return -9999;
801 if (
side(detid)==2) coord_shift = -coord_shift;
804 if ((
side(detid)+
panel(detid))%2==1) coord_shift = -coord_shift;
806 signed_blade_coord += coord_shift;
810 if (!
isFPix_(detid))
return -9999;
814 if (!
isFPix_(detid))
return -9999;
833 if (!
isFPix_(detid))
return -9999;
835 float coord_shift = (
blade_coord(detid, pixel) - blade_panel_coord +
panel(detid) - 1.5)/2;
836 blade_panel_coord += coord_shift;
840 if (!
isFPix_(detid))
return -9999;
844 if (!
isFPix_(detid))
return -9999;
864 if (!
isFPix_(detid))
return -9999;
867 signed_blade_panel_coord += coord_shift;
871 if (!
isFPix_(detid))
return -9999;
875 if (!
isFPix_(detid))
return -9999;
894 if (!
isFPix_(detid))
return -9999;
896 float coord_shift = (
signed_blade_coord(detid, pixel) - signed_shifted_blade_panel_coord -
panel(detid) + 1.5)/2;
897 if (
phase_==1&&
ring(detid)==1) signed_shifted_blade_panel_coord *= 1.5;
898 signed_shifted_blade_panel_coord += coord_shift;
902 if (!
isFPix_(detid))
return -9999;
906 if (!
isFPix_(detid))
return -9999;
float ycoord_on_module_(const DetId &, const std::pair< int, int > &)
int sector(const DetId &)
float signed_module_coord(const DetId &, const std::pair< int, int > &)
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
float signed_blade_panel_coord(const DetId &, const std::pair< int, int > &)
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
virtual int nrows() const =0
std::map< uint32_t, int > panel_
int signed_blade(const DetId &)
float disk_ring_coord(const DetId &, const std::pair< int, int > &)
float ring_coord(const DetId &, const std::pair< int, int > &)
virtual int rowsperroc() const =0
bool isPixel_(const DetId &)
int moduleName() const
module id (index in z)
void init(edm::EventSetup const &)
unsigned int pxfDisk(const DetId &id) const
float ladder_coord(const DetId &, const std::pair< int, int > &)
int signed_disk(const DetId &)
std::map< uint32_t, int > signed_disk_
float disk_coord(const DetId &, const std::pair< int, int > &)
const TrackerTopology * tTopo_
unsigned int pxbLadder(const DetId &id) const
float blade_coord(const DetId &, const std::pair< int, int > &)
std::map< uint32_t, unsigned int > fedid_
unsigned int pxbModule(const DetId &id) const
unsigned int fedid(const DetId &)
int flipped(const DetId &)
int module(const DetId &)
virtual ~SiPixelCoordinates()
std::map< uint32_t, int > blade_
uint32_t rawId() const
get the raw id
bool isBPix_(const DetId &)
std::map< uint32_t, int > sector_
std::pair< int, int > pixel_(const PixelDigi *)
int bladeName() const
blade id
std::map< uint32_t, int > quadrant_
bool isHalfModule() const
full or half module
virtual int colsperroc() const =0
std::map< uint32_t, int > half_
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
int sectorName() const
sector id
int channel(const DetId &, const std::pair< int, int > &)
const SiPixelFedCablingMap * cablingMap_
std::map< uint32_t, int > signed_module_
int roc(const DetId &, const std::pair< int, int > &)
virtual LocalPoint localPosition() const final
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int pxfModule(const DetId &id) const
std::map< uint32_t, int > layer_
std::map< uint32_t, int > flipped_
std::map< uint32_t, int > module_
std::map< uint32_t, int > signed_ladder_
unsigned int pxbLayer(const DetId &id) const
std::map< uint32_t, int > signed_blade_
std::map< uint32_t, int > disk_
const GeomDetUnit * detUnit() const
virtual TrackingRecHit const * hit() const
int ladderName() const
ladder id (index in phi)
unsigned long long uint64_t
const TrackerGeometry * tGeom_
int signed_module(const DetId &)
int toCabling(sipixelobjects::ElectronicIndex &cabling, const sipixelobjects::DetectorIndex &detector) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
std::map< uint32_t, int > side_
int quadrant(const DetId &)
float xcoord_on_module_(const DetId &, const std::pair< int, int > &)
Pixel cluster – collection of neighboring pixels above threshold.
std::map< uint64_t, unsigned int > channel_
virtual int ncolumns() const =0
float signed_disk_coord(const DetId &, const std::pair< int, int > &)
sipixelobjects::PixelROC const * toRoc(int link, int roc) const
bool hasDetUnit(uint32_t radId) const
unsigned int pxfSide(const DetId &id) const
std::vector< unsigned int > fedIds() const
std::map< uint64_t, unsigned int > roc_
int ladder(const DetId &)
std::map< uint32_t, int > ring_
DetId geographicalId() const
float module_coord(const DetId &, const std::pair< int, int > &)
float signed_shifted_blade_panel_coord(const DetId &, const std::pair< int, int > &)
int ringName() const
ring Id
HalfCylinder halfCylinder() const
Detector det() const
get the detector field from this detid
T mod(const T &a, const T &b)
float signed_blade_coord(const DetId &, const std::pair< int, int > &)
std::map< uint32_t, int > outer_
T const * product() const
float signed_disk_ring_coord(const DetId &, const std::pair< int, int > &)
std::map< uint32_t, int > ladder_
float blade_panel_coord(const DetId &, const std::pair< int, int > &)
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
float signed_ladder_coord(const DetId &, const std::pair< int, int > &)
int signed_ladder(const DetId &)
bool isFPix_(const DetId &)