CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Phase2OTECRingBuilder.cc
Go to the documentation of this file.
2 
3 using namespace edm;
4 using namespace std;
5 
7  const TrackerGeometry* theGeomDetGeometry)
8 {
9  vector<const GeometricDet*> theGeometricDets = aPhase2OTECRing->components();
10  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
11 
12 
13  vector<const GeomDet*> innerGeomDets;
14  vector<const GeomDet*> outerGeomDets;
15  vector<const GeomDet*> innerGeomDetBrothers;
16  vector<const GeomDet*> outerGeomDetBrothers;
17 
18  //---- to evaluate meanZ
19  double meanZ = 0;
20  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
21  it!=theGeometricDets.end();it++){
22  meanZ = meanZ + (*it)->positionBounds().z();
23  }
24  meanZ = meanZ/theGeometricDets.size();
25  //----
26 
27  unsigned int counter=0;
28  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
29  it!=theGeometricDets.end();it++,counter++){
30 
31  if(counter%2 == 0) {
32 
33  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
34 
35  if( std::abs( (*it)->positionBounds().z() ) < std::abs(meanZ))
36  innerGeomDets.push_back(theGeomDet);
37 
38  if( std::abs( (*it)->positionBounds().z() ) > std::abs(meanZ))
39  outerGeomDets.push_back(theGeomDet);
40  }
41  else {
42 
43  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
44 
45  if( std::abs( (*it)->positionBounds().z() ) < std::abs(meanZ))
46  innerGeomDetBrothers.push_back(theGeomDet);
47 
48  if( std::abs( (*it)->positionBounds().z() ) > std::abs(meanZ))
49  outerGeomDetBrothers.push_back(theGeomDet);
50  }
51  }
52 
53  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
54  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
55 
56  return new Phase2OTECRing(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers);
57 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
Phase2OTECRing * build(const GeometricDet *aPhase2OTECRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static std::atomic< unsigned int > counter
virtual const TrackerGeomDet * idToDet(DetId) const