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);
162 switch(
id.subdetId()){
182 edm::LogError(
"TrackerGeometry")<<
"ERROR - I was expecting a Tracker Subdetector, I got a "<<
id.subdetId();
245 return static_cast<const TrackerGeomDet *>(p->second);
246 edm::LogError(
"TrackerGeometry")<<
"Invalid DetID: no GeomDetUnit associated";
255 return static_cast<const TrackerGeomDet *>(p->second);
256 edm::LogError(
"TrackerGeometry")<<
"Invalid DetID: no GeomDet associated";
262 if(subdet>=1 && subdet<=6) {
265 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
271 if(subdet>=1 && subdet<=6) {
274 throw cms::Exception(
"WrongTrackerSubDet") <<
"Subdetector " << subdet;
280 for(
unsigned int i=1;
i<7;++
i) {
309 float thickness = gd->
bounds()->thickness();
316 if (std::get<1>(
t) != mtype)
theDetTypetList.push_back({std::make_tuple(detid, mtype, thickness)});
318 if ( detid > std::get<0>(
t) ) std::get<0>(
t) = detid;
325 DetId detid_max = std::get<0>(iVal);
327 if (detid.
rawId() <= detid_max.
rawId())
return mtype;
333 DetId detid_max = std::get<0>(iVal);
335 return std::get<2>(iVal);
343 else if ( name.find(
"TIB") != std::string::npos) {
346 }
else if ( name.find(
"TOB") != std::string::npos) {
349 }
else if ( name.find(
"TID") != std::string::npos) {
353 }
else if ( name.find(
"TEC") != std::string::npos) {
357 else if ( name.find(
"3") != std::string::npos)
return ModuleType::W4;
358 else if ( name.find(
"4") != std::string::npos)
return ModuleType::W5;
359 else if ( name.find(
"5") != std::string::npos)
return ModuleType::W6;
360 else if ( name.find(
"6") != std::string::npos)
return ModuleType::W7;
361 }
else if ( name.find(
"BModule") != std::string::npos || name.find(
"EModule") != std::string::npos ) {
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< GeomDetType const * > DetTypeContainer
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
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
void addDetUnit(GeomDetUnit const *p)
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
mapIdToDetUnit theMapUnit
const DetContainer & detsTEC() const
DetTypeContainer theDetTypes
virtual ~TrackerGeometry()
void addType(GeomDetType const *p)
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
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
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
float getDetectorThickness(DetId) const
const DetContainer & detsTID() const
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
virtual const TrackerGeomDet * idToDet(DetId) const
std::vector< DetId > DetIdContainer