CMS 3D CMS Logo

TECLayerBuilder.cc
Go to the documentation of this file.
1 #include "TECLayerBuilder.h"
2 #include "TECPetalBuilder.h"
3 
4 using namespace edm;
5 using namespace std;
6 
7 TECLayer* TECLayerBuilder::build(const GeometricDet* aTECLayer, const TrackerGeometry* theGeomDetGeometry) {
8  vector<const GeometricDet*> theGeometricDetPetals = aTECLayer->components();
9  vector<const TECPetal*> theInnerPetals;
10  vector<const TECPetal*> theOuterPetals;
11 
12  //edm::LogInfo(TkDetLayers) << "theGeometricDetPetals.size(): " << theGeometricDetPetals.size() ;
13 
14  double meanZ =
15  (theGeometricDetPetals.front()->positionBounds().z() + theGeometricDetPetals.back()->positionBounds().z()) / 2;
16 
17  TECPetalBuilder myPetalBuilder;
18 
19  for (vector<const GeometricDet*>::const_iterator it = theGeometricDetPetals.begin();
20  it != theGeometricDetPetals.end();
21  it++) {
22  if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
23  theInnerPetals.push_back(myPetalBuilder.build(*it, theGeomDetGeometry));
24 
25  if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
26  theOuterPetals.push_back(myPetalBuilder.build(*it, theGeomDetGeometry));
27  }
28 
29  return new TECLayer(theInnerPetals, theOuterPetals);
30 }
TECLayer * build(const GeometricDet *aTECLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:158
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLT enums.
TECPetal * build(const GeometricDet *aTECPetal, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))