CMS 3D CMS Logo

Public Member Functions

TOBRodBuilder Class Reference

#include <TOBRodBuilder.h>

List of all members.

Public Member Functions

TOBRod * build (const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry)
 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.

{};

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

{  
  vector<const GeometricDet*>  theNegativeGeometricDets;
  if (negTOBRod != 0) theNegativeGeometricDets = negTOBRod->components();
  vector<const GeometricDet*>  thePositiveGeometricDets;
  if (posTOBRod != 0) thePositiveGeometricDets = posTOBRod->components();

  vector<const GeometricDet*> allGeometricDets = theNegativeGeometricDets;
  allGeometricDets.insert(allGeometricDets.end(),thePositiveGeometricDets.begin(),
                          thePositiveGeometricDets.end());

  vector<const GeomDet*> innerGeomDets;
  vector<const GeomDet*> outerGeomDets;

  double meanR = (allGeometricDets[0]->positionBounds().perp()+allGeometricDets[1]->positionBounds().perp())/2;
  for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin();
      it!=allGeometricDets.end(); it++){
    const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );

    if( (*it)->positionBounds().perp() < meanR) 
      innerGeomDets.push_back(theGeomDet);
    
    if( (*it)->positionBounds().perp() > meanR) 
      outerGeomDets.push_back(theGeomDet);
    
  }
  
  //LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ;
  //LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ;
  return new TOBRod(innerGeomDets,outerGeomDets);
}