CMS 3D CMS Logo

List of all members | Public Member Functions
PixelRodBuilder Class Reference

#include <PixelRodBuilder.h>

Public Member Functions

PixelRodbuild (const GeometricDet *aRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 PixelRodBuilder ()
 

Detailed Description

A concrete builder for PixelRod

Definition at line 14 of file PixelRodBuilder.h.

Constructor & Destructor Documentation

◆ PixelRodBuilder()

PixelRodBuilder::PixelRodBuilder ( )
inline

Definition at line 16 of file PixelRodBuilder.h.

16 {};

Member Function Documentation

◆ build()

PixelRod * PixelRodBuilder::build ( const GeometricDet aRod,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 6 of file PixelRodBuilder.cc.

References GeometricDet::components(), GeometricDet::DetUnit, TrackerGeometry::idToDet(), and GeometricDet::ITPhase2Combined.

Referenced by PixelBarrelLayerBuilder::build().

6  {
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:154
const TrackerGeomDet * idToDet(DetId) const override