Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:11

0001 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerStringBuilder.h"
0002 #include "DetectorDescription/Core/interface/DDFilteredView.h"
0003 #include "DetectorDescription/DDCMS/interface/DDFilteredView.h"
0004 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0005 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
0006 #include "DataFormats/DetId/interface/DetId.h"
0007 #include "Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009 #include <vector>
0010 
0011 template <class FilteredView>
0012 void CmsTrackerStringBuilder<FilteredView>::buildComponent(FilteredView& fv, GeometricDet* g, const std::string& s) {
0013   CmsDetConstruction<FilteredView> theCmsDetConstruction;
0014   theCmsDetConstruction.buildComponent(fv, g, s);
0015 }
0016 
0017 template <class FilteredView>
0018 void CmsTrackerStringBuilder<FilteredView>::sortNS(FilteredView& fv, GeometricDet* det) {
0019   GeometricDet::ConstGeometricDetContainer& comp = det->components();
0020 
0021   std::stable_sort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::isLessModZ);
0022 
0023   if (!comp.empty()) {
0024     for (uint32_t i = 0; i < comp.size(); i++) {
0025       det->component(i)->setGeographicalID(DetId(i + 1));
0026     }
0027   } else {
0028     edm::LogError("CmsTrackerStringBuilder") << "Where are the String's modules?";
0029   }
0030 }
0031 
0032 template class CmsTrackerStringBuilder<DDFilteredView>;
0033 template class CmsTrackerStringBuilder<cms::DDFilteredView>;