Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:02:58

0001 #include "PixelRodBuilder.h"
0002 
0003 using namespace edm;
0004 using namespace std;
0005 
0006 PixelRod* PixelRodBuilder::build(const GeometricDet* aRod, const TrackerGeometry* theGeomDetGeometry) {
0007   vector<const GeometricDet*> allGeometricDets = aRod->components();
0008 
0009   vector<const GeomDet*> theGeomDets;
0010   vector<const GeometricDet*> compGeometricDets;
0011   for (auto& it : allGeometricDets) {
0012     compGeometricDets = it->components();
0013     if (it->type() == GeometricDet::ITPhase2Combined) {
0014       const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalId());
0015       theGeomDets.push_back(theGeomDet);
0016       const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId());
0017       theGeomDets.push_back(theGeomDetBrother);
0018     } else if (it->type() == GeometricDet::DetUnit) {
0019       const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(it->geographicalId());
0020       theGeomDets.push_back(theGeomDet);
0021     }
0022   }
0023   return new PixelRod(theGeomDets);
0024 }