Go to the documentation of this file.00001 #include "TECWedgeBuilder.h"
00002 #include "CompositeTECWedge.h"
00003 #include "SimpleTECWedge.h"
00004
00005 using namespace edm;
00006 using namespace std;
00007
00008 TECWedge* TECWedgeBuilder::build(const GeometricDet* aTECWedge,
00009 const TrackerGeometry* theGeomDetGeometry)
00010 {
00011 vector<const GeometricDet*> theGeometricDets = aTECWedge->components();
00012
00013
00014 if(theGeometricDets.size() == 1 ) {
00015 const GeomDet* theGeomDet =
00016 theGeomDetGeometry->idToDet( theGeometricDets.front()->geographicalID() );
00017 return new SimpleTECWedge(theGeomDet);
00018 }
00019
00020 vector<const GeomDet*> innerGeomDets;
00021 vector<const GeomDet*> outerGeomDets;
00022
00023
00024 double meanZ = 0;
00025 for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
00026 it!=theGeometricDets.end();it++){
00027 meanZ = meanZ + (*it)->positionBounds().z();
00028 }
00029
00030 meanZ = meanZ/theGeometricDets.size();
00031
00032
00033
00034 for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
00035 it!=theGeometricDets.end();it++){
00036
00037 const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
00038
00039
00040 if( fabs( (*it)->positionBounds().z() ) < fabs(meanZ))
00041 innerGeomDets.push_back(theGeomDet);
00042
00043 if( fabs( (*it)->positionBounds().z() ) > fabs(meanZ))
00044 outerGeomDets.push_back(theGeomDet);
00045 }
00046
00047
00048
00049
00050 return new CompositeTECWedge(innerGeomDets,outerGeomDets);
00051 }