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 3
    • Merge requests 3
  • 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
  • #313

Closed
Open
Created Jun 14, 2019 by snuverink_j@snuverink_jDeveloper

PluginElements: particles not recorded when element crosses (or close to) origin

Summary

Noticed by @nesteruk_k: Particles are not recorded in some Probes. Likely the other PluginElements are affected too.

Steps to reproduce

A Probe crossing the origin, e.g. one defined as:

P: Probe, XSTART=-1e10, YSTART=0, XEND=1e10, YEND=0;

will not record any particles.

What is the expected correct behavior?

Recorded particle and output files: P.hist, P.h5, P.peaks

Possible fixes

A check is performed if the bunch is close to the probe (and only then individual particles are checked) as follows:

https://gitlab.psi.ch/OPAL/src/blob/master/src/Classic/AbsBeamline/Probe.cpp#L62

if( rbunch_max > rstart_m - 10.0 && rbunch_min < rend_m + 10.0 ) {

With rstart_m and rend_m defined as:

https://gitlab.psi.ch/OPAL/src/blob/master/src/Classic/AbsBeamline/PluginElement.cpp#L86

    rstart_m = std::hypot(xstart, ystart);
    rend_m   = std::hypot(xend,   yend);
    // start position is the one with lowest radius
    if (rstart_m > rend_m) {
        std::swap(xstart_m, xend_m);
        std::swap(ystart_m, yend_m);
        std::swap(rstart_m, rend_m);
    }

Instead of rstart_m the closest point to the origin should be used in the check.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking