Skip to content

Commit

Permalink
Added test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpersson committed Mar 1, 2021
1 parent f1c8aa7 commit 95595e9
Show file tree
Hide file tree
Showing 12 changed files with 574 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile_test
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test-rfmultipole-ptc-1 \
test-ptc-twiss-1 test-ptc-twiss-2 test-ptc-twiss-3 test-ptc-twiss-4 \
test-ptc-twiss-old1 test-ptc-twiss-old2 test-ptc-twiss-old3 test-ptc-twiss-old4 test-ptc-twiss-old5 test-ptc-twiss-old6 test-ptc-twiss-old7 \
test-ptc-twiss-5D test-ptc-twiss-5Dt test-ptc-twiss-56D test-ptc-twiss-56Dt test-ptc-twiss-56Dl test-ptc-twiss-56Dtl test-ptc-twiss-6D test-ptc-twiss-6D-ALS \
test-ptc-twiss-accel-56D test-ptc-twiss-56Dt-ini_map_man test-ptc-twiss-56Dt-ini_mtx_man test-ptc-twiss-56Dt-ini_mtx_tbl \
test-ptc-twiss-accel-56D test-ptc-twiss-56Dt-ini_map_man test-ptc-twiss-56Dt-ini_mtx_man test-ptc-twiss-56Dt-ini_mtx_tbl test-ptc-twiss-tilt \
test-ptc-normal test-ptc-normal-5D-beambeam \
test-ptc-twiss-normal-genfu test-ptc-twiss-normal-5D test-ptc-twiss-normal-6D test-ptc-twiss-maptable \
test-ptc-track test-ptc-track-2 test-ptc-track-3 test-ptc-track-4 test-ptc-track-5 \
Expand Down
3 changes: 3 additions & 0 deletions tests/test-ptc-twiss-tilt/test-ptc-twiss-tilt.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1-7 * skip # head
* * abs=1e-13
871 4 abs=4e-13 # disp1max in summ of ptc_twiss
27 changes: 27 additions & 0 deletions tests/test-ptc-twiss-tilt/test-ptc-twiss-tilt.madx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

FASER : SEQUENCE, L = 10;
b1:quadrupole, k1=0.2, at=5,l=1,TILT=1.0*pi/4;
endsequence;

beam;
use, sequence=faser;
x0=0.00;
eoption, add=true;
select, flag=error, clear=true;
select, flag=error, class=b1;
ealign, dx= 0.001, dy= 0.00, ds=0.00,dphi=0.00, dtheta=0.00, dpsi=0.00;

select, flag=twiss, column=name,s,x,px,y, py;
twiss, betx=1, bety=1, x=x0, file="twiss.madx.simple";

select, flag=ptc_twiss, column=name,s,x,px,y, py;
ptc_create_universe;
ptc_create_layout, model=1, method=6,nst=1, exact;
ptc_align;
ptc_start, x=x0;
!ptc_observe, place=b1;
ptc_track, icase=6, element_by_element, dump, file="track.simple", ffile=1, maxaper={100.0, 100.0, 100.0, 100.0, 100.0, 100.0};
ptc_twiss, file="twiss.ptc.simple",betx=1,bety=1,betz=1, x=x0;
ptc_track_end;

ptc_end;
229 changes: 229 additions & 0 deletions tests/test-ptc-twiss-tilt/test-ptc-twiss-tilt.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@

++++++++++++++++++++++++++++++++++++++++++++
+ MAD-X 5.06.01 (64 bit, Linux) +
+ Support: mad@cern.ch, http://cern.ch/mad +
+ Release date: 2020.09.01 +
+ Execution date: 2021.03.01 15:55:01 +
++++++++++++++++++++++++++++++++++++++++++++


FASER : SEQUENCE, L = 10;

b1:quadrupole, k1=0.2, at=5,l=1,TILT=1.0*pi/4;

endsequence;



beam;

use, sequence=faser;

x0=0.00;

eoption, add=true;

