23 if (gdenum == GeometricDet::GDEnumType::PixelEndCap)
33 if (gdenum == GeometricDet::GDEnumType::PixelPhase1Barrel)
35 if (gdenum == GeometricDet::GDEnumType::PixelPhase1EndCap)
37 if (gdenum == GeometricDet::GDEnumType::PixelPhase2Barrel)
39 if (gdenum == GeometricDet::GDEnumType::PixelPhase2EndCap)
41 if (gdenum == GeometricDet::GDEnumType::OTPhase2Barrel)
43 if (gdenum == GeometricDet::GDEnumType::OTPhase2EndCap)
48 class DetIdComparator {
59 for (
unsigned int i = 0;
i < 6; ++
i) {
65 LogDebug(
"BuildingSubDetTypeMap") <<
"GeometriDet and GeomDetEnumerators enumerator values of the subdetectors";
66 for (
unsigned int i = 0;
i < subdetgd.size(); ++
i) {
67 assert(subdetgd[
i]->geographicalId().subdetId() > 0 && subdetgd[
i]->geographicalId().subdetId() < 7);
68 theSubDetTypeMap[subdetgd[
i]->geographicalId().subdetId() - 1] = geometricDetToGeomDet(subdetgd[
i]->
type());
69 theNumberOfLayers[subdetgd[
i]->geographicalId().subdetId() - 1] = subdetgd[
i]->components().size();
70 LogTrace(
"BuildingSubDetTypeMap") <<
"subdet " <<
i <<
" Geometric Det type " << subdetgd[
i]->type()
73 << subdetgd[
i]->geographicalId() <<
" subdetid "
74 << subdetgd[
i]->geographicalId().subdetId() <<
" number of layers "
75 << subdetgd[
i]->components().size();
77 LogDebug(
"SubDetTypeMapContent") <<
"Content of theSubDetTypeMap";
78 for (
unsigned int i = 1;
i < 7; ++
i) {
81 LogDebug(
"NumberOfLayers") <<
"Content of theNumberOfLayers";
82 for (
unsigned int i = 1;
i < 7; ++
i) {
85 std::vector<const GeometricDet*> deepcomp;
88 sort(deepcomp.begin(), deepcomp.end(), DetIdComparator());
90 LogDebug(
"ThicknessAndType") <<
" Total Number of Detectors " << deepcomp.size();
91 LogDebug(
"ThicknessAndType") <<
"Dump of sensors names and bounds";
92 for (
auto det : deepcomp) {
94 LogDebug(
"ThicknessAndType") << det->geographicalId() <<
" " << det->name() <<
" " << det->bounds()->thickness();
98 LogDebug(
"DetTypeList") <<
" DetId " << std::get<0>(iVal) <<
" Type "
100 <<
" Thickness " << std::get<2>(iVal);
106 delete const_cast<GeomDet*>(
d);
108 delete const_cast<GeomDetType*>(
d);
134 theMapUnit.insert(std::make_pair(
p->geographicalId().rawId(),
p));
141 const_cast<GeomDet*>(
p)->setGdetIndex(
theDets.size());
143 theMap.insert(std::make_pair(
p->geographicalId().rawId(),
p));
145 switch (
id.subdetId()) {
165 edm::LogError(
"TrackerGeometry") <<
"ERROR - I was expecting a Tracker Subdetector, I got a " <<
id.subdetId();
184 mapIdToDetUnit::const_iterator
p =
theMapUnit.find(
s.rawId());
186 return static_cast<const TrackerGeomDet*>(
p->second);
189 <<
"Invalid DetID: no GeomDetUnit associated with raw ID " <<
s.rawId() <<
" of subdet ID " <<
s.subdetId();
194 mapIdToDet::const_iterator
p =
theMap.find(
s.rawId());
196 return static_cast<const TrackerGeomDet*>(
p->second);
199 <<
"Invalid DetID: no GeomDetUnit associated with raw ID " <<
s.rawId() <<
" of subdet ID " <<
s.subdetId();
204 if (subdet >= 1 && subdet <= 6) {
207 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
212 if (subdet >= 1 && subdet <= 6) {
215 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
220 for (
unsigned int i = 1;
i < 7; ++
i) {
238 if (std::get<1>(
t) != mtype)
241 if (detid > std::get<0>(
t))
242 std::get<0>(
t) = detid;
249 DetId detid_max = std::get<0>(iVal);
251 return std::get<1>(iVal);
258 DetId detid_max = std::get<0>(iVal);
260 return std::get<2>(iVal);
267 if (
name.find(
"Pixel") != std::string::npos) {
269 if (
name.find(
"BarrelActive") != std::string::npos)
271 else if (
name.find(
"ForwardSensor") != std::string::npos)
276 else if (
name.find(
"BModule") != std::string::npos) {
277 if (
name.find(
"InnerPixelActive") != std::string::npos) {
279 }
else if (
name.find(
"InnerPixel3DActive") != std::string::npos) {
284 else if (
name.find(
"EModule") != std::string::npos) {
285 if (
name.find(
"InnerPixelActive") != std::string::npos) {
287 }
else if (
name.find(
"InnerPixel3DActive") != std::string::npos) {
294 else if (
name.find(
"TIB") != std::string::npos) {
295 if (
name.find(
'0') != std::string::npos)
302 else if (
name.find(
"TOB") != std::string::npos) {
303 if (
name.find(
'0') != std::string::npos)
310 else if (
name.find(
"TID") != std::string::npos) {
311 if (
name.find(
'0') != std::string::npos)
313 else if (
name.find(
'1') != std::string::npos)
315 else if (
name.find(
'2') != std::string::npos)
320 else if (
name.find(
"TEC") != std::string::npos) {
321 if (
name.find(
'0') != std::string::npos)
323 else if (
name.find(
'1') != std::string::npos)
325 else if (
name.find(
'2') != std::string::npos)
327 else if (
name.find(
'3') != std::string::npos)
329 else if (
name.find(
'4') != std::string::npos)
331 else if (
name.find(
'5') != std::string::npos)
333 else if (
name.find(
'6') != std::string::npos)
338 if (
name.find(
"BModule") != std::string::npos ||
name.find(
"EModule") != std::string::npos) {
339 if (
name.find(
"PSMacroPixel") != std::string::npos)
341 else if (
name.find(
"PSStrip") != std::string::npos)
343 else if (
name.find(
"2S") != std::string::npos)