1 | /* class to read the parameters of the bool flags in the user input script */ |
---|
2 | class UserCommand |
---|
3 | { |
---|
4 | public: |
---|
5 | char CommandStr[max_str]; // bool flag name |
---|
6 | |
---|
7 | /***** parameters *******/ |
---|
8 | |
---|
9 | //RFVoltFlag |
---|
10 | double RFvolt; // RF voltage |
---|
11 | |
---|
12 | //chamber file |
---|
13 | char chamber_file[max_str]; |
---|
14 | |
---|
15 | // misalignment error file |
---|
16 | char ae_file[max_str]; |
---|
17 | |
---|
18 | // field error file |
---|
19 | char fe_file[max_str]; |
---|
20 | |
---|
21 | // FitTuneFlag ; |
---|
22 | char qf[max_str],qd[max_str]; |
---|
23 | double targetnux, targetnuz; |
---|
24 | // FitTune4Flag ; |
---|
25 | char qf1[max_str],qf2[max_str],qd1[max_str],qd2[max_str]; |
---|
26 | // FitChromFlag ; |
---|
27 | char sxm1[max_str],sxm2[max_str]; |
---|
28 | double targetksix, targetksiz ; |
---|
29 | //add coupling error to full/half quadrupoles |
---|
30 | long err_seed; |
---|
31 | double err_rms; |
---|
32 | |
---|
33 | //start track particle coordinates; PrintTrackFlag |
---|
34 | char _PrintTrack_track_file[max_str]; |
---|
35 | double _PrintTrack_x, _PrintTrack_px, _PrintTrack_y, |
---|
36 | _PrintTrack_py, _PrintTrack_delta, _PrintTrack_ctau; |
---|
37 | long _PrintTrack_nmax; |
---|
38 | |
---|
39 | //twiss file |
---|
40 | char _PrintTwiss_twiss_file[max_str]; |
---|
41 | |
---|
42 | char _PrintCOD_cod_file[max_str]; |
---|
43 | |
---|
44 | //AmplitudeTuneShiftFlag; |
---|
45 | char _AmplitudeTuneShift_nudx_file[max_str]; |
---|
46 | char _AmplitudeTuneShift_nudz_file[max_str]; |
---|
47 | long _AmplitudeTuneShift_nxpoint, _AmplitudeTuneShift_nypoint; |
---|
48 | long _AmplitudeTuneShift_nturn; |
---|
49 | double _AmplitudeTuneShift_xmax, _AmplitudeTuneShift_ymax, _AmplitudeTuneShift_delta; |
---|
50 | |
---|
51 | //EnergyTuneShiftFlag; |
---|
52 | char _EnergyTuneShift_nudp_file[max_str]; |
---|
53 | long _EnergyTuneShift_npoint, _EnergyTuneShift_nturn; |
---|
54 | double _EnergyTuneShift_deltamax; |
---|
55 | |
---|
56 | //extern bool FmapFlag; |
---|
57 | char _FmapFlag_fmap_file[max_str]; |
---|
58 | long _FmapFlag_nxpoint, _FmapFlag_nypoint, _FmapFlag_nturn; |
---|
59 | double _FmapFlag_xmax, _FmapFlag_ymax, _FmapFlag_delta; |
---|
60 | bool _FmapFlag_diffusion; |
---|
61 | |
---|
62 | //extern bool FmapdpFlag; |
---|
63 | char _FmapdpFlag_fmapdp_file[max_str]; |
---|
64 | long _FmapdpFlag_nxpoint, _FmapdpFlag_nepoint, _FmapdpFlag_nturn; |
---|
65 | double _FmapdpFlag_xmax, _FmapdpFlag_emax, _FmapdpFlag_z; |
---|
66 | bool _FmapdpFlag_diffusion; |
---|
67 | |
---|
68 | |
---|
69 | //MomentumAccFlag; |
---|
70 | char _MomentumAccFlag_momacc_file[max_str]; // file to save tracked momentum accpetance |
---|
71 | char _MomentumAccFlag_TrackDim[3]; |
---|
72 | long _MomentumAccFlag_istart, _MomentumAccFlag_istop, |
---|
73 | _MomentumAccFlag_nstepn, _MomentumAccFlag_nstepp, |
---|
74 | _MomentumAccFlag_nturn; |
---|
75 | double _MomentumAccFlag_deltaminn, _MomentumAccFlag_deltamaxn; |
---|
76 | double _MomentumAccFlag_deltaminp, _MomentumAccFlag_deltamaxp; |
---|
77 | double _MomentumAccFlag_zmax; |
---|
78 | |
---|
79 | // /* Phase space */ |
---|
80 | //char *_Phase_phase_file; |
---|
81 | char _Phase_phase_file[max_str]; |
---|
82 | char _Phase_Dim[3]; |
---|
83 | double _Phase_X, _Phase_Px, _Phase_Y, _Phase_Py,_Phase_delta, _Phase_ctau; |
---|
84 | long _Phase_nturn; |
---|
85 | bool _Phase_Damping; |
---|
86 | |
---|
87 | //Touschek lifetime |
---|
88 | bool TouschekFlag, IBSFlag, TousTrackFlag; |
---|
89 | |
---|
90 | // ID correction |
---|
91 | bool IDCorrFlag; |
---|
92 | |
---|
93 | //set default values |
---|
94 | UserCommand(void) //constructor |
---|
95 | { |
---|
96 | /* start tracking coordinates */ |
---|
97 | strcpy(_PrintTrack_track_file,"track.out"); |
---|
98 | _PrintTrack_x = 0.001, _PrintTrack_px=0.0, _PrintTrack_y=0.0, |
---|
99 | _PrintTrack_py=0.0, _PrintTrack_delta=0.0, _PrintTrack_ctau=0.0; |
---|
100 | _PrintTrack_nmax=50L; |
---|
101 | |
---|
102 | /* twiss file */ |
---|
103 | strcpy(_PrintTwiss_twiss_file,"twiss.out"); |
---|
104 | |
---|
105 | /*COD file*/ |
---|
106 | strcpy(_PrintCOD_cod_file,"printcod.out"); |
---|
107 | |
---|
108 | // /* fmap for on momentum particle*/ |
---|
109 | strcpy(_FmapFlag_fmap_file,"fmap.out"); |
---|
110 | _FmapFlag_nxpoint=31L, _FmapFlag_nypoint=21L, _FmapFlag_nturn=516L; |
---|
111 | _FmapFlag_xmax=0.025, _FmapFlag_ymax=0.005, _FmapFlag_delta=0.0; |
---|
112 | _FmapFlag_diffusion = true; |
---|
113 | |
---|
114 | /*fmap for off momentum particle*/ |
---|
115 | strcpy(_FmapdpFlag_fmapdp_file,"fmapdp.out"); |
---|
116 | _FmapdpFlag_nxpoint=31L, _FmapdpFlag_nepoint=21L, _FmapdpFlag_nturn=516L; |
---|
117 | _FmapdpFlag_xmax=0.025, _FmapdpFlag_emax=0.005, _FmapdpFlag_z=0.0; |
---|
118 | _FmapdpFlag_diffusion = true; |
---|
119 | |
---|
120 | /* tune shift with amplitude*/ |
---|
121 | strcpy(_AmplitudeTuneShift_nudx_file,"nudx.out"); |
---|
122 | strcpy(_AmplitudeTuneShift_nudz_file,"nudz.out"); |
---|
123 | _AmplitudeTuneShift_nxpoint=31L; _AmplitudeTuneShift_nypoint=21L; |
---|
124 | _AmplitudeTuneShift_nturn=516L; _AmplitudeTuneShift_xmax=0.025; |
---|
125 | _AmplitudeTuneShift_ymax=0.005, _AmplitudeTuneShift_delta=0.0; |
---|
126 | |
---|
127 | /* tune shift with energy*/ |
---|
128 | strcpy(_EnergyTuneShift_nudp_file,"nudp.out"); |
---|
129 | _EnergyTuneShift_npoint=31L; _EnergyTuneShift_nturn=516L; |
---|
130 | _EnergyTuneShift_deltamax=0.06; |
---|
131 | |
---|
132 | /* random rotation coupling error*/ |
---|
133 | err_seed=0L; err_rms=0.0; |
---|
134 | |
---|
135 | /* momentum acceptance */ |
---|
136 | strcpy(_MomentumAccFlag_momacc_file,"momentumacceptance.out");//default file name |
---|
137 | strcpy(_MomentumAccFlag_TrackDim,"6D"); //default track dimension |
---|
138 | _MomentumAccFlag_istart=1L, _MomentumAccFlag_istop=108L, |
---|
139 | _MomentumAccFlag_nstepn=100L, _MomentumAccFlag_nstepp=100L; |
---|
140 | _MomentumAccFlag_deltaminn=-0.01, _MomentumAccFlag_deltamaxn=-0.05; |
---|
141 | _MomentumAccFlag_deltaminp=0.01, _MomentumAccFlag_deltamaxp=0.05; |
---|
142 | _MomentumAccFlag_nturn = 1026; |
---|
143 | _MomentumAccFlag_zmax = 0.0003; //[m] |
---|
144 | |
---|
145 | /* Phase space */ |
---|
146 | strcpy(_Phase_phase_file,"phase.out"); //default phase file |
---|
147 | strcpy( _Phase_Dim,"4D"); //default phase dimension |
---|
148 | _Phase_X=0.0, _Phase_Px=0.0, _Phase_Y=0.0, _Phase_Py=0.0, |
---|
149 | _Phase_delta=0.0, _Phase_ctau=0.0; |
---|
150 | _Phase_nturn=512L; |
---|
151 | _Phase_Damping = false; |
---|
152 | |
---|
153 | /* fit tunes for full quadrupole*/ |
---|
154 | targetnux = 0.0, targetnuz = 0.0; |
---|
155 | |
---|
156 | /* fit chromaticities*/ |
---|
157 | targetksix = 0.0, targetksiz = 0.0; |
---|
158 | |
---|
159 | }; |
---|
160 | |
---|
161 | }; |
---|
162 | |
---|
163 | /***** file names************/ |
---|
164 | //files with multipole errors; for soleil lattice |
---|
165 | extern char fic_hcorr[max_str],fic_vcorr[max_str], fic_skew[max_str]; |
---|
166 | extern char multipole_file[max_str]; |
---|
167 | //file of source of coupling; for soleil lattice |
---|
168 | extern char virtualskewquad_file[max_str]; |
---|
169 | |
---|
170 | extern char track_file[max_str]; |
---|
171 | extern char twiss_file[max_str]; |
---|
172 | extern char cod_file[max_str]; |
---|
173 | extern char girder_file[max_str]; |
---|
174 | |
---|
175 | //files with the status of hcorr/vcorr status, to choose which correctors are used for orbit correction |
---|
176 | extern char hcorr_file[max_str], vcorr_file[max_str]; |
---|
177 | // extern char fe_file[max_str]; //the same as multipole_file[max_str]????? |
---|
178 | |
---|
179 | //COD correction |
---|
180 | extern int nwh, nwv; |
---|
181 | |
---|
182 | // ID correction |
---|
183 | extern char IDCq_name[max_str][11]; |
---|
184 | |
---|
185 | |
---|
186 | extern char hcorr_name[max_str], vcorr_name[max_str]; |
---|
187 | extern char skew_quad_name[max_str], bpm_name[max_str]; |
---|
188 | extern char gs_name[max_str], ge_name[max_str]; |
---|
189 | |
---|
190 | // function |
---|
191 | void read_script(const char *param_file_name, bool rd_lat,long& CommNo, UserCommand UserCommandFlag[]); |
---|