CMS 3D CMS Logo

TECPetalBuilder.cc
Go to the documentation of this file.
1 #include "TECPetalBuilder.h"
2 #include "TECWedgeBuilder.h"
3 #include "CompositeTECPetal.h"
4 
5 using namespace edm;
6 using namespace std;
7 
8 TECPetal* TECPetalBuilder::build(const GeometricDet* aTECPetal, const TrackerGeometry* theGeomDetGeometry) {
9  vector<const GeometricDet*> theGeometricWedges = aTECPetal->components();
10  //edm::LogInfo(TkDetLayers) << "theGeometricWedges.size(): " << theGeometricWedges.size() ;
11 
12  vector<const TECWedge*> theInnerWedges;
13  vector<const TECWedge*> theOuterWedges;
14 
15  double meanZ = (theGeometricWedges[0]->positionBounds().z() + theGeometricWedges[1]->positionBounds().z()) / 2;
16 
17  TECWedgeBuilder myWedgeBuilder;
18 
19  for (vector<const GeometricDet*>::const_iterator it = theGeometricWedges.begin(); it != theGeometricWedges.end();
20  it++) {
21  if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
22  theInnerWedges.push_back(myWedgeBuilder.build(*it, theGeomDetGeometry));
23 
24  if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
25  theOuterWedges.push_back(myWedgeBuilder.build(*it, theGeomDetGeometry));
26  }
27 
28  //edm::LogInfo(TkDetLayers) << "theInnerWededges.size(): " << theInnerWedges.size() ;
29  //edm::LogInfo(TkDetLayers) << "theOuterWededges.size(): " << theOuterWedges.size() ;
30 
31  return new CompositeTECPetal(theInnerWedges, theOuterWedges);
32 }
TECWedge * build(const GeometricDet *aTECWedge, 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))