9 const bool useBrothers) {
10 vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->
components();
11 LogDebug(
"TkDetLayers") <<
"Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl;
12 LogDebug(
"TkDetLayers") <<
" useBrothers: " << useBrothers << std::endl;
14 vector<const GeomDet*> innerGeomDets;
15 vector<const GeomDet*> outerGeomDets;
16 vector<const GeomDet*> innerGeomDetBrothers;
17 vector<const GeomDet*> outerGeomDetBrothers;
22 for (
auto const& compGeometricDets : allGeometricDets) {
23 meanR = meanR + compGeometricDets->positionBounds().perp();
25 meanR = meanR / allGeometricDets.size();
26 LogDebug(
"TkDetLayers") <<
" meanR Lower " << meanR << std::endl;
27 for (
auto const& compGeometricDets : allGeometricDets) {
28 const GeomDet* theGeomDet = theGeomDetGeometry->
idToDet(compGeometricDets->geographicalId());
30 if (compGeometricDets->positionBounds().perp() < meanR)
31 innerGeomDets.push_back(theGeomDet);
33 if (compGeometricDets->positionBounds().perp() > meanR)
34 outerGeomDets.push_back(theGeomDet);
37 LogDebug(
"TkDetLayers") <<
"innerGeomDets.size(): " << innerGeomDets.size();
38 LogDebug(
"TkDetLayers") <<
"outerGeomDets.size(): " << outerGeomDets.size();
41 vector<const GeometricDet*> compGeometricDets;
43 double meanRBrothers = 0;
44 for (
auto& it : allGeometricDets) {
45 compGeometricDets = it->components();
46 if (compGeometricDets.size() != 2) {
47 LogDebug(
"TkDetLayers") <<
" Stack not with two components but with " << compGeometricDets.size() << std::endl;
49 meanR = meanR + compGeometricDets[0]->positionBounds().perp();
50 meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp();
53 meanR = meanR / allGeometricDets.size();
54 meanRBrothers = meanRBrothers / allGeometricDets.size();
55 LogDebug(
"TkDetLayers") <<
" meanR Lower " << meanR << std::endl;
56 LogDebug(
"TkDetLayers") <<
" meanR Upper " << meanRBrothers << std::endl;
58 for (
auto& it : allGeometricDets) {
59 compGeometricDets = it->components();
60 const GeomDet* theGeomDet = theGeomDetGeometry->
idToDet(compGeometricDets[0]->geographicalId());
61 LogTrace(
"TkDetLayers") <<
" inserting " << compGeometricDets[0]->geographicalId().rawId() << std::endl;
63 if (compGeometricDets[0]->positionBounds().
perp() < meanR)
64 innerGeomDets.push_back(theGeomDet);
67 outerGeomDets.push_back(theGeomDet);
69 const GeomDet* theGeomDetBrother = theGeomDetGeometry->
idToDet(compGeometricDets[1]->geographicalId());
70 LogTrace(
"TkDetLayers") <<
" inserting " << compGeometricDets[1]->geographicalId().rawId() << std::endl;
71 if (compGeometricDets[1]->positionBounds().
perp() < meanRBrothers)
72 innerGeomDetBrothers.push_back(theGeomDetBrother);
75 outerGeomDetBrothers.push_back(theGeomDetBrother);
78 LogDebug(
"TkDetLayers") <<
"innerGeomDets.size(): " << innerGeomDets.size();
79 LogDebug(
"TkDetLayers") <<
"outerGeomDets.size(): " << outerGeomDets.size();
80 LogDebug(
"TkDetLayers") <<
"innerGeomDetsBro.size(): " << innerGeomDetBrothers.size();
81 LogDebug(
"TkDetLayers") <<
"outerGeomDetsBro.size(): " << outerGeomDetBrothers.size();
84 return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers);
ConstGeometricDetContainer & components()
T perp() const
Magnitude of transverse component.
const TrackerGeomDet * idToDet(DetId) const override
Phase2OTBarrelRod * build(const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry, const bool useBrothers=true) __attribute__((cold))