CMS 3D CMS Logo

Public Member Functions

TIDRingBuilder Class Reference

#include <TIDRingBuilder.h>

List of all members.

Public Member Functions

TIDRing * build (const GeometricDet *aTIDRing, const TrackerGeometry *theGeomDetGeometry)
 TIDRingBuilder ()

Detailed Description

A concrete builder for TIDRing

Definition at line 15 of file TIDRingBuilder.h.


Constructor & Destructor Documentation

TIDRingBuilder::TIDRingBuilder ( ) [inline]

Definition at line 17 of file TIDRingBuilder.h.

{};

Member Function Documentation

TIDRing * TIDRingBuilder::build ( const GeometricDet aTIDRing,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 6 of file TIDRingBuilder.cc.

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

Referenced by TIDLayerBuilder::build().

{
  vector<const GeometricDet*>  theGeometricDets = aTIDRing->components();
  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;


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

  //---- to evaluate meanZ
  double meanZ = 0;
  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
      it!=theGeometricDets.end();it++){
    meanZ = meanZ + (*it)->positionBounds().z();
  }
  meanZ = meanZ/theGeometricDets.size();
  //----

  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
      it!=theGeometricDets.end();it++){

    const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );

    if( fabs( (*it)->positionBounds().z() ) < fabs(meanZ))
      innerGeomDets.push_back(theGeomDet);

    if( fabs( (*it)->positionBounds().z() ) > fabs(meanZ))
      outerGeomDets.push_back(theGeomDet);      
  }

  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;

  return new TIDRing(innerGeomDets,outerGeomDets);
}