CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
trackerHierarchy.cc File Reference
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
#include "DataFormats/SiStripDetId/interface/TIBDetId.h"
#include "DataFormats/SiStripDetId/interface/TIDDetId.h"
#include "DataFormats/SiStripDetId/interface/TOBDetId.h"
#include "DataFormats/SiStripDetId/interface/TECDetId.h"
#include <string>
#include <vector>

Go to the source code of this file.

Functions

std::string trackerHierarchy (unsigned int rawid)
 

Function Documentation

std::string trackerHierarchy ( unsigned int  rawid)

Definition at line 11 of file trackerHierarchy.cc.

References PXFDetId::blade(), hitfit::char, PXFDetId::disk(), SiStripDetId::glued(), relval_steps::key, PXBDetId::ladder(), PXBDetId::layer(), TOBDetId::layer(), TIBDetId::layer(), PXBDetId::module(), PXFDetId::module(), TOBDetId::module(), TIBDetId::module(), TIDDetId::module(), TECDetId::module(), python.rootplot.argparse::module, PXFDetId::panel(), TECDetId::petal(), TIDDetId::ring(), TECDetId::ring(), TOBDetId::rod(), PXFDetId::side(), TIDDetId::side(), TECDetId::side(), SiStripDetId::stereo(), TIBDetId::string(), AlCaHLTBitMon_QueryRunRegistry::string, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by GeometricSearchTrackerBuilder::build().

11  {
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 }
module()
Definition: vlib.cc:994
Definition: DetId.h:18
Definition: vlib.h:208