CMS 3D CMS Logo

List of all members | Public Member Functions
PixelBarrelLayerBuilder Class Reference

#include <PixelBarrelLayerBuilder.h>

Public Member Functions

PixelBarrelLayerbuild (const GeometricDet *aPixelBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 PixelBarrelLayerBuilder ()
 

Detailed Description

A concrete builder for PixelBarrelLayer

Definition at line 14 of file PixelBarrelLayerBuilder.h.

Constructor & Destructor Documentation

PixelBarrelLayerBuilder::PixelBarrelLayerBuilder ( )
inline

Definition at line 16 of file PixelBarrelLayerBuilder.h.

References build().

16 {};

Member Function Documentation

PixelBarrelLayer * PixelBarrelLayerBuilder::build ( const GeometricDet aPixelBarrelLayer,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 7 of file PixelBarrelLayerBuilder.cc.

References PixelRodBuilder::build(), and GeometricDet::components().

Referenced by GeometricSearchTrackerBuilder::build(), and PixelBarrelLayerBuilder().

8  {
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 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
PixelRod * build(const GeometricDet *aRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
TBPLayer PixelBarrelLayer