CMS 3D CMS Logo

TIDRingBuilder.cc
Go to the documentation of this file.
1 #include "TIDRingBuilder.h"
2 
3 using namespace edm;
4 using namespace std;
5 
6 TIDRing* TIDRingBuilder::build(const GeometricDet* aTIDRing, const TrackerGeometry* theGeomDetGeometry) {
7  vector<const GeometricDet*> theGeometricDets = aTIDRing->components();
8  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
9 
10  vector<const GeomDet*> innerGeomDets;
11  vector<const GeomDet*> outerGeomDets;
12 
13  //---- to evaluate meanZ
14  double meanZ = 0;
15  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
16  meanZ = meanZ + (*it)->positionBounds().z();
17  }
18  meanZ = meanZ / theGeometricDets.size();
19  //----
20 
21  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
22  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
23 
24  if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
25  innerGeomDets.push_back(theGeomDet);
26 
27  if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
28  outerGeomDets.push_back(theGeomDet);
29  }
30 
31  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
32  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
33 
34  return new TIDRing(innerGeomDets, outerGeomDets);
35 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:151
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const TrackerGeomDet * idToDet(DetId) const override
TIDRing * build(const GeometricDet *aTIDRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
HLT enums.