25 std::ostringstream st1;
26 st1 <<
"Z = " << zf <<
":" << zb <<
"; zFront1 =";
27 for (
const auto&
v : zFront1)
30 for (
const auto&
v : rFront1)
33 for (
const auto&
v : slope1)
36 for (
const auto&
v : zFront2)
39 for (
const auto&
v : rFront2)
42 for (
const auto&
v : slope2)
45 double dz2f(0), dz2b(0);
47 double dz1f(0), dz1b(0);
49 if (zf1 != zFront1.begin())
51 if (((zf1 + 1) != zFront1.end()) && (
std::abs(*(zf1 + 1) - zf) <
tol_)) {
56 if (zf2 != zFront2.begin())
58 if (((zf2 + 1) != zFront2.end()) && (
std::abs(*(zf2 + 1) - zf) <
tol_)) {
59 if (static_cast<int>(zf2 - zFront2.begin()) >= 2)
66 if (zb1 != zFront1.begin())
68 if ((zb1 != zFront1.begin()) && (
std::abs(*zb1 - zb) <
tol_)) {
72 if (((zb1 + 1) != zFront1.end()) && (
std::abs(*(zb1 + 1) - zb) <
tol_)) {
76 if (zb2 != zFront2.begin()) {
79 if ((zb2 != zFront2.begin()) && (
std::abs(*zb2 - zb) <
tol_)) {
80 if (static_cast<int>(zb2 - zFront2.begin()) > 2)
87 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalGeomTools::radiusX:zf " << zf <<
" : " 88 <<
static_cast<int>(zf1 - zFront1.begin()) <<
":" << *zf1 <<
" : " 89 << static_cast<int>(zf2 - zFront2.begin()) <<
":" << *zf2 <<
" zb " << zb <<
":" 90 << static_cast<int>(zb1 - zFront1.begin()) <<
" : " << *zb1 <<
" : " 91 << static_cast<int>(zb2 - zFront2.begin()) <<
":" << *zb2 <<
" Flag " <<
flag <<
":" 92 << (zf1 == zb1) <<
":" << (zf2 == zb2) <<
" dz " << dz1f <<
":" << dz2f <<
":" << dz1b
95 if ((zf1 == zb1) && (zf2 == zb2)) {
97 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalGeomTools::radiusX:Try 1: " << zf <<
":" << zb;
100 rin.emplace_back(
radius(zf + dz1f, zFront1, rFront1, slope1));
101 rout.emplace_back(
radius(zf, zFront2, rFront2, slope2));
103 rin.emplace_back(
radius(zb + dz1b, zFront1, rFront1, slope1));
104 rout.emplace_back(
radius(zb, zFront2, rFront2, slope2));
105 }
else if (zf1 == zb1) {
108 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalGeomTools::radiusX:Try 2:" << zf <<
":" << *zb2 <<
" (" <<
z1 <<
") : " << zb
109 <<
" Test " << (
slope(*zb2, zFront2, slope2) <
tol_) <<
":" 113 rin.emplace_back(
radius(zf, zFront1, rFront1, slope1));
114 rout.emplace_back(
radius(zf, zFront2, rFront2, slope2));
115 if (
slope(*zb2, zFront2, slope2) <
tol_) {
116 zz.emplace_back(*zb2);
117 rin.emplace_back(
radius(*zb2, zFront1, rFront1, slope1));
118 rout.emplace_back(
radius(*zb2 -
tol_, zFront2, rFront2, slope2));
121 zz.emplace_back(*zb2);
122 rin.emplace_back(
radius(*zb2, zFront1, rFront1, slope1));
123 rout.emplace_back(
radius(*zb2, zFront2, rFront2, slope2));
126 rin.emplace_back(
radius(zb, zFront1, rFront1, slope1));
127 rout.emplace_back(
radius(zb, zFront2, rFront2, slope2));
128 }
else if (zf2 == zb2) {
130 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalGeomTools::radiusX:Try 3: " << zf <<
":" << *zb1 <<
":" << zb <<
" Test " 131 << (
slope(*zb1, zFront1, slope1) <
tol_) <<
":" 135 rin.emplace_back(
radius(zf, zFront1, rFront1, slope1));
136 rout.emplace_back(
radius(zf, zFront2, rFront2, slope2));
137 if (
slope(*zb1, zFront1, slope1) <
tol_) {
138 zz.emplace_back(*zb1);
139 rin.emplace_back(
radius(*zb1 -
tol_, zFront1, rFront1, slope1));
140 rout.emplace_back(
radius(*zb1, zFront2, rFront2, slope2));
143 zz.emplace_back(*zb1);
144 rin.emplace_back(
radius(*zb1, zFront1, rFront1, slope1));
145 rout.emplace_back(
radius(*zb1, zFront2, rFront2, slope2));
148 rin.emplace_back(
radius(zb, zFront1, rFront1, slope1));
149 rout.emplace_back(
radius(zb, zFront2, rFront2, slope2));
154 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalGeomTools::radiusX:Try 4: " << zf <<
":" <<
z1 <<
" : " <<
z2 <<
":" << zb;
157 rin.emplace_back(
radius(zf, zFront1, rFront1, slope1));
158 rout.emplace_back(
radius(zf, zFront2, rFront2, slope2));
160 rin.emplace_back(
radius(
z1, zFront1, rFront1, slope1));
161 rout.emplace_back(
radius(
z1, zFront2, rFront2, slope2));
163 rin.emplace_back(
radius(
z2, zFront1, rFront1, slope1));
164 rout.emplace_back(
radius(
z2, zFront2, rFront2, slope2));
166 rin.emplace_back(
radius(zb, zFront1, rFront1, slope1));
167 rout.emplace_back(
radius(zb, zFront2, rFront2, slope2));
169 double rmin = *(std::min_element(rout.begin(), rout.end()));
171 for (
auto&
rr : rout)
175 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalGeomTools::radiusX has " <<
zz.size() <<
" sections: " << rmin;
176 for (
unsigned int k = 0;
k <
zz.size(); ++
k)
Log< level::Info, true > LogVerbatim
Abs< T >::type abs(const T &t)