Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:45

0001 #ifndef TkDetLayers_PixelBladeBuilder_h
0002 #define TkDetLayers_PixelBladeBuilder_h
0003 
0004 //#include "PixelBlade.h"
0005 
0006 #include "FWCore/Framework/interface/ESHandle.h"
0007 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0008 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0009 
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 
0012 #include "DataFormats/GeometrySurface/interface/TkRotation.h"
0013 
0014 /** A concrete builder for PixelBlade
0015  */
0016 
0017 #pragma GCC visibility push(hidden)
0018 template <class T>
0019 class PixelBladeBuilder {
0020 public:
0021   PixelBladeBuilder(){};
0022 
0023   T* build(const GeometricDet* geometricDetFrontPanel,
0024            const GeometricDet* geometricDetBackPanel,
0025            const TrackerGeometry* theGeomDetGeometry) __attribute__((cold));
0026 };
0027 
0028 template <class T>
0029 T* PixelBladeBuilder<T>::build(const GeometricDet* geometricDetFrontPanel,
0030                                const GeometricDet* geometricDetBackPanel,
0031                                const TrackerGeometry* theGeomDetGeometry)
0032 
0033 {
0034   std::vector<const GeometricDet*> frontGeometricDets = geometricDetFrontPanel->components();
0035   std::vector<const GeometricDet*> backGeometricDets = geometricDetBackPanel->components();
0036 
0037   std::vector<const GeomDet*> theFrontGeomDets;
0038   std::vector<const GeomDet*> theBackGeomDets;
0039 
0040   for (std::vector<const GeometricDet*>::iterator it = frontGeometricDets.begin(); it != frontGeometricDets.end();
0041        it++) {
0042     const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
0043     theFrontGeomDets.push_back(theGeomDet);
0044   }
0045 
0046   for (std::vector<const GeometricDet*>::iterator it = backGeometricDets.begin(); it != backGeometricDets.end(); it++) {
0047     const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
0048     theBackGeomDets.push_back(theGeomDet);
0049   }
0050 
0051   //edm::LogInfo(TkDetLayers) << "FrontGeomDet.size(): " << theFrontGeomDets.size() ;
0052   //edm::LogInfo(TkDetLayers) << "BackGeomDet.size():  " << theBackGeomDets.size() ;
0053 
0054   return new T(theFrontGeomDets, theBackGeomDets);
0055 }
0056 
0057 #pragma GCC visibility pop
0058 #endif