test
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 
20 unsigned int TrackerTopology::layer(const DetId &id) const {
21  uint32_t subdet=id.subdetId();
22  if ( subdet == PixelSubdetector::PixelBarrel )
23  return pxbLayer(id);
24  if ( subdet == PixelSubdetector::PixelEndcap )
25  return pxfDisk(id);
26  if ( subdet == StripSubdetector::TIB )
27  return tibLayer(id);
28  if ( subdet == StripSubdetector::TID )
29  return tidWheel(id);
30  if ( subdet == StripSubdetector::TOB )
31  return tobLayer(id);
32  if ( subdet == StripSubdetector::TEC )
33  return tecWheel(id);
34 
35  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::layer";
36  return 0;
37 }
38 
39 unsigned int TrackerTopology::module(const DetId &id) const {
40  uint32_t subdet=id.subdetId();
41  if ( subdet == PixelSubdetector::PixelBarrel )
42  return pxbModule(id);
43  if ( subdet == PixelSubdetector::PixelEndcap )
44  return pxfModule(id);
45  if ( subdet == StripSubdetector::TIB )
46  return tibModule(id);
47  if ( subdet == StripSubdetector::TID )
48  return tidModule(id);
49  if ( subdet == StripSubdetector::TOB )
50  return tobModule(id);
51  if ( subdet == StripSubdetector::TEC )
52  return tecModule(id);
53 
54  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::module";
55  return 0;
56 }
57 
59  uint32_t subdet=id.subdetId();
60  std::stringstream strstr;
61 
62  if ( subdet == PixelSubdetector::PixelBarrel ) {
63  strstr << "(PixelBarrel "
64  << pxbLayer(id) << ','
65  << pxbLadder(id) << ','
66  << pxbModule(id) << ')';
67  return strstr.str();
68  }
69 
70  if ( subdet == PixelSubdetector::PixelEndcap ) {
71  strstr << "(PixelEndcap "
72  << pxfDisk(id) << ','
73  << pxfBlade(id) << ','
74  << pxfPanel(id) << ','
75  << pxfModule(id) << ')';
76  return strstr.str();
77  }
78 
79  if ( subdet == StripSubdetector::TIB ) {
80  unsigned int theLayer = tibLayer(id);
81  std::vector<unsigned int> theString = tibStringInfo(id);
82  unsigned int theModule = tibModule(id);
83  std::string side;
85  side = (theString[0] == 1 ) ? "-" : "+";
86  part = (theString[1] == 1 ) ? "int" : "ext";
88  type = (tibStereo(id) == 0) ? "r-phi" : "stereo";
89  type = (tibGlued(id) == 0) ? type : type+" glued";
90  type = (tibIsDoubleSide(id)) ? "double side" : type;
91  strstr << "TIB" << side
92  << " Layer " << theLayer << " " << part
93  << " String " << theString[2]
94  << " Module " << theModule << " " << type
95  << " (" << id.rawId() << ")";
96  return strstr.str();
97  }
98 
99  if ( subdet == StripSubdetector::TID ) {
100  unsigned int theDisk = tidWheel(id);
101  unsigned int theRing = tidRing(id);
102  std::vector<unsigned int> theModule = tidModuleInfo(id);
103  std::string side;
105  side = (tidSide(id) == 1 ) ? "-" : "+";
106  part = (theModule[0] == 1 ) ? "back" : "front";
108  type = (tidStereo(id) == 0) ? "r-phi" : "stereo";
109  type = (tidGlued(id) == 0) ? type : type+" glued";
110  type = (tidIsDoubleSide(id)) ? "double side" : type;
111  strstr << "TID" << side
112  << " Disk " << theDisk
113  << " Ring " << theRing << " " << part
114  << " Module " << theModule[1] << " " << type
115  << " (" << id.rawId() << ")";
116  return strstr.str();
117  }
118 
119  if ( subdet == StripSubdetector::TOB ) {
120  unsigned int theLayer = tobLayer(id);
121  std::vector<unsigned int> theRod = tobRodInfo(id);
122  unsigned int theModule = tobModule(id);
123  std::string side;
125  side = (theRod[0] == 1 ) ? "-" : "+";
127  type = (tobStereo(id) == 0) ? "r-phi" : "stereo";
128  type = (tobGlued(id) == 0) ? type : type+" glued";
129  type = (tobIsDoubleSide(id)) ? "double side" : type;
130  strstr << "TOB" << side
131  << " Layer " << theLayer
132  << " Rod " << theRod[1]
133  << " Module " << theModule << " " << type
134  << " (" << id.rawId() << ")";
135  return strstr.str();
136  }
137 
138  if ( subdet == StripSubdetector::TEC ) {
139  unsigned int theWheel = tecWheel(id);
140  unsigned int theModule = tecModule(id);
141  std::vector<unsigned int> thePetal = tecPetalInfo(id);
142  unsigned int theRing = tecRing(id);
143  std::string side;
144  std::string petal;
145  side = (tecSide(id) == 1 ) ? "-" : "+";
146  petal = (thePetal[0] == 1 ) ? "back" : "front";
148  type = (tecStereo(id) == 0) ? "r-phi" : "stereo";
149  type = (tecGlued(id) == 0) ? type : type+" glued";
150  type = (tecIsDoubleSide(id)) ? "double side" : type;
151  strstr << "TEC" << side
152  << " Wheel " << theWheel
153  << " Petal " << thePetal[1] << " " << petal
154  << " Ring " << theRing
155  << " Module " << theModule << " " << type
156  << " (" << id.rawId() << ")";
157 
158  return strstr.str();
159  }
160 
161 
162  throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::module";
163  return strstr.str();
164 }
165 
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
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
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
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