CMS 3D CMS Logo

TrackerAlignableId.cc
Go to the documentation of this file.
1 
8 
12 
14 
15 
16 //__________________________________________________________________________________________________
17 // Returns alignable object id and layer (or wheel, or disk) number from a DetId
18 std::pair<int,int> TrackerAlignableId::typeAndLayerFromDetId( const DetId& detId , const TrackerTopology* tTopo) const
19 {
20 
21  int layerNumber = 0;
22 
23  unsigned int subdetId = static_cast<unsigned int>(detId.subdetId());
24 
25  if ( subdetId == StripSubdetector::TIB)
26  {
27 
28  layerNumber = tTopo->tibLayer(detId.rawId());
29  }
30  else if ( subdetId == StripSubdetector::TOB )
31  {
32 
33  layerNumber = tTopo->tobLayer(detId.rawId());
34  }
35  else if ( subdetId == StripSubdetector::TID)
36  {
37 
38  layerNumber = tTopo->tidWheel(detId.rawId());
39  }
40  else if ( subdetId == StripSubdetector::TEC )
41  {
42 
43  layerNumber = tTopo->tecWheel(detId.rawId());
44  }
45  else if ( subdetId == PixelSubdetector::PixelBarrel )
46  {
47 
48  layerNumber = tTopo->pxbLayer(detId.rawId());
49  }
50  else if ( subdetId == PixelSubdetector::PixelEndcap )
51  {
52 
53  layerNumber = tTopo->pxfDisk(detId.rawId());
54  }
55  else
56  edm::LogWarning("LogicError") << "Unknown subdetid: " << subdetId;
57 
58 
59  return std::make_pair( subdetId, layerNumber );
60 
61 }
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
unsigned int tidWheel(const DetId &id) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const