CMS 3D CMS Logo

PixelBarrelLayerBuilder.cc
Go to the documentation of this file.
2 #include "PixelRodBuilder.h"
3 
4 using namespace std;
5 using namespace edm;
6 
8  const TrackerGeometry* theGeomDetGeometry) {
9  // This builder is very similar to TOBLayer one. Most of the code should be put in a
10  // common place.
11 
12  vector<const GeometricDet*> theGeometricDetRods = aPixelBarrelLayer->components();
13  //edm::LogInfo(TkDetLayers) << "theGeometricDetRods has size: " << theGeometricDetRods.size() ;
14 
15  PixelRodBuilder myPixelRodBuilder;
16 
17  vector<const PixelRod*> theInnerRods;
18  vector<const PixelRod*> theOuterRods;
19 
20  // properly calculate the meanR value to separate rod in inner/outer.
21 
22  double meanR = 0;
23  for (unsigned int index = 0; index != theGeometricDetRods.size(); index++)
24  meanR += theGeometricDetRods[index]->positionBounds().perp();
25  if (!theGeometricDetRods.empty())
26  meanR /= (double)theGeometricDetRods.size();
27 
28  for (unsigned int index = 0; index != theGeometricDetRods.size(); index++) {
29  if (theGeometricDetRods[index]->positionBounds().perp() < meanR)
30  theInnerRods.push_back(myPixelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry));
31 
32  if (theGeometricDetRods[index]->positionBounds().perp() > meanR)
33  theOuterRods.push_back(myPixelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry));
34  }
35 
36  return new PixelBarrelLayer(theInnerRods, theOuterRods);
37 }
PixelBarrelLayer * build(const GeometricDet *aPixelBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:152
PixelRod * build(const GeometricDet *aRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
HLT enums.
TBPLayer PixelBarrelLayer