Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-12 09:07:39

0001 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2EndcapBuilder.h"
0002 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0003 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase2TPDiskBuilder.h"
0006 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2DiskBuilder.h"
0007 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2DoubleDiskBuilder.h"
0008 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerOTDiscBuilder.h"
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "DetectorDescription/Core/interface/DDFilteredView.h"
0011 #include "DetectorDescription/DDCMS/interface/DDFilteredView.h"
0012 #include <vector>
0013 
0014 #include <bitset>
0015 
0016 template <class FilteredView>
0017 void CmsTrackerPixelPhase2EndcapBuilder<FilteredView>::buildComponent(FilteredView& fv,
0018                                                                       GeometricDet* g,
0019                                                                       const std::string& s) {
0020   CmsTrackerPhase2TPDiskBuilder<FilteredView> theCmsTrackerPhase2DiskBuilder;
0021   CmsTrackerPixelPhase2DiskBuilder<FilteredView> theCmsTrackerPixelPhase2DiskBuilder;
0022   CmsTrackerPixelPhase2DoubleDiskBuilder<FilteredView> theCmsTrackerPixelPhase2DoubleDiskBuilder;
0023   CmsTrackerOTDiscBuilder<FilteredView> theCmsTrackerOTDiscBuilder;
0024 
0025   GeometricDet* subdet = new GeometricDet(&fv,
0026                                           CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum.type(
0027                                               ExtractStringFromDDD<FilteredView>::getString(s, &fv)));
0028   switch (CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum.type(
0029       ExtractStringFromDDD<FilteredView>::getString(s, &fv))) {
0030     case GeometricDet::PixelPhase2FullDisk:
0031       theCmsTrackerPhase2DiskBuilder.build(fv, subdet, s);
0032       break;
0033     case GeometricDet::PixelPhase2ReducedDisk:
0034       theCmsTrackerPhase2DiskBuilder.build(fv, subdet, s);
0035       break;
0036     case GeometricDet::PixelPhase2TDRDisk:
0037       theCmsTrackerPixelPhase2DiskBuilder.build(fv, subdet, s);
0038       break;
0039     case GeometricDet::PixelPhase2DoubleDisk:
0040       theCmsTrackerPixelPhase2DoubleDiskBuilder.build(fv, subdet, s);
0041       break;
0042     case GeometricDet::OTPhase2Wheel:
0043       theCmsTrackerOTDiscBuilder.build(fv, subdet, s);
0044       break;
0045 
0046     default:
0047       edm::LogError("CmsTrackerPixelPhase2EndcapBuilder")
0048           << " ERROR - I was expecting a Disk... I got a " << ExtractStringFromDDD<FilteredView>::getString(s, &fv);
0049   }
0050 
0051   g->addComponent(subdet);
0052 }
0053 
0054 template <class FilteredView>
0055 void CmsTrackerPixelPhase2EndcapBuilder<FilteredView>::sortNS(FilteredView& fv, GeometricDet* det) {
0056   GeometricDet::ConstGeometricDetContainer& comp = det->components();
0057 
0058   std::sort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::isLessModZ);
0059 
0060   for (uint32_t i = 0; i < comp.size(); i++) {
0061     det->component(i)->setGeographicalID(
0062         i + 1);  // Every subdetector: Inner pixel first, OT later, then sort by disk number
0063   }
0064 }
0065 
0066 template class CmsTrackerPixelPhase2EndcapBuilder<DDFilteredView>;
0067 template class CmsTrackerPixelPhase2EndcapBuilder<cms::DDFilteredView>;