CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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  vector<const GeometricDet*> theNegativeGeometricDets;
11  if (negTOBRod != nullptr)
12  theNegativeGeometricDets = negTOBRod->components();
13  vector<const GeometricDet*> thePositiveGeometricDets;
14  if (posTOBRod != nullptr)
15  thePositiveGeometricDets = posTOBRod->components();
16 
17  vector<const GeometricDet*> allGeometricDets = theNegativeGeometricDets;
18  allGeometricDets.insert(allGeometricDets.end(), thePositiveGeometricDets.begin(), 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(); it != allGeometricDets.end(); it++) {
25  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
26 
27  if ((*it)->positionBounds().perp() < meanR)
28  innerGeomDets.push_back(theGeomDet);
29 
30  if ((*it)->positionBounds().perp() > meanR)
31  outerGeomDets.push_back(theGeomDet);
32  }
33 
34  //LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ;
35  //LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ;
36  return new TOBRod(innerGeomDets, outerGeomDets);
37 }
Definition: TOBRod.h:14
TOBRod * build(const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TOBRodBuilder.cc:7
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
const TrackerGeomDet * idToDet(DetId) const override