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 }
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
GeomDet
Definition: GeomDet.h:27
edm
HLT enums.
Definition: AlignableModifier.h:19
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
GeometricDet
Definition: GeometricDet.h:30
align::TIDRing
Definition: StructureType.h:49
TIDRingBuilder.h
TIDRingBuilder::build
TIDRing * build(const GeometricDet *aTIDRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TIDRingBuilder.cc:6
TIDRing
Definition: TIDRing.h:13
std
Definition: JetResolutionObject.h:76
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackerGeometry
Definition: TrackerGeometry.h:14