37 class DetIdComparator {
78 for(
unsigned int i=0;
i<6;++
i) {
84 LogDebug(
"BuildingSubDetTypeMap") <<
"GeometriDet and GeomDetEnumerators enumerator values of the subdetectors";
85 for(
unsigned int i=0;
i<subdetgd.size();++
i) {
86 assert(subdetgd[
i]->geographicalId().subdetId()>0 && subdetgd[
i]->geographicalId().subdetId()<7);
88 theNumberOfLayers[subdetgd[
i]->geographicalId().subdetId()-1]= subdetgd[
i]->components().size();
89 LogTrace(
"BuildingSubDetTypeMap") <<
"subdet " <<
i
90 <<
" Geometric Det type " << subdetgd[
i]->type()
91 <<
" Geom Det type " <<
theSubDetTypeMap[subdetgd[
i]->geographicalId().subdetId()-1]
92 <<
" detid " << subdetgd[
i]->geographicalId()
93 <<
" subdetid " << subdetgd[
i]->geographicalId().subdetId()
94 <<
" number of layers " << subdetgd[
i]->components().size();
96 LogDebug(
"SubDetTypeMapContent") <<
"Content of theSubDetTypeMap";
97 for(
unsigned int i=1;
i<7;++
i) {
100 LogDebug(
"NumberOfLayers") <<
"Content of theNumberOfLayers";
101 for(
unsigned int i=1;
i<7;++
i) {
104 std::vector<const GeometricDet*> deepcomp;
107 sort(deepcomp.begin(), deepcomp.end(), DetIdComparator());
109 LogDebug(
"ThicknessAndType") <<
" Total Number of Detectors " << deepcomp.size() ;
110 LogDebug(
"ThicknessAndType") <<
"Dump of sensors names and bounds";
111 for(
auto det : deepcomp) {
113 LogDebug(
"ThicknessAndType") << det->geographicalId() <<
" " << det->name().fullname() <<
" " << det->bounds()->thickness();
117 LogDebug(
"DetTypeList") <<
" DetId " << std::get<0>(iVal) <<
" Type " << std::get<1>(iVal)<<
" Thickness " << std::get<2>(iVal);
164 switch(
id.subdetId()){
184 edm::LogError(
"TrackerGeometry")<<
"ERROR - I was expecting a Tracker Subdetector, I got a "<<
id.subdetId();
236 return static_cast<const TrackerGeomDet *>(p->second);
237 edm::LogError(
"TrackerGeometry")<<
"Invalid DetID: no GeomDetUnit associated";
246 return static_cast<const TrackerGeomDet *>(p->second);
247 edm::LogError(
"TrackerGeometry")<<
"Invalid DetID: no GeomDet associated";
253 if(subdet>=1 && subdet<=6) {
256 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
262 if(subdet>=1 && subdet<=6) {
265 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
271 for(
unsigned int i=1;
i<7;++
i) {
282 float thickness = gd->
bounds()->thickness();
289 if (std::get<1>(
t) != mtype)
theDetTypetList.push_back({std::make_tuple(detid, mtype, thickness)});
291 if ( detid > std::get<0>(
t) ) std::get<0>(
t) = detid;
298 DetId detid_max = std::get<0>(iVal);
300 if (detid.
rawId() <= detid_max.
rawId())
return mtype;
306 DetId detid_max = std::get<0>(iVal);
308 return std::get<2>(iVal);
316 else if ( name.find(
"TIB") != std::string::npos) {
319 }
else if ( name.find(
"TOB") != std::string::npos) {
322 }
else if ( name.find(
"TID") != std::string::npos) {
326 }
else if ( name.find(
"TEC") != std::string::npos) {
330 else if ( name.find(
"3") != std::string::npos)
return ModuleType::W4;
331 else if ( name.find(
"4") != std::string::npos)
return ModuleType::W5;
332 else if ( name.find(
"5") != std::string::npos)
return ModuleType::W6;
333 else if ( name.find(
"6") != std::string::npos)
return ModuleType::W7;
334 }
else if ( name.find(
"BModule") != std::string::npos || name.find(
"EModule") != std::string::npos ) {
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
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()
DetUnitContainer theDetUnits
DDName const & name() const
bool isThere(GeomDetEnumerators::SubDetector subdet) const
uint32_t rawId() const
get the raw id
void addDetUnit(GeomDetUnit const *p)
mapIdToDetUnit theMapUnit
const DetContainer & detsTEC() const
DetTypeContainer theDetTypes
virtual ~TrackerGeometry()
void addType(GeomDetType const *p)
const DetContainer & detsPXB() const
std::unique_ptr< Bounds > bounds() const
DetId geographicalId() const
The label of this GeomDet.
ModuleType getDetectorType(DetId) const
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
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
std::vector< GeomDet const * > DetContainer
float getDetectorThickness(DetId) const
const DetContainer & detsTID() const
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
const TrackerGeomDet * idToDet(DetId) const