select, flag=error, clear=true;

select, flag=error, class=b1;

ealign, dx= 0.001, dy= 0.00, ds=0.00,dphi=0.00, dtheta=0.00, dpsi=0.00;

Assigned alignment errors to 1 elements


select, flag=twiss, column=name,s,x,px,y, py;

twiss, betx=1, bety=1, x=x0, file="twiss.madx.simple";

enter Twiss module
Found 1 initial orbit vector values from twiss command.

open line - error with deltap: 0.000000E+00
initial orbit vector: 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
final orbit vector: -3.166813E-05 -6.666984E-06 1.000311E-03 2.000667E-04 -9.683178E-08 0.000000E+00

++++++ table: summ

length orbit5 alfa gammatr
10 -0 0 0

q1 dq1 betxmax dxmax
0.2338790466 0 104.4418501 6.333921466e-05

dxrms xcomax xcorms q2
4.008696646e-05 3.166813493e-05 2.004255198e-05 0.2338790466

dq2 betymax dymax dyrms
0 104.4418501 0.001000933484 0.0006346246687

ycomax ycorms deltap synch_1
0.001000311115 0.0006342313264 0 0

synch_2 synch_3 synch_4 synch_5
0 0 0 0

synch_6 synch_8 nflips
0 0 0


select, flag=ptc_twiss, column=name,s,x,px,y, py;

ptc_create_universe;

Determined SECTOR NMUL MAX : 0
ptc_create_layout, model=1, method=6,nst=1, exact;

MAD-X Beam Parameters
Energy : 0.100000E+01
Kinetic Energy : 0.999489E+00
Particle Rest Mass : 0.510999E-03
Momentum : 0.100000E+01
Setting MADx with
energy 1.0000000000000000
method 6
Num. of steps 1
charge 1.0000000000000000
Length of machine: 10.000000000000000
The machine is a RING
------------------------------------ PTC Survey ------------------------------------
Before start: 0.0000000000000000 0.0000000000000000 0.0000000000000000
Before end: 0.0000000000000000 0.0000000000000000 0.0000000000000000
After start: 0.0000000000000000 0.0000000000000000 0.0000000000000000
After end: 0.0000000000000000 0.0000000000000000 10.000000000000000
ptc_align;

ptc_start, x=x0;

!ptc_observe, place=b1;

ptc_track, icase=6, element_by_element, dump, file="track.simple", ffile=1, maxaper={100.0, 100.0, 100.0, 100.0, 100.0, 100.0};

++++++ warning: my_state: no cavity - dimensionality reduced 6 -> 5 and 1/2
************ State Summary ****************
MADTHICK=>KIND = 32 DRIFT-KICK-DRIFT
Rectangular Bend: input arc length (rho alpha)
Default integration method 6
Default integration steps 1
This is an electron (positron actually if charge=1)
EXACT_MODEL = TRUE
TOTALPATH = 0
RADIATION = FALSE
STOCHASTIC = FALSE
ENVELOPE = FALSE
NOCAVITY = TRUE
TIME = TRUE
FRINGE = FALSE
PARA_IN = FALSE
ONLY_2D = FALSE
ONLY_4D = FALSE
DELTA = FALSE
SPIN = FALSE
MODULATION = FALSE
RAMPING = FALSE
ACCELERATE = FALSE

++++++ table: tracksumm

number turn x px
1 0 0 0
1 1 -3.16207568e-05 -6.657794469e-06

y py t pt
0 0 -0 0
0.001000308811 0.0002000661896 -9.684478997e-08 0

s e
0 1
0 1
ptc_twiss, file="twiss.ptc.simple",betx=1,bety=1,betz=1, x=x0;

