Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "TECWedgeBuilder.h"
0002 #include "CompositeTECWedge.h"
0003 #include "SimpleTECWedge.h"
0004 
0005 using namespace edm;
0006 using namespace std;
0007 
0008 TECWedge* TECWedgeBuilder::build(const GeometricDet* aTECWedge, const TrackerGeometry* theGeomDetGeometry) {
0009   vector<const GeometricDet*> theGeometricDets = aTECWedge->components();
0010   //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
0011 
0012   if (theGeometricDets.size() == 1) {
0013     const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(theGeometricDets.front()->geographicalId());
0014     return new SimpleTECWedge(theGeomDet);
0015   }
0016 
0017   vector<const GeomDet*> innerGeomDets;
0018   vector<const GeomDet*> outerGeomDets;
0019 
0020   //---- to evaluate meanZ
0021   double meanZ = 0;
0022   for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
0023     meanZ = meanZ + (*it)->positionBounds().z();
0024   }
0025 
0026   meanZ = meanZ / theGeometricDets.size();
0027   //edm::LogInfo(TkDetLayers) << "meanZ: " << meanZ ;
0028   //----
0029 
0030   for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
0031     //double theGeometricDetRposition = (*it)->positionBounds().perp();
0032     const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
0033     //double theGeomDetRposition = theGeomDet->surface().position().perp();
0034 
0035     if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
0036       innerGeomDets.push_back(theGeomDet);
0037 
0038     if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
0039       outerGeomDets.push_back(theGeomDet);
0040   }
0041 
0042   //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
0043   //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
0044 
0045   return new CompositeTECWedge(innerGeomDets, outerGeomDets);
0046 }