CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
8  const TrackerGeometry* theGeomDetGeometry)
9 {
10  vector<const GeometricDet*> theGeometricDetPetals = aTECLayer->components();
11  vector<const TECPetal*> theInnerPetals;
12  vector<const TECPetal*> theOuterPetals;
13 
14  //edm::LogInfo(TkDetLayers) << "theGeometricDetPetals.size(): " << theGeometricDetPetals.size() ;
15 
16  double meanZ = ( theGeometricDetPetals.front()->positionBounds().z() +
17  theGeometricDetPetals.back()->positionBounds().z() )/2;
18 
19  TECPetalBuilder myPetalBuilder;
20 
21 
22  for(vector<const GeometricDet*>::const_iterator it=theGeometricDetPetals.begin();
23  it!=theGeometricDetPetals.end();it++){
24 
25  if( std::abs((*it)->positionBounds().z()) < std::abs(meanZ) )
26  theInnerPetals.push_back(myPetalBuilder.build(*it,theGeomDetGeometry));
27 
28  if( std::abs((*it)->positionBounds().z()) > std::abs(meanZ) )
29  theOuterPetals.push_back(myPetalBuilder.build(*it,theGeomDetGeometry));
30  }
31 
32  return new TECLayer(theInnerPetals,theOuterPetals);
33 }
TECLayer * build(const GeometricDet *aTECLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TECPetal * build(const GeometricDet *aTECPetal, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))