Ring::getSectionsAt()
From issue #62. The current implementation of Classic/AbsBeamline/Ring::getSectionsAt() is as follows:
std::vector<RingSection*> Ring::getSectionsAt(const Vector_t& r) {
return section_list_m;
double phi = atan2(r(1), -r(0))+Physics::pi;
// std::cerr << "GetSectionsAt " << phi << " " << phiStep_m << " " << int((phi)/phiStep_m) << " " << ringSections_m.size() << std::endl;
if (phi >= 2.*Physics::pi)
phi -= 2.*Physics::pi;
return ringSections_m[(phi)/phiStep_m];
}
The second part of the function is never reached due to the first return. From a coding point of view the second part might seem correct since otherwise the input is not used. If the first return is correct however, could the second part be removed or commented out? Assigning to @ext-rogers_c who committed the code.