Skip to content

Commit

Permalink
Merge 0315923 into 47cb1ce
Browse files Browse the repository at this point in the history
  • Loading branch information
tpersson committed Dec 13, 2017
2 parents 47cb1ce + 0315923 commit 069d98d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions doc/latexuguide/twiss.tex
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ \chapter{Twiss Module}
\texttt{"COLUMN, REij"} one gets all or the component "ij" respectively.

\ttitem{SECTORMAP} a logical flag to initiate the calculation of a
\hyperref[sec:sectormap]{sector map}.
\hyperref[sec:sectormap]{sector map}. Default the Rij contains feed-down from higher order maps. In order to turn it off use the flag SECTORPURE.

\ttitem{SECTORACC} a logical flag to save composition of maps instead of individual maps of a
\hyperref[sec:sectormap]{sector map}.

\item{SECTORPURE} a logical flag to save the transfer map Rij without effects from higher order map (Tijk). This option should be used to get it in the correct format for TRAIN.

\ttitem{SECTORTABLE} the name of the table containing the \texttt{SECTORMAP}
values. The elements (lines) and parameters (columns)
of the table can be tailored using the \hyperref[sec:select]{\texttt{SELECT}}
Expand Down Expand Up @@ -567,8 +569,9 @@ \section{Sectormap output}
contain both the alignment, and field errors present. Together with the
starting value of the closed orbit (which can be obtained from the
standard twiss file) this allows the user to track particles over larger
sectors, rather than element per element. A typical usage therefore lies
in the interface to other programs, such as TRAIN.
sectors, rather than element per element. Note that effects of the higher order
are included in the Rij. In order to disable this use the flag SECTORPURE.
This flag should be activated when used to interface TRAIN.


%\input{threader/threader}
Expand Down
1 change: 1 addition & 0 deletions src/mad_dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,7 @@ const char *const_command_def =
"ripken = [l, false, true], "
"sectormap= [l, false, true], "
"sectoracc= [l, false, true], "
"sectorpure= [l, false, true], "
"sectortable= [s, none, sectortable], "
"sectorfile= [s, sectormap, sectormap], "
"rmatrix = [l, false, true], "
Expand Down
11 changes: 5 additions & 6 deletions src/twiss.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7288,11 +7288,10 @@ SUBROUTINE twwmap(pos, orbit)
integer :: i, k, l
double precision :: sum1, sum2, ek(6)
double precision, external :: get_value
logical :: accmap

accmap=.false.

!---- Track ORBIT0 using zero kick.
logical :: accmap, sectorpure

sectorpure = get_value('twiss ','sectorpure ') .ne. zero

do i = 1, 6
sum2 = orbit(i)
do k = 1, 6
Expand All @@ -7301,7 +7300,7 @@ SUBROUTINE twwmap(pos, orbit)
sum1 = sum1 + stmat(i,k,l) * sorb(l)
enddo
sum2 = sum2 - (srmat(i,k) - sum1) * sorb(k)
! srmat(i,k) = srmat(i,k) - two * sum1
if(sectorpure) srmat(i,k) = srmat(i,k) - two * sum1
enddo
ek(i) = sum2
enddo
Expand Down

0 comments on commit 069d98d

Please sign in to comment.