************ State Summary ****************
MADTHICK=>KIND = 32 DRIFT-KICK-DRIFT
Rectangular Bend: input arc length (rho alpha)
Default integration method 6
Default integration steps 1
This is an electron (positron actually if charge=1)
EXACT_MODEL = TRUE
TOTALPATH = 0
RADIATION = FALSE
STOCHASTIC = FALSE
ENVELOPE = FALSE
NOCAVITY = TRUE
TIME = TRUE
FRINGE = FALSE
PARA_IN = FALSE
ONLY_2D = FALSE
ONLY_4D = TRUE
DELTA = FALSE
SPIN = FALSE
MODULATION = FALSE
RAMPING = FALSE
ACCELERATE = FALSE
Closed orbit: 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
Reduced SUMM Table (Inital parameters specified)

++++++ table: ptc_twiss_summary

length alpha_c alpha_c_p alpha_c_p2
10 -1000000 -1000000 -1000000

alpha_c_p3 eta_c gamma_tr q1
-1000000 -1000000 -1000000 0.2338793977

q2 dq1 dq2 qs
0.233879398 -1000000 -1000000 -1000000

beta_x_min beta_x_max beta_y_min beta_y_max
1 104.4371868 1 104.4371908

beta11min beta11max beta12min beta12max
1 104.0887016 0 25.84844449

beta13min beta13max beta21min beta21max
0 0 0 25.84844642

beta22min beta22max beta23min beta23max
1 104.0887056 0 0

beta31min beta31max beta32min beta32max
0 0 0 0

beta33min beta33max disp1min disp1max
0 0 0 0

disp2min disp2max disp3min disp3max
0 0 0 0

disp4min disp4max deltap orbit_x
0 0 0 0

orbit_px orbit_y orbit_py orbit_pt
0 0 0 0

orbit_t xcorms ycorms pxcorms
0 2.001250801e-05 0.0006342298672 5.157105421e-06

pycorms tcorms ptcorms xcomax
0.0001549706041 0 0 0

ycomax pxcomax pycomax tcomax
0.001000308811 0 0.0002000661896 -0

ptcomax xcomin ycomin pxcomin
0 -3.16207568e-05 0 -6.657794469e-06

pycomin tcomin ptcomin
0 -0 0
ptc_track_end;



ptc_end;

Number of warnings: 1
0 in C and 1 in Fortran

