test
CMS 3D CMS Logo

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