13 vector<const GeometricDet*> theGeometricDetRods = aTOBLayer->
components();
14 vector<const GeometricDet*> negativeZrods;
15 vector<const GeometricDet*> positiveZrods;
17 for(vector<const GeometricDet*>::const_iterator it=theGeometricDetRods.begin();
18 it!=theGeometricDetRods.end(); it++){
19 if( (*it)->positionBounds().z() < 0) negativeZrods.push_back(*it);
20 if( (*it)->positionBounds().z() >= 0) positiveZrods.push_back(*it);
25 vector<const TOBRod*> theInnerRods;
26 vector<const TOBRod*> theOuterRods;
33 double positiveMeanR = 0;
34 if(positiveZrods.size()>0){
36 positiveMeanR += positiveZrods[
index]->positionBounds().perp();
38 positiveMeanR = positiveMeanR/positiveZrods.size();
42 double negativeMeanR = 0;
43 if(negativeZrods.size()>0){
45 negativeMeanR += negativeZrods[
index]->positionBounds().perp();
47 negativeMeanR = negativeMeanR/negativeZrods.size();
50 if(positiveZrods.size()>0 && negativeZrods.size()>0){
52 if( positiveZrods[
index]->positionBounds().phi() != negativeZrods[
index]->positionBounds().phi()){
53 edm::LogError(
"TkDetLayers") <<
"ERROR:rods don't have the same phi. exit!";
57 if(positiveZrods[
index]->positionBounds().
perp() < positiveMeanR)
58 theInnerRods.push_back(myTOBRodBuilder.
build(negativeZrods[
index],
60 theGeomDetGeometry) );
61 if(positiveZrods[index]->positionBounds().perp() >= positiveMeanR)
62 theOuterRods.push_back(myTOBRodBuilder.
build(negativeZrods[index],
64 theGeomDetGeometry) );
67 if(positiveZrods.size()>0){
69 if(positiveZrods[
index]->positionBounds().perp() < positiveMeanR)
70 theInnerRods.push_back(myTOBRodBuilder.
build(0,
72 theGeomDetGeometry) );
73 if(positiveZrods[index]->positionBounds().perp() >= positiveMeanR)
74 theOuterRods.push_back(myTOBRodBuilder.
build(0,
76 theGeomDetGeometry) );
79 if(negativeZrods.size()>0){
81 if(negativeZrods[
index]->positionBounds().perp() < negativeMeanR)
82 theInnerRods.push_back(myTOBRodBuilder.
build(negativeZrods[
index],
84 theGeomDetGeometry) );
85 if(negativeZrods[index]->positionBounds().perp() >= negativeMeanR)
86 theOuterRods.push_back(myTOBRodBuilder.
build(negativeZrods[index],
88 theGeomDetGeometry) );
97 return new TOBLayer(theInnerRods,theOuterRods);
T perp() const
Magnitude of transverse component.
TOBLayer * build(const GeometricDet *aTOBLayer, const TrackerGeometry *theGeomDetGeometry)
GeometricDetContainer & components()
TOBRod * build(const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry)