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 
15 
17 
18 
19 //__________________________________________________________________________________________________
20 // Returns alignable object id and layer (or wheel, or disk) number from a DetId
21 std::pair<int,int> TrackerAlignableId::typeAndLayerFromDetId( const DetId& detId ) const
22 {
23 
24  int layerNumber = 0;
25 
26  unsigned int subdetId = static_cast<unsigned int>(detId.subdetId());
27 
28  if ( subdetId == StripSubdetector::TIB)
29  {
30  TIBDetId tibid(detId.rawId());
31  layerNumber = tibid.layer();
32  }
33  else if ( subdetId == StripSubdetector::TOB )
34  {
35  TOBDetId tobid(detId.rawId());
36  layerNumber = tobid.layer();
37  }
38  else if ( subdetId == StripSubdetector::TID)
39  {
40  TIDDetId tidid(detId.rawId());
41  layerNumber = tidid.wheel();
42  }
43  else if ( subdetId == StripSubdetector::TEC )
44  {
45  TECDetId tecid(detId.rawId());
46  layerNumber = tecid.wheel();
47  }
48  else if ( subdetId == PixelSubdetector::PixelBarrel )
49  {
50  PXBDetId pxbid(detId.rawId());
51  layerNumber = pxbid.layer();
52  }
53  else if ( subdetId == PixelSubdetector::PixelEndcap )
54  {
55  PXFDetId pxfid(detId.rawId());
56  layerNumber = pxfid.disk();
57  }
58  else
59  edm::LogWarning("LogicError") << "Unknown subdetid: " << subdetId;
60 
61 
62  return std::make_pair( subdetId, layerNumber );
63 
64 }
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
unsigned int layerNumber(align::ID)
Layer number increases with rho from 1 to 8.
Definition: TIBNameSpace.h:85
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Definition: DetId.h:20
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId) const
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50