CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackerAlignableId.cc
Go to the documentation of this file.
1 
8 
12 
14 
15 //__________________________________________________________________________________________________
16 // Returns alignable object id and layer (or wheel, or disk) number from a DetId
17 std::pair<int, int> TrackerAlignableId::typeAndLayerFromDetId(const DetId& detId, const TrackerTopology* tTopo) const {
18  int layerNumber = 0;
19 
20  unsigned int subdetId = static_cast<unsigned int>(detId.subdetId());
21 
22  if (subdetId == StripSubdetector::TIB) {
23  layerNumber = tTopo->tibLayer(detId.rawId());
24  } else if (subdetId == StripSubdetector::TOB) {
25  layerNumber = tTopo->tobLayer(detId.rawId());
26  } else if (subdetId == StripSubdetector::TID) {
27  layerNumber = tTopo->tidWheel(detId.rawId());
28  } else if (subdetId == StripSubdetector::TEC) {
29  layerNumber = tTopo->tecWheel(detId.rawId());
30  } else if (subdetId == PixelSubdetector::PixelBarrel) {
31  layerNumber = tTopo->pxbLayer(detId.rawId());
32  } else if (subdetId == PixelSubdetector::PixelEndcap) {
33  layerNumber = tTopo->pxfDisk(detId.rawId());
34  } else
35  edm::LogWarning("LogicError") << "Unknown subdetid: " << subdetId;
36 
37  return std::make_pair(subdetId, layerNumber);
38 }
static constexpr auto TEC
unsigned int tibLayer(const DetId &id) const
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
unsigned int pxfDisk(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int tidWheel(const DetId &id) 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
static constexpr auto TOB
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:17
static constexpr auto TIB
Log< level::Warning, false > LogWarning
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
unsigned int tobLayer(const DetId &id) const