++++++++++++++++++++++++++++++++++++++++++++
+ MAD-X finished normally +
++++++++++++++++++++++++++++++++++++++++++++
2 changes: 2 additions & 0 deletions tests/test-ptc-twiss-tilt/track.simple.obs0001.p0001.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
4-6 * skip # header
* * any abs=2e-13 rel=1e-8
10 changes: 10 additions & 0 deletions tests/test-ptc-twiss-tilt/track.simple.obs0001.p0001.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@ NAME %19s "TRACK.OBS0001.P0001"
@ TYPE %08s "TRACKOBS"
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.06.01 Linux 64"
@ DATE %08s "01/03/21"
@ TIME %08s "15.55.31"
* NUMBER TURN X PX Y PY T PT S E
$ %d %d %le %le %le %le %le %le %le %le
1 0 0 0 0 0 -0 0 0 1
1 1 -3.16207568e-05 -6.657794469e-06 0.001000308811 0.0002000661896 -9.684478997e-08 0 0 1
53 changes: 53 additions & 0 deletions tests/test-ptc-twiss-tilt/twiss.madx.simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@ NAME %05s "TWISS"
@ TYPE %05s "TWISS"
@ SEQUENCE %05s "FASER"
@ PARTICLE %08s "POSITRON"
@ MASS %le 0.00051099895
@ CHARGE %le 1
@ ENERGY %le 1
@ PC %le 0.9999998694
@ GAMMA %le 1956.951184
@ KBUNCH %le 1
@ BCURRENT %le 4.803203458e-12
@ SIGE %le 0.001
@ SIGT %le 1
@ NPART %le 1
@ EX %le 1
@ EY %le 1
@ ET %le 0.001
@ BV_FLAG %le 1
@ LENGTH %le 10
@ ALFA %le 0
@ ORBIT5 %le -0
@ GAMMATR %le 0
@ Q1 %le 0.2338790466
@ Q2 %le 0.2338790466
@ DQ1 %le 0
@ DQ2 %le 0
@ DXMAX %le 6.333921466e-05
@ DYMAX %le 0.001000933484
@ XCOMAX %le 3.166813493e-05
@ YCOMAX %le 0.001000311115
@ BETXMAX %le 104.4418501
@ BETYMAX %le 104.4418501
@ XCORMS %le 2.004255198e-05
@ YCORMS %le 0.0006342313264
@ DXRMS %le 4.008696646e-05
@ DYRMS %le 0.0006346246687
@ DELTAP %le 0
@ SYNCH_1 %le 0
@ SYNCH_2 %le 0
@ SYNCH_3 %le 0
@ SYNCH_4 %le 0
@ SYNCH_5 %le 0
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.06.01 Linux 64"
@ DATE %08s "01/03/21"
@ TIME %08s "15.56.14"
* NAME S X PX Y PY
$ %s %le %le %le %le %le
"FASER$START" 0 0 0 0 0
"DRIFT_0" 4.5 0 0 0 0
"B1" 5.5 -1.666706349e-06 -6.666984129e-06 0.0001000111112 0.0002000666675
"DRIFT_1" 10 -3.166813493e-05 -6.666984129e-06 0.001000311115 0.0002000666675
"FASER$END" 10 -3.166813493e-05 -6.666984129e-06 0.001000311115 0.0002000666675
1 change: 1 addition & 0 deletions tests/test-ptc-twiss-tilt/twiss.madx.simple.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
44-48 * skip # date, version, ..
53 changes: 53 additions & 0 deletions tests/test-ptc-twiss-tilt/twiss.madx.simple.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@ NAME %05s "TWISS"
@ TYPE %05s "TWISS"
@ SEQUENCE %05s "FASER"
@ PARTICLE %08s "POSITRON"
@ MASS %le 0.00051099895
@ CHARGE %le 1
@ ENERGY %le 1
@ PC %le 0.9999998694
@ GAMMA %le 1956.951184
@ KBUNCH %le 1
@ BCURRENT %le 4.803203458e-12
@ SIGE %le 0.001
@ SIGT %le 1
@ NPART %le 1
@ EX %le 1
@ EY %le 1
@ ET %le 0.001
@ BV_FLAG %le 1
@ LENGTH %le 10
@ ALFA %le 0
@ ORBIT5 %le -0
@ GAMMATR %le 0
@ Q1 %le 0.2338790466
@ Q2 %le 0.2338790466
@ DQ1 %le 0
@ DQ2 %le 0
@ DXMAX %le 6.333921466e-05
@ DYMAX %le 0.001000933484
@ XCOMAX %le 3.166813493e-05
@ YCOMAX %le 0.001000311115
@ BETXMAX %le 104.4418501
@ BETYMAX %le 104.4418501
@ XCORMS %le 2.004255198e-05
@ YCORMS %le 0.0006342313264
@ DXRMS %le 4.008696646e-05
@ DYRMS %le 0.0006346246687
@ DELTAP %le 0
@ SYNCH_1 %le 0
@ SYNCH_2 %le 0
@ SYNCH_3 %le 0
@ SYNCH_4 %le 0
@ SYNCH_5 %le 0
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.06.01 Linux 64"
@ DATE %08s "01/03/21"
@ TIME %08s "14.01.24"
* NAME S X PX Y PY
$ %s %le %le %le %le %le
"FASER$START" 0 0 0 0 0
"DRIFT_0" 4.5 0 0 0 0
"B1" 5.5 -1.666706349e-06 -6.666984129e-06 0.0001000111112 0.0002000666675
"DRIFT_1" 10 -3.166813493e-05 -6.666984129e-06 0.001000311115 0.0002000666675
"FASER$END" 10 -3.166813493e-05 -6.666984129e-06 0.001000311115 0.0002000666675

0 comments on commit 95595e9

Please sign in to comment.