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);
134 theMapUnit.insert(std::make_pair(
p->geographicalId().rawId(),
p));
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());
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());
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))
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) {
281 }
else if (
name.find(
"InnerPixel3DOneActive") != std::string::npos) {
283 }
else if (
name.find(
"InnerPixel3DTwoActive") != std::string::npos) {
288 else if (
name.find(
"EModule") != std::string::npos) {
289 if (
name.find(
"InnerPixelActive") != std::string::npos) {
291 }
else if (
name.find(
"InnerPixel3DActive") != std::string::npos) {
293 }
else if (
name.find(
"InnerPixel3DOneActive") != std::string::npos) {
295 }
else if (
name.find(
"InnerPixel3DTwoActive") != std::string::npos) {
302 else if (
name.find(
"TIB") != std::string::npos) {
303 if (
name.find(
'0') != std::string::npos)
310 else if (
name.find(
"TOB") != std::string::npos) {
311 if (
name.find(
'0') != std::string::npos)
318 else if (
name.find(
"TID") != std::string::npos) {
319 if (
name.find(
'0') != std::string::npos)
321 else if (
name.find(
'1') != std::string::npos)
323 else if (
name.find(
'2') != std::string::npos)
328 else if (
name.find(
"TEC") != std::string::npos) {
329 if (
name.find(
'0') != std::string::npos)
331 else if (
name.find(
'1') != std::string::npos)
333 else if (
name.find(
'2') != std::string::npos)
335 else if (
name.find(
'3') != std::string::npos)
337 else if (
name.find(
'4') != std::string::npos)
339 else if (
name.find(
'5') != std::string::npos)
341 else if (
name.find(
'6') != std::string::npos)
346 if (
name.find(
"BModule") != std::string::npos ||
name.find(
"EModule") != std::string::npos) {
347 if (
name.find(
"PSMacroPixel") != std::string::npos)
349 else if (
name.find(
"PSStrip") != std::string::npos)
351 else if (
name.find(
"2S") != std::string::npos)
float getDetectorThickness(DetId) const
const DetContainer & detsTIB() const
static constexpr auto TEC
void addDet(GeomDet const *p)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const DetContainer & detsPXB() const
unsigned int numberOfLayers(int subdet) const
const DetContainer & detsPXF() const
unsigned int theNumberOfLayers[6]
void fillTestMap(const GeometricDet *gd)
Log< level::Error, false > LogError
DetIdContainer theDetUnitIds
GeomDetEnumerators::SubDetector theSubDetTypeMap[6]
TrackerGeometry(GeometricDet const *gd=nullptr)
ConstGeometricDetContainer & components()
std::vector< const GeomDet * > DetContainer
mapIdToDetUnit theMapUnit
const DetContainer & detsTOB() const
DetTypeContainer theDetTypes
bool isThere(GeomDetEnumerators::SubDetector subdet) const
ModuleType getDetectorType(DetId) const
void addType(GeomDetType const *p)
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
void addDetUnit(GeomDet const *p)
static constexpr auto TOB
std::vector< GeometricDet const * > ConstGeometricDetContainer
const std::string & name() const
const TrackerGeomDet * idToDet(DetId) const override
~TrackerGeometry() override
static constexpr detId_t invalidDet
static constexpr auto TIB
const DetId & geographicalId() const
constexpr uint32_t rawId() const
get the raw id
void addDetUnitId(DetId p)
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
ConstGeometricDetContainer deepComponents() const
const DetContainer & detsTEC() const
static constexpr auto TID
ModuleType moduleType(const std::string &name) const
std::unique_ptr< Bounds > bounds() const
const DetContainer & detsTID() const