Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:22:52

0001 #include "TECPetalBuilder.h"
0002 #include "TECWedgeBuilder.h"
0003 #include "CompositeTECPetal.h"
0004 
0005 using namespace edm;
0006 using namespace std;
0007 
0008 TECPetal* TECPetalBuilder::build(const GeometricDet* aTECPetal, const TrackerGeometry* theGeomDetGeometry) {
0009   vector<const GeometricDet*> theGeometricWedges = aTECPetal->components();
0010   //edm::LogInfo(TkDetLayers) << "theGeometricWedges.size(): " << theGeometricWedges.size() ;
0011 
0012   vector<const TECWedge*> theInnerWedges;
0013   vector<const TECWedge*> theOuterWedges;
0014 
0015   double meanZ = (theGeometricWedges[0]->positionBounds().z() + theGeometricWedges[1]->positionBounds().z()) / 2;
0016 
0017   TECWedgeBuilder myWedgeBuilder;
0018 
0019   for (vector<const GeometricDet*>::const_iterator it = theGeometricWedges.begin(); it != theGeometricWedges.end();
0020        it++) {
0021     if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
0022       theInnerWedges.push_back(myWedgeBuilder.build(*it, theGeomDetGeometry));
0023 
0024     if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
0025       theOuterWedges.push_back(myWedgeBuilder.build(*it, theGeomDetGeometry));
0026   }
0027 
0028   //edm::LogInfo(TkDetLayers) << "theInnerWededges.size(): " << theInnerWedges.size() ;
0029   //edm::LogInfo(TkDetLayers) << "theOuterWededges.size(): " << theOuterWedges.size() ;
0030 
0031   return new CompositeTECPetal(theInnerWedges, theOuterWedges);
0032 }