Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:49

0001 #include "TIDRingBuilder.h"
0002 
0003 using namespace edm;
0004 using namespace std;
0005 
0006 TIDRing* TIDRingBuilder::build(const GeometricDet* aTIDRing, const TrackerGeometry* theGeomDetGeometry) {
0007   vector<const GeometricDet*> theGeometricDets = aTIDRing->components();
0008   //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
0009 
0010   vector<const GeomDet*> innerGeomDets;
0011   vector<const GeomDet*> outerGeomDets;
0012 
0013   //---- to evaluate meanZ
0014   double meanZ = 0;
0015   for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
0016     meanZ = meanZ + (*it)->positionBounds().z();
0017   }
0018   meanZ = meanZ / theGeometricDets.size();
0019   //----
0020 
0021   for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
0022     const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
0023 
0024     if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
0025       innerGeomDets.push_back(theGeomDet);
0026 
0027     if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
0028       outerGeomDets.push_back(theGeomDet);
0029   }
0030 
0031   //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
0032   //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
0033 
0034   return new TIDRing(innerGeomDets, outerGeomDets);
0035 }