11 vector<const GeometricDet*> theGeometricDetRods = aTOBLayer->
components();
12 vector<const GeometricDet*> negativeZrods;
13 vector<const GeometricDet*> positiveZrods;
15 for (vector<const GeometricDet*>::const_iterator it = theGeometricDetRods.begin(); it != theGeometricDetRods.end();
17 if ((*it)->positionBounds().z() < 0)
18 negativeZrods.push_back(*it);
19 if ((*it)->positionBounds().z() >= 0)
20 positiveZrods.push_back(*it);
25 vector<const TOBRod*> theInnerRods;
26 vector<const TOBRod*> theOuterRods;
33 double positiveMeanR = 0;
34 if (!positiveZrods.empty()) {
36 positiveMeanR += positiveZrods[
index]->positionBounds().perp();
38 positiveMeanR = positiveMeanR / positiveZrods.size();
41 double negativeMeanR = 0;
42 if (!negativeZrods.empty()) {
44 negativeMeanR += negativeZrods[
index]->positionBounds().perp();
46 negativeMeanR = negativeMeanR / negativeZrods.size();
49 if (!positiveZrods.empty() && !negativeZrods.empty()) {
51 if (positiveZrods[
index]->positionBounds().phi() != negativeZrods[
index]->positionBounds().phi()) {
52 edm::LogError(
"TkDetLayers") <<
"ERROR:rods don't have the same phi. exit!";
56 if (positiveZrods[
index]->positionBounds().
perp() < positiveMeanR)
57 theInnerRods.push_back(myTOBRodBuilder.
build(negativeZrods[
index], positiveZrods[index], theGeomDetGeometry));
58 if (positiveZrods[index]->positionBounds().perp() >= positiveMeanR)
59 theOuterRods.push_back(myTOBRodBuilder.
build(negativeZrods[index], positiveZrods[index], theGeomDetGeometry));
62 if (!positiveZrods.empty()) {
64 if (positiveZrods[
index]->positionBounds().perp() < positiveMeanR)
65 theInnerRods.push_back(myTOBRodBuilder.
build(
nullptr, positiveZrods[
index], theGeomDetGeometry));
66 if (positiveZrods[index]->positionBounds().perp() >= positiveMeanR)
67 theOuterRods.push_back(myTOBRodBuilder.
build(
nullptr, positiveZrods[index], theGeomDetGeometry));
70 if (!negativeZrods.empty()) {
72 if (negativeZrods[
index]->positionBounds().perp() < negativeMeanR)
73 theInnerRods.push_back(myTOBRodBuilder.
build(negativeZrods[
index],
nullptr, theGeomDetGeometry));
74 if (negativeZrods[index]->positionBounds().perp() >= negativeMeanR)
75 theOuterRods.push_back(myTOBRodBuilder.
build(negativeZrods[index],
nullptr, theGeomDetGeometry));
83 return new TOBLayer(theInnerRods, theOuterRods);
TOBLayer * build(const GeometricDet *aTOBLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
TOBRod * build(const GeometricDet *negTOBRod, const GeometricDet *posTOBRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
T perp() const
Magnitude of transverse component.