CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DeDxHit.cc
Go to the documentation of this file.
10 using namespace reco;
11 
12 DeDxHit::DeDxHit(float ch, float mom, float len, DetId id):
13  m_charge(ch),
14  m_momentum(mom),
15  m_pathLength(len)
16 
17 {
18  uint32_t subdet = id.subdetId();
19  m_subDetId = (subdet & 0x7) << 5;
20 
21  uint32_t layer = 0;
22  if (subdet == PixelSubdetector::PixelBarrel) {
23  layer = PXBDetId(id).layer();
24  } else if (subdet == PixelSubdetector::PixelEndcap) {
25  layer = PXFDetId(id).disk();
26  } else if (subdet == StripSubdetector::TIB) {
27  layer = TIBDetId(id).layer();
28  } else if (subdet == StripSubdetector::TID) {
29  layer = (TIDDetId(id).wheel() & 0xF) + ((TIDDetId(id).side() - 1) << 4);
30  } else if (subdet == StripSubdetector::TOB) {
31  layer = TOBDetId(id).layer();
32  } else if (subdet == StripSubdetector::TEC) {
33  layer = (TECDetId(id).wheel() & 0xF) + ((TECDetId(id).side() - 1) << 4);
34  }
35 
36  m_subDetId += (layer & 0x1F) ;
37 }
38 
char m_subDetId
Definition: DeDxHit.h:64
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Definition: DetId.h:18
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
int layer() const
Return the layer/disk.
Definition: DeDxHit.h:45
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50