Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "TECLayerBuilder.h"
0002 #include "TECPetalBuilder.h"
0003 
0004 using namespace edm;
0005 using namespace std;
0006 
0007 TECLayer* TECLayerBuilder::build(const GeometricDet* aTECLayer, const TrackerGeometry* theGeomDetGeometry) {
0008   vector<const GeometricDet*> theGeometricDetPetals = aTECLayer->components();
0009   vector<const TECPetal*> theInnerPetals;
0010   vector<const TECPetal*> theOuterPetals;
0011 
0012   //edm::LogInfo(TkDetLayers) << "theGeometricDetPetals.size(): " << theGeometricDetPetals.size() ;
0013 
0014   double meanZ =
0015       (theGeometricDetPetals.front()->positionBounds().z() + theGeometricDetPetals.back()->positionBounds().z()) / 2;
0016 
0017   TECPetalBuilder myPetalBuilder;
0018 
0019   for (vector<const GeometricDet*>::const_iterator it = theGeometricDetPetals.begin();
0020        it != theGeometricDetPetals.end();
0021        it++) {
0022     if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
0023       theInnerPetals.push_back(myPetalBuilder.build(*it, theGeomDetGeometry));
0024 
0025     if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
0026       theOuterPetals.push_back(myPetalBuilder.build(*it, theGeomDetGeometry));
0027   }
0028 
0029   return new TECLayer(theInnerPetals, theOuterPetals);
0030 }