#include <TOBRodBuilder.h>
Public Member Functions | |
TOBRod * | build (const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry) |
TOBRodBuilder () |
A concrete builder for TOBRod
Definition at line 15 of file TOBRodBuilder.h.
TOBRodBuilder::TOBRodBuilder | ( | ) | [inline] |
Definition at line 17 of file TOBRodBuilder.h.
{};
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); }