Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-12 03:09:41

0001 #ifndef TkDetLayers_PixelForwardLayerBuilder_h
0002 #define TkDetLayers_PixelForwardLayerBuilder_h
0003 
0004 #include "PixelForwardLayer.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 "PixelForwardLayerPhase1.h"
0011 #include "PixelForwardLayer.h"
0012 #include "PixelBladeBuilder.h"
0013 
0014 /** A concrete builder for PixelForwardLayer 
0015  */
0016 
0017 #pragma GCC visibility push(hidden)
0018 
0019 template <class T1, class T2>
0020 class PixelForwardLayerBuilder {
0021 public:
0022   PixelForwardLayerBuilder(){};
0023   ForwardDetLayer* build(const GeometricDet* aPixelForwardLayer, const TrackerGeometry* theGeomDetGeometry)
0024       __attribute__((cold));
0025 };
0026 
0027 template <class T1, class T2>
0028 ForwardDetLayer* PixelForwardLayerBuilder<T1, T2>::build(const GeometricDet* aPixelForwardLayer,
0029                                                          const TrackerGeometry* theGeomDetGeometry) {
0030   std::vector<const GeometricDet*> theGeometricPanels = aPixelForwardLayer->components();
0031   int panelsSize = theGeometricPanels.size();
0032 
0033   /*
0034   int num = 0;
0035   for(std::vector<const GeometricDet*>::const_iterator it= theGeometricPanels.begin();
0036       it!=theGeometricPanels.end(); it++, ++num) {
0037     edm::LogInfo("TkDetLayers") << "PanelsSize: " << panelsSize << " , "
0038                                 << "PanelNum: " << num  << " , "
0039                                 << "panel.phi(): " << (*it)->positionBounds().phi()  << " , "
0040                                 << "panel.z():   " << (*it)->positionBounds().z()    << " , "
0041                                 << "panel.y():   " << (*it)->positionBounds().y() << " , "
0042                                 << "panel.x():   " << (*it)->positionBounds().x() << " , "
0043                                 << "panel.r():   " << (*it)->positionBounds().perp() << " , "
0044                                 << "panel.rmax():   " << (*it)->bounds()->rSpan().second << " , "
0045                                 << "comp.size(): " << (*it)->components().size();
0046   }
0047   */
0048 
0049   //edm::LogInfo(TkDetLayers) << "pixelFwdLayer.panels().size(): " << panelsSize ;
0050 
0051   std::vector<const T1*> theBlades;
0052   PixelBladeBuilder<T1> myBladeBuilder;
0053 
0054   theBlades.reserve((panelsSize / 2));
0055   for (int i = 0; i < (panelsSize / 2); i++) {
0056     theBlades.push_back(
0057         myBladeBuilder.build(theGeometricPanels[i], theGeometricPanels[i + (panelsSize / 2)], theGeomDetGeometry));
0058   }
0059 
0060   return new T2(theBlades);
0061 }
0062 
0063 #pragma GCC visibility pop
0064 #endif