Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Issues
  • #74

Closed
Open
Created Mar 24, 2017 by snuverink_j@snuverink_jDeveloper

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.

Assignee
Assign to
OPAL 1.5.3
Milestone
OPAL 1.5.3
Assign milestone
Time tracking