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 15 of file PixelBarrelLayerBuilder.h.

Constructor & Destructor Documentation

PixelBarrelLayerBuilder::PixelBarrelLayerBuilder ( )
inline

Definition at line 17 of file PixelBarrelLayerBuilder.h.

References build().

17 {};

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().

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