CMS 3D CMS Logo

List of all members | Public Member Functions
TOBRodBuilder Class Reference

#include <TOBRodBuilder.h>

Public Member Functions

TOBRodbuild (const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 TOBRodBuilder ()
 

Detailed Description

A concrete builder for TOBRod

Definition at line 14 of file TOBRodBuilder.h.

Constructor & Destructor Documentation

◆ TOBRodBuilder()

TOBRodBuilder::TOBRodBuilder ( )
inline

Definition at line 16 of file TOBRodBuilder.h.

16 {};

Member Function Documentation

◆ build()

TOBRod * TOBRodBuilder::build ( const GeometricDet negTOBRod,
const GeometricDet posTOBRod,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 7 of file TOBRodBuilder.cc.

9  {
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 }

References GeometricDet::components(), TrackerGeometry::idToDet(), and align::TOBRod.

Referenced by TOBLayerBuilder::build().

TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
GeomDet
Definition: GeomDet.h:27
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
align::TOBRod
Definition: StructureType.h:55