CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerTopology.cc
Go to the documentation of this file.
5 #include <sstream>
6 
8  const TECValues& tecv, const TIBValues& tibv,
9  const TIDValues& tidv, const TOBValues& tobv) {
10  pbVals_=pxb;
11  pfVals_=pxf;
12  tecVals_=tecv;
13  tibVals_=tibv;
14  tidVals_=tidv;
15  tobVals_=tobv;
16 }
17 
18 
19 unsigned int TrackerTopology::side(const DetId &id) const {
20  uint32_t subdet=id.subdetId();
21  if ( subdet == PixelSubdetector::PixelBarrel )
22  return 0;
23  if ( subdet == PixelSubdetector::PixelEndcap )
24  return pxfSide(id);
25  if ( subdet == StripSubdetector::TIB )
26  return 0;
27  if ( subdet == StripSubdetector::TID )
28  return tidSide(id);
29  if ( subdet == StripSubdetector::TOB )
30  return 0;
31  if ( subdet == StripSubdetector::TEC )
32  return tecSide(id);
33 
34  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::side";
35  return 0;
36 }
37 
38 
39 unsigned int TrackerTopology::layer(const DetId &id) const {
40  uint32_t subdet=id.subdetId();
41  if ( subdet == PixelSubdetector::PixelBarrel )
42  return pxbLayer(id);
43  if ( subdet == PixelSubdetector::PixelEndcap )
44  return pxfDisk(id);
45  if ( subdet == StripSubdetector::TIB )
46  return tibLayer(id);
47  if ( subdet == StripSubdetector::TID )
48  return tidWheel(id);
49  if ( subdet == StripSubdetector::TOB )
50  return tobLayer(id);
51  if ( subdet == StripSubdetector::TEC )
52  return tecWheel(id);
53 
54  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::layer";
55  return 0;
56 }
57 
58 unsigned int TrackerTopology::module(const DetId &id) const {
59  uint32_t subdet=id.subdetId();
60  if ( subdet == PixelSubdetector::PixelBarrel )
61  return pxbModule(id);
62  if ( subdet == PixelSubdetector::PixelEndcap )
63  return pxfModule(id);
64  if ( subdet == StripSubdetector::TIB )
65  return tibModule(id);
66  if ( subdet == StripSubdetector::TID )
67  return tidModule(id);
68  if ( subdet == StripSubdetector::TOB )
69  return tobModule(id);
70  if ( subdet == StripSubdetector::TEC )
71  return tecModule(id);
72 
73  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::module";
74  return 0;
75 }
76 
78  uint32_t subdet=id.subdetId();
79  std::stringstream strstr;
80 
81  if ( subdet == PixelSubdetector::PixelBarrel ) {
82  strstr << "(PixelBarrel "
83  << pxbLayer(id) << ','
84  << pxbLadder(id) << ','
85  << pxbModule(id) << ')';
86  return strstr.str();
87  }
88 
89  if ( subdet == PixelSubdetector::PixelEndcap ) {
90  strstr << "(PixelEndcap "
91  << pxfDisk(id) << ','
92  << pxfBlade(id) << ','
93  << pxfPanel(id) << ','
94  << pxfModule(id) << ')';
95  return strstr.str();
96  }
97 
98  if ( subdet == StripSubdetector::TIB ) {
99  unsigned int theLayer = tibLayer(id);
100  std::vector<unsigned int> theString = tibStringInfo(id);
101  unsigned int theModule = tibModule(id);
104  side = (theString[0] == 1 ) ? "-" : "+";
105  part = (theString[1] == 1 ) ? "int" : "ext";
107  type = (tibStereo(id) == 0) ? "r-phi" : "stereo";
108  type = (tibGlued(id) == 0) ? type : type+" glued";
109  type = (tibIsDoubleSide(id)) ? "double side" : type;
110  strstr << "TIB" << side
111  << " Layer " << theLayer << " " << part
112  << " String " << theString[2]
113  << " Module " << theModule << " " << type
114  << " (" << id.rawId() << ")";
115  return strstr.str();
116  }
117 
118  if ( subdet == StripSubdetector::TID ) {
119  unsigned int theDisk = tidWheel(id);
120  unsigned int theRing = tidRing(id);
121  std::vector<unsigned int> theModule = tidModuleInfo(id);
124  side = (tidSide(id) == 1 ) ? "-" : "+";
125  part = (theModule[0] == 1 ) ? "back" : "front";
127  type = (tidStereo(id) == 0) ? "r-phi" : "stereo";
128  type = (tidGlued(id) == 0) ? type : type+" glued";
129  type = (tidIsDoubleSide(id)) ? "double side" : type;
130  strstr << "TID" << side
131  << " Disk " << theDisk
132  << " Ring " << theRing << " " << part
133  << " Module " << theModule[1] << " " << type
134  << " (" << id.rawId() << ")";
135  return strstr.str();
136  }
137 
138  if ( subdet == StripSubdetector::TOB ) {
139  unsigned int theLayer = tobLayer(id);
140  std::vector<unsigned int> theRod = tobRodInfo(id);
141  unsigned int theModule = tobModule(id);
144  side = (theRod[0] == 1 ) ? "-" : "+";
146  type = (tobStereo(id) == 0) ? "r-phi" : "stereo";
147  type = (tobGlued(id) == 0) ? type : type+" glued";
148  type = (tobIsDoubleSide(id)) ? "double side" : type;
149  strstr << "TOB" << side
150  << " Layer " << theLayer
151  << " Rod " << theRod[1]
152  << " Module " << theModule << " " << type
153  << " (" << id.rawId() << ")";
154  return strstr.str();
155  }
156 
157  if ( subdet == StripSubdetector::TEC ) {
158  unsigned int theWheel = tecWheel(id);
159  unsigned int theModule = tecModule(id);
160  std::vector<unsigned int> thePetal = tecPetalInfo(id);
161  unsigned int theRing = tecRing(id);
163  std::string petal;
164  side = (tecSide(id) == 1 ) ? "-" : "+";
165  petal = (thePetal[0] == 1 ) ? "back" : "front";
167  type = (tecStereo(id) == 0) ? "r-phi" : "stereo";
168  type = (tecGlued(id) == 0) ? type : type+" glued";
169  type = (tecIsDoubleSide(id)) ? "double side" : type;
170  strstr << "TEC" << side
171  << " Wheel " << theWheel
172  << " Petal " << thePetal[1] << " " << petal
173  << " Ring " << theRing
174  << " Module " << theModule << " " << type
175  << " (" << id.rawId() << ")";
176 
177  return strstr.str();
178  }
179 
180 
181  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::module";
182  return strstr.str();
183 }
184 
185 
187  switch(id.subdetId()) {
190  case StripSubdetector::TID: switch (tidRing(id)) {
191  case 1: return SiStripDetId::W1A;
192  case 2: return SiStripDetId::W2A;
193  case 3: return SiStripDetId::W3A;
194  }
195  case StripSubdetector::TEC: switch (tecRing(id)) {
196  case 1: return SiStripDetId::W1B;
197  case 2: return SiStripDetId::W2B;
198  case 3: return SiStripDetId::W3B;
199  case 4: return SiStripDetId::W4;
200  case 5: return SiStripDetId::W5;
201  case 6: return SiStripDetId::W6;
202  case 7: return SiStripDetId::W7;
203  }
204  }
206 }
207 
type
Definition: HCALResponse.h:21
bool tecIsDoubleSide(const DetId &id) const
bool tobIsDoubleSide(const DetId &id) const
uint32_t tobGlued(const DetId &id) const
bool tibIsDoubleSide(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
uint32_t tobStereo(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
unsigned int side(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
SiStripDetId::ModuleGeometry moduleGeometry(const DetId &id) const
std::vector< unsigned int > tibStringInfo(const DetId &id) const
std::string print(DetId detid) const
PixelEndcapValues pfVals_
unsigned int module(const DetId &id) const
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
unsigned int tidSide(const DetId &id) const
PixelBarrelValues pbVals_
uint32_t tidStereo(const DetId &id) const
std::vector< unsigned int > tobRodInfo(const DetId &id) const
unsigned int tidModule(const DetId &id) const
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:18
uint32_t tibGlued(const DetId &id) const
part
Definition: HCALResponse.h:20
bool tidIsDoubleSide(const DetId &id) const
unsigned int tobModule(const DetId &id) const
unsigned int layer(const DetId &id) const
uint32_t tecStereo(const DetId &id) const
unsigned int pxfSide(const DetId &id) const
uint32_t tibStereo(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
TrackerTopology(const PixelBarrelValues &pxb, const PixelEndcapValues &pxf, const TECValues &tecv, const TIBValues &tibv, const TIDValues &tidv, const TOBValues &tobv)
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