ThorstenHellert / SC

6 stars 4 forks source link

dz with opposite sign in SCgetTransformation.m #39

Closed oscarxblanco closed 7 months ago

oscarxblanco commented 7 months ago

Dear @ThorstenHellert ,

I have tried your script SCgetTransformation.m with a positive longitudinal drift but it returns T1 an T2 vectors with the opposite sign wrt what I expect.

dx = 0;
dy = 0;
dz = 1e-3;
atilt = 0.0;
apitch = 0.0;
ayaw = 0.0;
ax =  apitch;
ay =  ayaw;
az =  atilt;
magTheta = 0;
magLength = 0.8;
%[T1,T2,R1,R2] = SCgetTransformation(dx,dy,dz,ax,ay,az,magTheta,magLength,'refPoint','entrance');
[T1,T2,R1,R2] = SCgetTransformation(dx,dy,dz,ax,ay,az,magTheta,magLength,'refPoint','center');
T1andT2fromSC=[T1';T2']
R1, R2

Which returns

T1andT2fromSC =
         0         0         0         0         0    0.0010
         0         0         0         0         0   -0.0010

I expected T1(6) to be negative, and T2(6) to be positive. Do you agree ?

o

oscarxblanco commented 7 months ago

Dear @ThorstenHellert ,

I think I am mistaken, while checking the AT documentation here https://atcollab.github.io/at/common/indx.html I just realized that the sixth coordinate is a delay and not a position even if it is in meters, therefore, particles in the head of the bunch (positive longitudinal coordinate) have a arrive before the reference particle (negative delay), which explains the minus sign.

I think I had check this but I was revisiting this. I will close this issue.

Best regards, o