35 class DetIdComparator {
49 for(
unsigned int i=0;
i<6;++
i) {
55 LogDebug(
"BuildingSubDetTypeMap") <<
"GeometriDet and GeomDetEnumerators enumerator values of the subdetectors";
56 for(
unsigned int i=0;
i<subdetgd.size();++
i) {
57 assert(subdetgd[
i]->geographicalId().subdetId()>0 && subdetgd[
i]->geographicalId().subdetId()<7);
59 theNumberOfLayers[subdetgd[
i]->geographicalId().subdetId()-1]= subdetgd[
i]->components().size();
60 LogTrace(
"BuildingSubDetTypeMap") <<
"subdet " <<
i
61 <<
" Geometric Det type " << subdetgd[
i]->type()
62 <<
" Geom Det type " <<
theSubDetTypeMap[subdetgd[
i]->geographicalId().subdetId()-1]
63 <<
" detid " << subdetgd[
i]->geographicalId()
64 <<
" subdetid " << subdetgd[
i]->geographicalId().subdetId()
65 <<
" number of layers " << subdetgd[
i]->components().size();
67 LogDebug(
"SubDetTypeMapContent") <<
"Content of theSubDetTypeMap";
68 for(
unsigned int i=1;
i<7;++
i) {
71 LogDebug(
"NumberOfLayers") <<
"Content of theNumberOfLayers";
72 for(
unsigned int i=1;
i<7;++
i) {
75 std::vector<const GeometricDet*> deepcomp;
78 sort(deepcomp.begin(), deepcomp.end(), DetIdComparator());
80 LogDebug(
"ThicknessAndType") <<
" Total Number of Detectors " << deepcomp.size() ;
81 LogDebug(
"ThicknessAndType") <<
"Dump of sensors names and bounds";
82 for(
auto det : deepcomp) {
84 LogDebug(
"ThicknessAndType") << det->geographicalId() <<
" " << det->name().fullname() <<
" " << det->bounds()->thickness();
88 LogDebug(
"DetTypeList") <<
" DetId " << std::get<0>(iVal)
90 <<
" Thickness " << std::get<2>(iVal);
137 switch(
id.subdetId()){
157 edm::LogError(
"TrackerGeometry")<<
"ERROR - I was expecting a Tracker Subdetector, I got a "<<
id.subdetId();
209 return static_cast<const TrackerGeomDet *>(p->second);
210 edm::LogError(
"TrackerGeometry")<<
"Invalid DetID: no GeomDetUnit associated";
219 return static_cast<const TrackerGeomDet *>(p->second);
220 edm::LogError(
"TrackerGeometry")<<
"Invalid DetID: no GeomDet associated";
226 if(subdet>=1 && subdet<=6) {
229 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
235 if(subdet>=1 && subdet<=6) {
238 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
244 for(
unsigned int i=1;
i<7;++
i) {
255 float thickness = gd->
bounds()->thickness();
262 if (std::get<1>(
t) != mtype)
theDetTypetList.push_back({std::make_tuple(detid, mtype, thickness)});
264 if ( detid > std::get<0>(
t) ) std::get<0>(
t) = detid;
271 DetId detid_max = std::get<0>(iVal);
273 if (detid.
rawId() <= detid_max.
rawId())
return mtype;
279 DetId detid_max = std::get<0>(iVal);
281 return std::get<2>(iVal);
287 if ( name.find(
"Pixel") != std::string::npos ){
290 else if ( name.find(
"BModule") != std::string::npos && name.find(
"InnerPixelActive") != std::string::npos )
return ModuleType::Ph2PXB;
291 else if ( name.find(
"EModule") != std::string::npos && name.find(
"InnerPixelActive") != std::string::npos )
return ModuleType::Ph2PXF;
292 }
else if ( name.find(
"TIB") != std::string::npos) {
295 }
else if ( name.find(
"TOB") != std::string::npos) {
298 }
else if ( name.find(
"TID") != std::string::npos) {
302 }
else if ( name.find(
"TEC") != std::string::npos) {
306 else if ( name.find(
"3") != std::string::npos)
return ModuleType::W4;
307 else if ( name.find(
"4") != std::string::npos)
return ModuleType::W5;
308 else if ( name.find(
"5") != std::string::npos)
return ModuleType::W6;
309 else if ( name.find(
"6") != std::string::npos)
return ModuleType::W7;
311 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