37 class DetIdComparator {
50 for(
unsigned int i=0;
i<6;++
i) {
56 LogDebug(
"BuildingSubDetTypeMap") <<
"GeometriDet and GeomDetEnumerators enumerator values of the subdetectors";
57 for(
unsigned int i=0;
i<subdetgd.size();++
i) {
58 assert(subdetgd[
i]->geographicalId().subdetId()>0 && subdetgd[
i]->geographicalId().subdetId()<7);
60 theNumberOfLayers[subdetgd[
i]->geographicalId().subdetId()-1]= subdetgd[
i]->components().size();
61 LogTrace(
"BuildingSubDetTypeMap") <<
"subdet " <<
i 62 <<
" Geometric Det type " << subdetgd[
i]->type()
63 <<
" Geom Det type " <<
theSubDetTypeMap[subdetgd[
i]->geographicalId().subdetId()-1]
64 <<
" detid " << subdetgd[
i]->geographicalId()
65 <<
" subdetid " << subdetgd[
i]->geographicalId().subdetId()
66 <<
" number of layers " << subdetgd[
i]->components().size();
68 LogDebug(
"SubDetTypeMapContent") <<
"Content of theSubDetTypeMap";
69 for(
unsigned int i=1;
i<7;++
i) {
72 LogDebug(
"NumberOfLayers") <<
"Content of theNumberOfLayers";
73 for(
unsigned int i=1;
i<7;++
i) {
76 std::vector<const GeometricDet*> deepcomp;
79 sort(deepcomp.begin(), deepcomp.end(), DetIdComparator());
81 LogDebug(
"ThicknessAndType") <<
" Total Number of Detectors " << deepcomp.size() ;
82 LogDebug(
"ThicknessAndType") <<
"Dump of sensors names and bounds";
83 for(
auto det : deepcomp) {
85 LogDebug(
"ThicknessAndType") << det->geographicalId() <<
" " << det->name().fullname() <<
" " << det->bounds()->thickness();
89 LogDebug(
"DetTypeList") <<
" DetId " << std::get<0>(iVal)
91 <<
" Thickness " << std::get<2>(iVal);
136 switch(
id.subdetId()){
156 edm::LogError(
"TrackerGeometry")<<
"ERROR - I was expecting a Tracker Subdetector, I got a "<<
id.subdetId();
208 throw cms::Exception(
"WrongTrackerSubDet") <<
"Invalid DetID: no GeomDetUnit associated with raw ID " 220 throw cms::Exception(
"WrongTrackerSubDet") <<
"Invalid DetID: no GeomDetUnit associated with raw ID " 227 if(subdet>=1 && subdet<=6) {
230 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
236 if(subdet>=1 && subdet<=6) {
239 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
245 for(
unsigned int i=1;
i<7;++
i) {
256 float thickness = gd->
bounds()->thickness();
263 if (std::get<1>(
t) != mtype)
theDetTypetList.emplace_back(detid, mtype, thickness);
265 if ( detid > std::get<0>(
t) ) std::get<0>(
t) = detid;
272 DetId detid_max = std::get<0>(iVal);
274 if (detid.
rawId() <= detid_max.
rawId())
return mtype;
281 DetId detid_max = std::get<0>(iVal);
283 return std::get<2>(iVal);
289 if ( name.find(
"Pixel") != std::string::npos ){
292 else if ( name.find(
"BModule") != std::string::npos && name.find(
"InnerPixelActive") != std::string::npos )
return ModuleType::Ph2PXB;
293 else if ( name.find(
"EModule") != std::string::npos && name.find(
"InnerPixelActive") != std::string::npos )
return ModuleType::Ph2PXF;
294 }
else if ( name.find(
"TIB") != std::string::npos) {
297 }
else if ( name.find(
"TOB") != std::string::npos) {
300 }
else if ( name.find(
"TID") != std::string::npos) {
304 }
else if ( name.find(
"TEC") != std::string::npos) {
308 else if ( name.find(
"3") != std::string::npos)
return ModuleType::W4;
309 else if ( name.find(
"4") != std::string::npos)
return ModuleType::W5;
310 else if ( name.find(
"5") != std::string::npos)
return ModuleType::W6;
311 else if ( name.find(
"6") != std::string::npos)
return ModuleType::W7;
313 if ( name.find(
"BModule") != std::string::npos || name.find(
"EModule") != std::string::npos ) {
void addDet(GeomDet const *p)
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
unsigned int theNumberOfLayers[6]
TrackerGeometry(GeometricDet const *gd=0)
void fillTestMap(const GeometricDet *gd)
DetIdContainer theDetUnitIds
GeomDetEnumerators::SubDetector theSubDetTypeMap[6]
unsigned int numberOfLayers(int subdet) const
ConstGeometricDetContainer & components()
DDName const & name() const
bool isThere(GeomDetEnumerators::SubDetector subdet) const
uint32_t rawId() const
get the raw id
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
mapIdToDetUnit theMapUnit
const DetContainer & detsTEC() const
DetTypeContainer theDetTypes
void addType(GeomDetType const *p)
const DetContainer & detsPXB() const
std::unique_ptr< Bounds > bounds() const
DetId geographicalId() const
The label of this GeomDet.
void addDetUnit(GeomDet const *p)
ModuleType getDetectorType(DetId) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
~TrackerGeometry() override
const DetContainer & detsTIB() const
ModuleType moduleType(const std::string &name) const
std::vector< GeometricDet const * > ConstGeometricDetContainer
DetId geographicalId() const
void addDetUnitId(DetId p)
ConstGeometricDetContainer deepComponents() const
std::vector< const GeomDet * > DetContainer
const DetContainer & detsPXF() const
const TrackerGeomDet * idToDet(DetId) const override
const DetContainer & detsTOB() const
float getDetectorThickness(DetId) const
const DetContainer & detsTID() const
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList