9 vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->
components();
10 vector<const GeometricDet*> compGeometricDets;
11 LogDebug(
"TkDetLayers") <<
"Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl;
13 vector<const GeomDet*> innerGeomDets;
14 vector<const GeomDet*> outerGeomDets;
15 vector<const GeomDet*> innerGeomDetBrothers;
16 vector<const GeomDet*> outerGeomDetBrothers;
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;
27 meanR = meanR + compGeometricDets[0]->positionBounds().perp();
28 meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp();
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;
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;
41 if (compGeometricDets[0]->positionBounds().
perp() < meanR)
42 innerGeomDets.push_back(theGeomDet);
44 if (compGeometricDets[0]->positionBounds().
perp() > meanR)
45 outerGeomDets.push_back(theGeomDet);
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);
52 if (compGeometricDets[1]->positionBounds().
perp() > meanRBrothers)
53 outerGeomDetBrothers.push_back(theGeomDetBrother);
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();
61 return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers);
Phase2OTBarrelRod * build(const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
T perp() const
Magnitude of transverse component.
const TrackerGeomDet * idToDet(DetId) const override