CMS 3D CMS Logo

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 }
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
MessageLogger.h
GeomDet
Definition: GeomDet.h:27
TOBRodBuilder::build
TOBRod * build(const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TOBRodBuilder.cc:7
edm
HLT enums.
Definition: AlignableModifier.h:19
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
TOBRod
Definition: TOBRod.h:14
TOBRodBuilder.h
GeometricDet
Definition: GeometricDet.h:30
std
Definition: JetResolutionObject.h:76
align::TOBRod
Definition: StructureType.h:55
TrackerGeometry
Definition: TrackerGeometry.h:14