CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
Phase2OTBarrelLayerBuilder Class Reference

#include <Phase2OTBarrelLayerBuilder.h>

Public Member Functions

Phase2OTBarrelLayerbuild (const GeometricDet *aPhase2OTBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 Phase2OTBarrelLayerBuilder ()
 

Detailed Description

A concrete builder for Phase2OTBarrelLayer

Definition at line 15 of file Phase2OTBarrelLayerBuilder.h.

Constructor & Destructor Documentation

Phase2OTBarrelLayerBuilder::Phase2OTBarrelLayerBuilder ( )
inline

Definition at line 17 of file Phase2OTBarrelLayerBuilder.h.

17 {};

Member Function Documentation

Phase2OTBarrelLayer * Phase2OTBarrelLayerBuilder::build ( const GeometricDet aPhase2OTBarrelLayer,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 7 of file Phase2OTBarrelLayerBuilder.cc.

References Phase2OTBarrelRodBuilder::build(), GeometricDet::components(), cmsHarvester::index, and LogDebug.

Referenced by GeometricSearchTrackerBuilder::build().

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 = aPhase2OTBarrelLayer->components();
14  LogDebug("TkDetLayers") << "Phase2OTBarrelLayerBuilder with #Rods: " << theGeometricDetRods.size() << std::endl;
15 
16  Phase2OTBarrelRodBuilder myPhase2OTBarrelRodBuilder;
17 
18  vector<const Phase2OTBarrelRod*> theInnerRods;
19  vector<const Phase2OTBarrelRod*> theOuterRods;
20 
21  // properly calculate the meanR value to separate rod in inner/outer.
22 
23  double meanR = 0;
24  for (unsigned int index=0; index!=theGeometricDetRods.size(); index++) meanR+=theGeometricDetRods[index]->positionBounds().perp();
25  if (theGeometricDetRods.size()!=0)
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(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index],
31  theGeomDetGeometry) );
32 
33  if(theGeometricDetRods[index]->positionBounds().perp() > meanR)
34  theOuterRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index],
35  theGeomDetGeometry) );
36 
37  }
38 
39  return new Phase2OTBarrelLayer(theInnerRods,theOuterRods);
40 
41 }
#define LogDebug(id)
TBPLayer Phase2OTBarrelLayer
Phase2OTBarrelRod * build(const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174