CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
trackerHierarchy.cc
Go to the documentation of this file.
7 
8 #include<string>
9 #include<vector>
10 
11 std::string trackerHierarchy(unsigned int rawid) {
12  DetId id(rawid);
13  int subdetid = id.subdetId();
14  switch (subdetid) {
15 
16  // PXB
17  case 1:
18  {
19  PXBDetId module(rawid);
20  char theLayer = module.layer();
21  char theLadder = module.ladder();
22  char theModule = module.module();
23  char key[] = { 1, theLayer , theLadder, theModule};
24  return std::string(key,4);
25  }
26 
27  // P1XF
28  case 2:
29  {
30  PXFDetId module(rawid);
31  char thePanel = module.panel();
32  char theDisk = module.disk();
33  char theBlade = module.blade();
34  char theModule = module.module();
35  char key[] = { 2,
36  char(module.side()),
37  thePanel , theDisk,
38  theBlade, theModule};
39  return std::string(key,6);
40  }
41 
42  // TIB
43  case 3:
44  {
45  TIBDetId module(rawid);
46  char theLayer = module.layer();
47  std::vector<unsigned int> theString = module.string();
48  char theModule = module.module();
49  //side = (theString[0] == 1 ) ? "-" : "+";
50  //part = (theString[1] == 1 ) ? "int" : "ext";
51  char key[] = { 3,
52  theLayer,
53  char(theString[0]),
54  char(theString[1]),
55  char(theString[2]),
56  theModule,
57  char(module.glued() ? module.stereo()+1 : 0)
58  };
59  return std::string(key, module.glued() ? 7 : 6);
60  }
61 
62  // TID
63  case 4:
64  {
65  TIDDetId module(rawid);
66  unsigned int theDisk = module.wheel();
67  unsigned int theRing = module.ring();
68  std::vector<unsigned int> theModule = module.module();
69  // side = (module.side() == 1 ) ? "-" : "+";
70  // part = (theModule[0] == 1 ) ? "back" : "front";
71  char key[] = { 4,
72  char(module.side()),
73  char(theDisk) ,
74  char(theRing),
75  char(theModule[0]),
76  char(theModule[1]),
77  char(module.glued() ? module.stereo()+1 : 0)
78  };
79  return std::string(key,module.glued() ? 7 : 6);
80  }
81 
82  // TOB
83  case 5:
84  {
85  TOBDetId module(rawid);
86  unsigned int theLayer = module.layer();
87  std::vector<unsigned int> theRod = module.rod();
88  unsigned int theModule = module.module();
89  // side = (theRod[0] == 1 ) ? "-" : "+";
90  char key[] = { 5, char(theLayer) ,
91  char(theRod[0]),
92  char(theRod[1]),
93  char(theModule),
94  char(module.glued() ? module.stereo()+1 : 0)
95  };
96  return std::string(key, module.glued() ? 6 : 5);
97  }
98 
99  // TEC
100  case 6:
101  {
102  TECDetId module(rawid);
103  unsigned int theWheel = module.wheel();
104  unsigned int theModule = module.module();
105  std::vector<unsigned int> thePetal = module.petal();
106  unsigned int theRing = module.ring();
107  // side = (module.side() == 1 ) ? "-" : "+";
108  // petal = (thePetal[0] == 1 ) ? "back" : "front";
109  // int out_side = (module.side() == 1 ) ? -1 : 1;
110 
111  char key[] = { 6,
112  char(module.side()),
113  char(theWheel),
114  char(thePetal[0]),
115  char(thePetal[1]),
116  char(theRing),
117  char(theModule),
118  char(module.glued() ? module.stereo()+1 : 0)
119  };
120  return std::string(key, module.glued() ? 8 : 7);
121  }
122  default:
123  return std::string();
124  }
125 }
int module() const
Definition: HLTadd.h:12
unsigned int panel() const
panel id
Definition: PXFDetId.h:52
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
virtual uint32_t stereo() const
Definition: SiStripDetId.h:150
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:39
std::vector< unsigned int > string() const
string id
Definition: TIBDetId.h:53
unsigned int module() const
det id
Definition: TECDetId.h:75
std::string trackerHierarchy(unsigned int id)
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
std::vector< unsigned int > rod() const
rod id
Definition: TOBDetId.h:49
unsigned int blade() const
blade id
Definition: PXFDetId.h:48
std::vector< unsigned int > petal() const
petal id
Definition: TECDetId.h:61
unsigned int ring() const
ring id
Definition: TIDDetId.h:55
unsigned int module() const
det id
Definition: PXBDetId.h:43
unsigned int module() const
det id
Definition: PXFDetId.h:56
std::vector< unsigned int > module() const
det id
Definition: TIDDetId.h:64
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Definition: DetId.h:20
virtual uint32_t glued() const
Definition: SiStripDetId.h:142
unsigned int module() const
detector id
Definition: TIBDetId.h:61
unsigned int side() const
positive or negative id
Definition: TIDDetId.h:45
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
list key
Definition: combine.py:13
unsigned int ring() const
ring id
Definition: TECDetId.h:71
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
unsigned int module() const
detector id
Definition: TOBDetId.h:58
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50