Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPetalBuilder.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 "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.h"
0007 #include "DataFormats/DetId/interface/DetId.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009 #include <vector>
0010 
0011 template <class FilteredView>
0012 void CmsTrackerPetalBuilder<FilteredView>::buildComponent(FilteredView& fv, GeometricDet* g, const std::string& s) {
0013   GeometricDet* det = new GeometricDet(&fv,
0014                                        CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum.type(
0015                                            ExtractStringFromDDD<FilteredView>::getString(s, &fv)));
0016   CmsTrackerRingBuilder<FilteredView> theCmsTrackerRingBuilder;
0017   theCmsTrackerRingBuilder.build(fv, det, s);
0018   g->addComponent(det);
0019 }
0020 
0021 template <class FilteredView>
0022 void CmsTrackerPetalBuilder<FilteredView>::sortNS(FilteredView& fv, GeometricDet* det) {
0023   GeometricDet::ConstGeometricDetContainer& comp = det->components();
0024 
0025   if (comp.front()->type() == GeometricDet::ring)
0026     std::sort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::isLessRModule);
0027   else
0028     edm::LogError("CmsTrackerPetalBuilder")
0029         << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
0030 
0031   // Maximum Number fo TEC Rings is 7 in order
0032   // to discover from which number we have to start
0033   // the operation is MaxRing - RealRingNumber + 1 (C++)
0034 
0035   uint32_t startring = 8 - comp.size();
0036 
0037   for (uint32_t i = 0; i < comp.size(); i++) {
0038     det->component(i)->setGeographicalID(startring + i);
0039   }
0040 }
0041 
0042 template class CmsTrackerPetalBuilder<DDFilteredView>;
0043 template class CmsTrackerPetalBuilder<cms::DDFilteredView>;