CMS 3D CMS Logo

List of all members | Public Member Functions
Phase2OTBarrelRodBuilder Class Reference

#include <Phase2OTBarrelRodBuilder.h>

Public Member Functions

Phase2OTBarrelRodbuild (const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 Phase2OTBarrelRodBuilder ()
 

Detailed Description

A concrete builder for Phase2OTBarrelRod

Definition at line 14 of file Phase2OTBarrelRodBuilder.h.

Constructor & Destructor Documentation

◆ Phase2OTBarrelRodBuilder()

Phase2OTBarrelRodBuilder::Phase2OTBarrelRodBuilder ( )
inline

Definition at line 16 of file Phase2OTBarrelRodBuilder.h.

16 {};

Member Function Documentation

◆ build()

Phase2OTBarrelRod * Phase2OTBarrelRodBuilder::build ( const GeometricDet thePhase2OTBarrelRod,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 7 of file Phase2OTBarrelRodBuilder.cc.

8  {
9  vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components();
10  vector<const GeometricDet*> compGeometricDets;
11  LogDebug("TkDetLayers") << "Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl;
12 
13  vector<const GeomDet*> innerGeomDets;
14  vector<const GeomDet*> outerGeomDets;
15  vector<const GeomDet*> innerGeomDetBrothers;
16  vector<const GeomDet*> outerGeomDetBrothers;
17 
18  double meanR = 0;
19  double meanRBrothers = 0;
20  for (vector<const GeometricDet*>::const_iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) {
21  compGeometricDets = (*it)->components();
22  if (compGeometricDets.size() != 2) {
23  LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl;
24  } else {
25  //LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().perp() << std::endl;
26  //LogTrace("TkDetLayers") << " compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().perp() << std::endl;
27  meanR = meanR + compGeometricDets[0]->positionBounds().perp();
28  meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp();
29  }
30  }
31  meanR = meanR / allGeometricDets.size();
32  meanRBrothers = meanRBrothers / allGeometricDets.size();
33  LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl;
34  LogDebug("TkDetLayers") << " meanR Upper " << meanRBrothers << std::endl;
35 
36  for (vector<const GeometricDet*>::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) {
37  compGeometricDets = (*it)->components();
38  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID());
39  LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl;
40 
41  if (compGeometricDets[0]->positionBounds().perp() < meanR)
42  innerGeomDets.push_back(theGeomDet);
43 
44  if (compGeometricDets[0]->positionBounds().perp() > meanR)
45  outerGeomDets.push_back(theGeomDet);
46 
47  const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID());
48  LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl;
49  if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers)
50  innerGeomDetBrothers.push_back(theGeomDetBrother);
51 
52  if (compGeometricDets[1]->positionBounds().perp() > meanRBrothers)
53  outerGeomDetBrothers.push_back(theGeomDetBrother);
54  }
55 
56  LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size();
57  LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size();
58  LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size();
59  LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size();
60 
61  return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers);
62 }

References GeometricDet::components(), TrackerGeometry::idToDet(), LogDebug, LogTrace, and perp().

Referenced by Phase2OTBarrelLayerBuilder::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:139
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
Phase2OTBarrelRod
Definition: Phase2OTBarrelRod.h:14
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671