CMS 3D CMS Logo

List of all members | Public Member Functions
TOBRodBuilder Class Reference

#include <TOBRodBuilder.h>

Public Member Functions

TOBRodbuild (const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 TOBRodBuilder ()
 

Detailed Description

A concrete builder for TOBRod

Definition at line 15 of file TOBRodBuilder.h.

Constructor & Destructor Documentation

TOBRodBuilder::TOBRodBuilder ( )
inline

Definition at line 17 of file TOBRodBuilder.h.

References build().

17 {};

Member Function Documentation

TOBRod * TOBRodBuilder::build ( const GeometricDet negTOBRod,
const GeometricDet posTOBRod,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 7 of file TOBRodBuilder.cc.

References GeometricDet::components(), TrackerGeometry::idToDet(), and align::TOBRod.

Referenced by TOBLayerBuilder::build(), and TOBRodBuilder().

10 {
11  vector<const GeometricDet*> theNegativeGeometricDets;
12  if (negTOBRod != 0) theNegativeGeometricDets = negTOBRod->components();
13  vector<const GeometricDet*> thePositiveGeometricDets;
14  if (posTOBRod != 0) thePositiveGeometricDets = posTOBRod->components();
15 
16  vector<const GeometricDet*> allGeometricDets = theNegativeGeometricDets;
17  allGeometricDets.insert(allGeometricDets.end(),thePositiveGeometricDets.begin(),
18  thePositiveGeometricDets.end());
19 
20  vector<const GeomDet*> innerGeomDets;
21  vector<const GeomDet*> outerGeomDets;
22 
23  double meanR = (allGeometricDets[0]->positionBounds().perp()+allGeometricDets[1]->positionBounds().perp())/2;
24  for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin();
25  it!=allGeometricDets.end(); it++){
26  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
27 
28  if( (*it)->positionBounds().perp() < meanR)
29  innerGeomDets.push_back(theGeomDet);
30 
31  if( (*it)->positionBounds().perp() > meanR)
32  outerGeomDets.push_back(theGeomDet);
33 
34  }
35 
36  //LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ;
37  //LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ;
38  return new TOBRod(innerGeomDets,outerGeomDets);
39 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
const TrackerGeomDet * idToDet(DetId) const override