Skip to content

Commit 66e734e

Browse files
author
Lee Carver
committed
Add bunch_spos to getbounds to fix slicing error
1 parent c8c5844 commit 66e734e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

atintegrators/atimplib.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ static void rotate_table_history(long nturns,long nslice,double *turnhistory,dou
7272
};
7373

7474
static void getbounds(double *r_in, int nbunch, int num_particles, double *smin,
75-
double *smax, double *z_cuts){
75+
double *smax, double *z_cuts, double *bunch_spos){
7676
double *rtmp;
7777
int i, ib;
7878
if(z_cuts){
7979
for(i=0;i<nbunch; i++){
80-
smin[i] = z_cuts[0];
81-
smax[i] = z_cuts[1];
80+
smin[i] = z_cuts[0]+bunch_spos[i];
81+
smax[i] = z_cuts[1]+bunch_spos[i];
8282
}
8383
}else{
8484
for(i=0;i<nbunch; i++){
@@ -123,7 +123,7 @@ static void slice_bunch(double *r_in,int num_particles,int nslice,int nturns,
123123
double *smax = atMalloc(nbunch*sizeof(double));
124124
double *hz = atMalloc(nbunch*sizeof(double));
125125
double *np_bunch = atMalloc(nbunch*sizeof(double));
126-
getbounds(r_in,nbunch,num_particles,smin,smax,z_cuts);
126+
getbounds(r_in,nbunch,num_particles,smin,smax,z_cuts,bunch_spos);
127127

128128
for(i=0;i<nbunch;i++){
129129
hz[i] = (smax[i]-smin[i])/(nslice);

0 commit comments

Comments
 (0)