MethodicalAcceleratorDesign / MAD-X

MAD-X repository
Other
48 stars 39 forks source link

Track substracted wrong close orbit for other observer points then the start #948

Open tpersson opened 4 years ago

tpersson commented 4 years ago

If onepass is NOT used the closed orbit is subtracted before writing to the file. The problem is that it is always the closed orbit at the start of the sequence that is subtracted independent of the observer point.

I actually wonder why we at all subtract the closed orbit in tracking. It makes a lot of sense to have the option to start the particle around a closed orbit but why removing it by default? Is this something we can change ?

chernals commented 4 years ago

@Oskari-Tuormaa this could be related to what we just discussed (the "jitter" of the tracking data before the kick).

rdemaria commented 4 years ago

Just to understand, madx subtracts the closed orbit at the start of the sequence for all observe locations???

chernals commented 4 years ago

@rdemaria The timing of Tobias opening this is perfect, this is something I was observing this morning... I fear that it is indeed the case.

@tpersson I agree that it is not really needed. I imagine that 50% of the time you want the CO included (eg. for plotting extraction trajectories on top of an orbit bump) and 50% you don't want to see it (eg. to take an FFT).

Also, we could try to make it consistent with what ptc_track does (I think it does not subtract).

rdemaria commented 4 years ago

well, if people survived with a wrong CO, they can with the correct one... I agree this could be changed...

tpersson commented 4 years ago

I think I was a bit too fast to find a cause for my problem... I think the issue is rather coming from the fact that for the start point it subtract the closed orbit calculated by TRACK while for the rest of the points it uses the the closed orbit calculated with TWISS. It calls the tmrefo in TWISS to get the orbit at the rest of the locations. I have no idea why it is done like this....

rdemaria commented 4 years ago

Is there a difference from the orbit (I guess you meant the closed orbit, right?) calculated by TRACK and the one by TWISS?

tpersson commented 4 years ago

Yeah exactly. Normally the difference between the closed orbit in TRACK and TWISS is small indeed but since TWISS is doing a lot of approximations there can be differences in particular if you would have a closed orbit far away from the ideal orbit.

The reason I saw a big difference was that I started implementing the wire in TRACK (not in TWISS yet) and saw with onepass on zeroes in the track file for the start of the lattice but for the second observation point it was far from.

bjlindst commented 4 years ago

How big of a difference?

tpersson commented 4 years ago

This really depend on the lattice and closed orbit, hard to make a general statement I am afraid.