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 }
PixelRodBuilder
Definition: PixelRodBuilder.h:14
PixelRodBuilder::build
PixelRod * build(const GeometricDet *aRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: PixelRodBuilder.cc:6
edm
HLT enums.
Definition: AlignableModifier.h:19
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
PixelBarrelLayerBuilder::build
PixelBarrelLayer * build(const GeometricDet *aPixelBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: PixelBarrelLayerBuilder.cc:7
GeometricDet
Definition: GeometricDet.h:31
PixelRodBuilder.h
TBPLayer
Definition: TBPLayer.h:15
PixelBarrelLayer
TBPLayer PixelBarrelLayer
Definition: PixelBarrelLayer.h:11
std
Definition: JetResolutionObject.h:76
PixelBarrelLayerBuilder.h
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackerGeometry
Definition: TrackerGeometry.h:14