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 }
edm
HLT enums.
Definition: AlignableModifier.h:19
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
TECPetalBuilder::build
TECPetal * build(const GeometricDet *aTECPetal, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TECPetalBuilder.cc:8
TECLayerBuilder.h
GeometricDet
Definition: GeometricDet.h:30
TECPetalBuilder.h
TECLayer
Definition: TECLayer.h:15
TECPetalBuilder
Definition: TECPetalBuilder.h:14
TECLayerBuilder::build
TECLayer * build(const GeometricDet *aTECLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TECLayerBuilder.cc:7
std
Definition: JetResolutionObject.h:76
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackerGeometry
Definition: TrackerGeometry.h:14