CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TOBRodBuilder.cc
Go to the documentation of this file.
1 #include "TOBRodBuilder.h"
3 
4 using namespace edm;
5 using namespace std;
6 
8  const GeometricDet* posTOBRod,
9  const TrackerGeometry* theGeomDetGeometry)
10 {
11  vector<const GeometricDet*> theNegativeGeometricDets;
12  if (negTOBRod != 0) theNegativeGeometricDets = negTOBRod->components();
13  vector<const GeometricDet*> thePositiveGeometricDets;
14  if (posTOBRod != 0) thePositiveGeometricDets = posTOBRod->components();
15 
16  vector<const GeometricDet*> allGeometricDets = theNegativeGeometricDets;
17  allGeometricDets.insert(allGeometricDets.end(),thePositiveGeometricDets.begin(),
18  thePositiveGeometricDets.end());
19 
20  vector<const GeomDet*> innerGeomDets;
21  vector<const GeomDet*> outerGeomDets;
22 
23  double meanR = (allGeometricDets[0]->positionBounds().perp()+allGeometricDets[1]->positionBounds().perp())/2;
24  for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin();
25  it!=allGeometricDets.end(); it++){
26  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
27 
28  if( (*it)->positionBounds().perp() < meanR)
29  innerGeomDets.push_back(theGeomDet);
30 
31  if( (*it)->positionBounds().perp() > meanR)
32  outerGeomDets.push_back(theGeomDet);
33 
34  }
35 
36  //LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ;
37  //LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ;
38  return new TOBRod(innerGeomDets,outerGeomDets);
39 }
virtual const GeomDet * idToDet(DetId) const
GeometricDetContainer & components()
Definition: GeometricDet.h:163
TOBRod * build(const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry)
Definition: TOBRodBuilder.cc:7