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 
7  const TrackerGeometry* theGeomDetGeometry)
8 {
9  vector<const GeometricDet*> theGeometricDets = aTIDRing->components();
10  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
11 
12 
13  vector<const GeomDet*> innerGeomDets;
14  vector<const GeomDet*> outerGeomDets;
15 
16  //---- to evaluate meanZ
17  double meanZ = 0;
18  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
19  it!=theGeometricDets.end();it++){
20  meanZ = meanZ + (*it)->positionBounds().z();
21  }
22  meanZ = meanZ/theGeometricDets.size();
23  //----
24 
25  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
26  it!=theGeometricDets.end();it++){
27 
28  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
29 
30  if( std::abs( (*it)->positionBounds().z() ) < std::abs(meanZ))
31  innerGeomDets.push_back(theGeomDet);
32 
33  if( std::abs( (*it)->positionBounds().z() ) > std::abs(meanZ))
34  outerGeomDets.push_back(theGeomDet);
35  }
36 
37  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
38  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
39 
40  return new TIDRing(innerGeomDets,outerGeomDets);
41 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TIDRing * build(const GeometricDet *aTIDRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
HLT enums.
const TrackerGeomDet * idToDet(DetId) const override