CMS 3D CMS Logo

PixelRodBuilder.cc
Go to the documentation of this file.
1 #include "PixelRodBuilder.h"
2 
3 using namespace edm;
4 using namespace std;
5 
6 PixelRod* PixelRodBuilder::build(const GeometricDet* aRod, const TrackerGeometry* theGeomDetGeometry) {
7  vector<const GeometricDet*> allGeometricDets = aRod->components();
8 
9  vector<const GeomDet*> theGeomDets;
10  vector<const GeometricDet*> compGeometricDets;
11  for (auto& it : allGeometricDets) {
12  compGeometricDets = it->components();
13  if (it->type() == GeometricDet::ITPhase2Combined) {
14  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalId());
15  theGeomDets.push_back(theGeomDet);
16  const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId());
17  theGeomDets.push_back(theGeomDetBrother);
18  } else if (it->type() == GeometricDet::DetUnit) {
19  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(it->geographicalId());
20  theGeomDets.push_back(theGeomDet);
21  }
22  }
23  return new PixelRod(theGeomDets);
24 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:158
PixelRod * build(const GeometricDet *aRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
const TrackerGeomDet * idToDet(DetId) const override
HLT enums.