9 vector<const GeometricDet*> allGeometricDets = aPhase2OTEndcapRing->
components();
10 vector<const GeometricDet*> compGeometricDets;
11 LogDebug(
"TkDetLayers") <<
"Phase2OTEndcapRingBuilder with #Modules: " << allGeometricDets.size() << std::endl;
13 vector<const GeomDet*> frontGeomDets;
14 vector<const GeomDet*> backGeomDets;
15 vector<const GeomDet*> frontGeomDetBrothers;
16 vector<const GeomDet*> backGeomDetBrothers;
20 double meanZBrothers = 0;
21 for(vector<const GeometricDet*>::const_iterator it=allGeometricDets.begin(); it!=allGeometricDets.end();it++){
22 compGeometricDets = (*it)->components();
23 if (compGeometricDets.size() != 2){
24 LogDebug(
"TkDetLayers") <<
" Stack not with two components but with " << compGeometricDets.size() << std::endl;
26 LogTrace(
"TkDetLayers") <<
" compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().z() << std::endl;
27 LogTrace(
"TkDetLayers") <<
" compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().z() << std::endl;
28 meanZ = meanZ + compGeometricDets[0]->positionBounds().z();
29 meanZBrothers = meanZBrothers + compGeometricDets[1]->positionBounds().z();
33 meanZ = meanZ/allGeometricDets.size();
34 meanZBrothers = meanZBrothers/allGeometricDets.size();
35 LogDebug(
"TkDetLayers") <<
" meanZ Lower " << meanZ << std::endl;
36 LogDebug(
"TkDetLayers") <<
" meanZ Upper " << meanZBrothers << std::endl;
38 for(vector<const GeometricDet*>::const_iterator it=allGeometricDets.begin();
39 it!=allGeometricDets.end();it++){
40 compGeometricDets = (*it)->components();
41 const GeomDet* theGeomDet = theGeomDetGeometry->
idToDet( compGeometricDets[0]->geographicalID() );
42 LogTrace(
"TkDetLayers") <<
" inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl;
44 if( fabs( compGeometricDets[0]->positionBounds().z() ) < fabs(meanZ))
45 frontGeomDets.push_back(theGeomDet);
47 if( fabs( compGeometricDets[0]->positionBounds().z() ) > fabs(meanZ))
48 backGeomDets.push_back(theGeomDet);
50 const GeomDet* theGeomDetBrother = theGeomDetGeometry->
idToDet( compGeometricDets[1]->geographicalID() );
51 LogTrace(
"TkDetLayers") <<
" inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl;
53 if( fabs( compGeometricDets[1]->positionBounds().z() ) < fabs(meanZ))
54 frontGeomDetBrothers.push_back(theGeomDetBrother);
56 if( fabs( compGeometricDets[1]->positionBounds().z() ) > fabs(meanZ))
57 backGeomDetBrothers.push_back(theGeomDetBrother);
60 LogDebug(
"TkDetLayers") <<
"frontGeomDets.size(): " << frontGeomDets.size() ;
61 LogDebug(
"TkDetLayers") <<
"backGeomDets.size(): " << backGeomDets.size() ;
62 LogDebug(
"TkDetLayers") <<
"frontGeomDetsBro.size(): " << frontGeomDetBrothers.size() ;
63 LogDebug(
"TkDetLayers") <<
"backGeomDetsBro.size(): " << backGeomDetBrothers.size() ;
65 return new Phase2OTEndcapRing(frontGeomDets,backGeomDets,frontGeomDetBrothers,backGeomDetBrothers);
Phase2OTEndcapRing * build(const GeometricDet *aPhase2OTEndcapRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
virtual const TrackerGeomDet * idToDet(DetId) const