CMS 3D CMS Logo

trackerHierarchy.cc
Go to the documentation of this file.
3 
4 #include <string>
5 #include <vector>
6 
7 std::string trackerHierarchy(const TrackerTopology* tTopo, unsigned int rawid) {
8  DetId id(rawid);
9  int subdetid = id.subdetId();
10  switch (subdetid) {
11  // PXB
13  char theLayer = tTopo->pxbLayer(id);
14  char theLadder = tTopo->pxbLadder(id);
15  char theModule = tTopo->pxbModule(id);
16  char key[] = {1, theLayer, theLadder, theModule};
17  return std::string(key, 4);
18  }
19 
20  // P1XF
22  char thePanel = tTopo->pxfPanel(id);
23  char theDisk = tTopo->pxfDisk(id);
24  char theBlade = tTopo->pxfBlade(id);
25  char theModule = tTopo->pxfModule(id);
26  char key[] = {2, char(tTopo->pxfSide(id)), thePanel, theDisk, theBlade, theModule};
27  return std::string(key, 6);
28  }
29 
30  // TIB
31  case StripSubdetector::TIB: {
32  char theLayer = tTopo->tibLayer(id);
33  std::vector<unsigned int> theString = tTopo->tibStringInfo(id);
34  char theModule = tTopo->tibModule(id);
35  //side = (theString[0] == 1 ) ? "-" : "+";
36  //part = (theString[1] == 1 ) ? "int" : "ext";
37  char key[] = {3,
38  theLayer,
39  char(theString[0]),
40  char(theString[1]),
41  char(theString[2]),
42  theModule,
43  char(tTopo->tibGlued(id) ? tTopo->tibIsStereo(id) + 1 : 0)};
44  return std::string(key, tTopo->tibGlued(id) ? 7 : 6);
45  }
46 
47  // TID
48  case StripSubdetector::TID: {
49  unsigned int theDisk = tTopo->tidWheel(id);
50  unsigned int theRing = tTopo->tidRing(id);
51  // side = (tTopo->tidSide(id) == 1 ) ? "-" : "+";
52  // part = (tTopo->tidOrder(id) == 1 ) ? "back" : "front";
53  char key[] = {4,
54  char(tTopo->tidSide(id)),
55  char(theDisk),
56  char(theRing),
57  char(tTopo->tidOrder(id)),
58  char(tTopo->tidModule(id)),
59  char(tTopo->tidGlued(id) ? tTopo->tidIsStereo(id) + 1 : 0)};
60  return std::string(key, tTopo->tidGlued(id) ? 7 : 6);
61  }
62 
63  // TOB
64  case StripSubdetector::TOB: {
65  unsigned int theLayer = tTopo->tobLayer(id);
66  unsigned int theModule = tTopo->tobModule(id);
67  // side = (tTopo->side(id) == 1 ) ? "-" : "+";
68  char key[] = {5,
69  char(theLayer),
70  char(tTopo->tobSide(id)),
71  char(tTopo->tobRod(id)),
72  char(theModule),
73  char(tTopo->tobGlued(id) ? tTopo->tobIsStereo(id) + 1 : 0)};
74  return std::string(key, tTopo->tobGlued(id) ? 6 : 5);
75  }
76 
77  // TEC
78  case StripSubdetector::TEC: {
79  unsigned int theWheel = tTopo->tecWheel(id);
80  unsigned int theModule = tTopo->tecModule(id);
81  unsigned int theRing = tTopo->tecRing(id);
82  // side = (tTopo->tecSide(id) == 1 ) ? "-" : "+";
83  // petal = (tTopo->tecOrder(id) == 1 ) ? "back" : "front";
84  // int out_side = (tTopo->tecSide(id) == 1 ) ? -1 : 1;
85 
86  char key[] = {6,
87  char(tTopo->tecSide(id)),
88  char(theWheel),
89  char(tTopo->tecOrder(id)),
90  char(tTopo->tecPetalNumber(id)),
91  char(theRing),
92  char(theModule),
93  char(tTopo->tecGlued(id) ? tTopo->tecIsStereo(id) + 1 : 0)};
94  return std::string(key, tTopo->tecGlued(id) ? 8 : 7);
95  }
96  default:
97  return std::string();
98  }
99 }
static constexpr auto TEC
uint32_t tobGlued(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
bool tobIsStereo(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int pxbLadder(const DetId &id) const
uint32_t tecGlued(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
std::vector< unsigned int > tibStringInfo(const DetId &id) const
bool tidIsStereo(const DetId &id) const
bool tecIsStereo(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidModule(const DetId &id) const
unsigned int tobSide(const DetId &id) const
static constexpr auto TOB
unsigned int tibModule(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
unsigned int tecModule(const DetId &id) const
Definition: DetId.h:17
static constexpr auto TIB
uint32_t tibGlued(const DetId &id) const
bool tibIsStereo(const DetId &id) const
unsigned int tecOrder(const DetId &id) const
unsigned int tobModule(const DetId &id) const
unsigned int tidOrder(const DetId &id) const
unsigned int pxfSide(const DetId &id) const
unsigned int tecPetalNumber(const DetId &id) const
unsigned int tobRod(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
uint32_t tidGlued(const DetId &id) const
std::string trackerHierarchy(const TrackerTopology *tTopo, unsigned int rawid)