CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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( fabs( (*it)->positionBounds().z() ) < fabs(meanZ))
31  innerGeomDets.push_back(theGeomDet);
32 
33  if( fabs( (*it)->positionBounds().z() ) > fabs(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 }
TIDRing * build(const GeometricDet *aTIDRing, const TrackerGeometry *theGeomDetGeometry)
virtual const GeomDet * idToDet(DetId) const
GeometricDetContainer & components()
Definition: GeometricDet.h:163