CMS 3D CMS Logo

List of all members | Public Member Functions
Phase2OTBarrelLayerBuilder Class Reference

#include <Phase2OTBarrelLayerBuilder.h>

Public Member Functions

Phase2OTBarrelLayerbuild (const GeometricDet *aPhase2OTBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 Phase2OTBarrelLayerBuilder ()
 

Detailed Description

A concrete builder for Phase2OTBarrelLayer

Definition at line 14 of file Phase2OTBarrelLayerBuilder.h.

Constructor & Destructor Documentation

◆ Phase2OTBarrelLayerBuilder()

Phase2OTBarrelLayerBuilder::Phase2OTBarrelLayerBuilder ( )
inline

Definition at line 16 of file Phase2OTBarrelLayerBuilder.h.

16 {};

Member Function Documentation

◆ build()

Phase2OTBarrelLayer * Phase2OTBarrelLayerBuilder::build ( const GeometricDet aPhase2OTBarrelLayer,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 9 of file Phase2OTBarrelLayerBuilder.cc.

10  {
11  // This builder is very similar to TOBLayer one. Most of the code should be put in a
12  // common place.
13 
14  LogTrace("TkDetLayers") << "Phase2OTBarrelLayerBuilder::build";
15  vector<const GeometricDet*> theGeometricDets = aPhase2OTBarrelLayer->components();
16  LogDebug("TkDetLayers") << "Phase2OTBarrelLayerBuilder with #Components: " << theGeometricDets.size() << std::endl;
17  vector<const GeometricDet*> theGeometricDetRods;
18  vector<const GeometricDet*> theGeometricDetRings;
19 
20  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
21  if ((*it)->type() == GeometricDet::ladder) {
22  theGeometricDetRods.push_back(*it);
23  } else if ((*it)->type() == GeometricDet::panel) {
24  theGeometricDetRings.push_back(*it);
25  } else {
26  LogDebug("TkDetLayers") << "Phase2OTBarrelLayerBuilder with no Rods and no Rings! ";
27  }
28  }
29 
30  LogDebug("TkDetLayers") << "Phase2OTBarrelLayerBuilder with #Rods: " << theGeometricDetRods.size() << std::endl;
31 
32  Phase2OTBarrelRodBuilder myPhase2OTBarrelRodBuilder;
33 
34  vector<const Phase2OTBarrelRod*> theInnerRods;
35  vector<const Phase2OTBarrelRod*> theOuterRods;
36 
37  // properly calculate the meanR value to separate rod in inner/outer.
38 
39  double meanR = 0;
40  for (unsigned int index = 0; index != theGeometricDetRods.size(); index++)
41  meanR += theGeometricDetRods[index]->positionBounds().perp();
42  if (!theGeometricDetRods.empty())
43  meanR /= (double)theGeometricDetRods.size();
44 
45  for (unsigned int index = 0; index != theGeometricDetRods.size(); index++) {
46  if (theGeometricDetRods[index]->positionBounds().perp() < meanR)
47  theInnerRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry));
48 
49  if (theGeometricDetRods[index]->positionBounds().perp() > meanR)
50  theOuterRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry));
51  }
52 
53  if (theGeometricDetRings.empty())
54  return new Phase2OTBarrelLayer(theInnerRods, theOuterRods);
55 
56  LogDebug("TkDetLayers") << "Phase2OTBarrelLayerBuilder with #Rings: " << theGeometricDetRings.size() << std::endl;
57 
58  Phase2EndcapRingBuilder myPhase2EndcapRingBuilder;
59 
60  vector<const Phase2EndcapRing*> theNegativeRings;
61  vector<const Phase2EndcapRing*> thePositiveRings;
62 
63  // properly calculate the meanR value to separate rod in inner/outer.
64  double centralZ = 0.0;
65 
66  for (vector<const GeometricDet*>::const_iterator it = theGeometricDetRings.begin(); it != theGeometricDetRings.end();
67  it++) {
68  if ((*it)->positionBounds().z() < centralZ)
69  theNegativeRings.push_back(myPhase2EndcapRingBuilder.build(*it, theGeomDetGeometry, true));
70  if ((*it)->positionBounds().z() > centralZ)
71  thePositiveRings.push_back(myPhase2EndcapRingBuilder.build(*it, theGeomDetGeometry, true));
72  }
73 
74  return new Phase2OTtiltedBarrelLayer(theInnerRods, theOuterRods, theNegativeRings, thePositiveRings);
75 }

References Phase2OTBarrelRodBuilder::build(), Phase2EndcapRingBuilder::build(), GeometricDet::components(), GeometricDet::ladder, LogDebug, LogTrace, and GeometricDet::panel.

Referenced by GeometricSearchTrackerBuilder::build().

Phase2OTBarrelLayer
TBPLayer Phase2OTBarrelLayer
Definition: Phase2OTBarrelLayer.h:11
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
GeometricDet::ladder
Definition: GeometricDet.h:67
Phase2EndcapRingBuilder
Definition: Phase2EndcapRingBuilder.h:14
Phase2EndcapRingBuilder::build
Phase2EndcapRing * build(const GeometricDet *aPhase2EndcapRing, const TrackerGeometry *theGeomDetGeometry, const bool useBrothers=true) __attribute__((cold))
Definition: Phase2EndcapRingBuilder.cc:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
Phase2OTBarrelRodBuilder
Definition: Phase2OTBarrelRodBuilder.h:14
GeometricDet::panel
Definition: GeometricDet.h:71
Phase2OTtiltedBarrelLayer
Definition: Phase2OTtiltedBarrelLayer.h:15
Phase2OTBarrelRodBuilder::build
Phase2OTBarrelRod * build(const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: Phase2OTBarrelRodBuilder.cc:7
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671