13 vector<const GeometricDet*> theGeometricRods = aTIBLayer->
components();
15 vector<vector<const GeometricDet*> > innerGeometricDetRings;
16 vector<vector<const GeometricDet*> > outerGeometricDetRings;
18 constructRings(theGeometricRods,innerGeometricDetRings,outerGeometricDetRings);
22 vector<const TIBRing*> innerRings;
23 vector<const TIBRing*> outerRings;
25 for(
unsigned int i=0;
i<innerGeometricDetRings.size();
i++){
26 innerRings.push_back(myRingBuilder.
build(innerGeometricDetRings[
i],theGeomDetGeometry));
27 outerRings.push_back(myRingBuilder.
build(outerGeometricDetRings[i],theGeomDetGeometry));
30 return new TIBLayer(innerRings,outerRings);
38 vector<vector<const GeometricDet*> >& innerGeometricDetRings,
39 vector<vector<const GeometricDet*> >& outerGeometricDetRings)
42 for(vector<const GeometricDet*>::const_iterator it=theGeometricRods.begin();
43 it!= theGeometricRods.end();it++){
44 meanPerp = meanPerp + (*it)->positionBounds().perp();
46 meanPerp = meanPerp/theGeometricRods.size();
48 vector<const GeometricDet*> theInnerGeometricRods;
49 vector<const GeometricDet*> theOuterGeometricRods;
51 for(vector<const GeometricDet*>::const_iterator it=theGeometricRods.begin();
52 it!= theGeometricRods.end();it++){
53 if( (*it)->positionBounds().perp() < meanPerp) theInnerGeometricRods.push_back(*it);
54 if( (*it)->positionBounds().perp() > meanPerp) theOuterGeometricRods.push_back(*it);
57 size_t innerLeftRodMaxSize = 0;
58 size_t innerRightRodMaxSize = 0;
59 size_t outerLeftRodMaxSize = 0;
60 size_t outerRightRodMaxSize = 0;
62 for(vector<const GeometricDet*>::const_iterator it=theInnerGeometricRods.begin();
63 it!= theInnerGeometricRods.end();it++){
64 if( (*it)->positionBounds().z() < 0)
65 innerLeftRodMaxSize =
max(innerLeftRodMaxSize, (**it).components().size());
66 if( (*it)->positionBounds().z() > 0)
67 innerRightRodMaxSize =
max(innerRightRodMaxSize, (**it).components().size());
70 for(vector<const GeometricDet*>::const_iterator it=theOuterGeometricRods.begin();
71 it!= theOuterGeometricRods.end();it++){
72 if( (*it)->positionBounds().z() < 0)
73 outerLeftRodMaxSize =
max(outerLeftRodMaxSize, (**it).components().size());
74 if( (*it)->positionBounds().z() > 0)
75 outerRightRodMaxSize =
max(outerRightRodMaxSize, (**it).components().size());
78 LogDebug(
"TkDetLayers") <<
"innerLeftRodMaxSize: " << innerLeftRodMaxSize ;
79 LogDebug(
"TkDetLayers") <<
"innerRightRodMaxSize: " << innerRightRodMaxSize ;
81 LogDebug(
"TkDetLayers") <<
"outerLeftRodMaxSize: " << outerLeftRodMaxSize ;
82 LogDebug(
"TkDetLayers") <<
"outerRightRodMaxSize: " << outerRightRodMaxSize ;
84 for(
unsigned int i=0;
i< (innerLeftRodMaxSize+innerRightRodMaxSize);
i++){
85 innerGeometricDetRings.push_back(vector<const GeometricDet*>());
88 for(
unsigned int i=0;
i< (outerLeftRodMaxSize+outerRightRodMaxSize);
i++){
89 outerGeometricDetRings.push_back(vector<const GeometricDet*>());
92 for(
unsigned int ringN = 0; ringN < innerLeftRodMaxSize; ringN++){
93 for(vector<const GeometricDet*>::const_iterator it=theInnerGeometricRods.begin();
94 it!= theInnerGeometricRods.end();it++){
95 if( (*it)->positionBounds().z() < 0){
96 if( (**it).components().size()>ringN)
97 innerGeometricDetRings[ringN].push_back( (**it).components()[ringN] );
102 for(
unsigned int ringN = 0; ringN < innerRightRodMaxSize; ringN++){
103 for(vector<const GeometricDet*>::const_iterator it=theInnerGeometricRods.begin();
104 it!= theInnerGeometricRods.end();it++){
105 if( (*it)->positionBounds().z() > 0){
106 if( (**it).components().size()>ringN)
107 innerGeometricDetRings[innerLeftRodMaxSize+ringN].push_back( (**it).components()[ringN] );
113 for(
unsigned int ringN = 0; ringN < outerLeftRodMaxSize; ringN++){
114 for(vector<const GeometricDet*>::const_iterator it=theOuterGeometricRods.begin();
115 it!= theOuterGeometricRods.end();it++){
116 if( (*it)->positionBounds().z() < 0){
117 if( (**it).components().size()>ringN)
118 outerGeometricDetRings[ringN].push_back( (**it).components()[ringN] );
123 for(
unsigned int ringN = 0; ringN < outerRightRodMaxSize; ringN++){
124 for(vector<const GeometricDet*>::const_iterator it=theOuterGeometricRods.begin();
125 it!= theOuterGeometricRods.end();it++){
126 if( (*it)->positionBounds().z() > 0){
127 if( (**it).components().size()>ringN)
128 outerGeometricDetRings[outerLeftRodMaxSize+ringN].push_back( (**it).components()[ringN] );
TIBLayer * build(const GeometricDet *aTIBLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
void constructRings(std::vector< const GeometricDet * > &theGeometricRods, std::vector< std::vector< const GeometricDet * > > &innerGeometricDetRings, std::vector< std::vector< const GeometricDet * > > &outerGeometricDetRings)
ConstGeometricDetContainer & components()
TIBRing * build(const std::vector< const GeometricDet * > &detsInRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
EventID const & max(EventID const &lh, EventID const &rh)