<<<<<<< .mine March 3, 2021 - adjust plots for beam dynamics paper. The plots are created in /nfs/gm2/data1/dlr10/g-2/mytest/spin_test/spin_test_single_plate_ref2/ using mytest/spin_test/spin_test_pub.pdf and spin_test_conv_efield_pub.gnu ======= September 3 To create plots of twiss parameters propagating into ring /home/dlr/development9_linux/g-2/mytest/mismatch August 27-September 2 New plots for BD paper. polarization plot use david@Davids-Mac-mini:~/development/bmad_dist/g-2/mytest/spin_track/plot_spin.gnu quad_field.pdf - g-2/plotting_scripts/quad_field.gnu in subdirectory /spin_track/20200811_160221/ mini Efield/pitch theory mini/g-2/documentation/PitchSystematic1.tex, called by header.tex bd systematics - documentation/aps_bdsys/Rubin-aps-July2020/ ap1_pitch.tex August 8 - 18 gm22/mytest/efield_pitch_surveyed gm22/mytest/efield_pitch_survey_sym_volt 81 configs, +-0.01,0 V -surveyed alignment - in progress 8/18 gm22/mytest/efield_pitch_survey_sym_errors 81 configs, +- (sum+diff/2 errors) gm22/mytest/efield_pitch_survey_sym_v2 81 configs, +- (sum and diff errors not correlated) gm22/mytest/energy_vs_time_vs_turn config_011-config_018 - pulse shapes 1-8 August 3, 22020 2-43M amplitude agree. Width small, out of phase? 2-44M nominal collimators, 0 injection angle >>>>>>> .r53682 July 1, 2020 run CBOptp CBOavg width ap comments 2-39 -4>13 5 17 +40.-38 kick 244 offset collimators, 15.8 > +1mm, 19.2 > 0,27.2 > -2mm, 30.4> 2.5mm, 38.1 > -.5mm 2-38 -7.5>10 1.25 16.5 +38,-40 kick 292 2-40 -12>13 1 19 45, -45 poor statistics, 50mm collimator, kick 244G 2-36 -4,11 3 18 -32, 32 no energy loss, poor statistics,collimators only at 16 and 20 2-35 -2>14 6 17 +40,-32 kick 233 2-34 -2>14 6 16 +35,-32 kick 233, 10ns bin width 2-33 -4>14 5 16-17 +40,-35 kick 244 2-41 -8>12 2 18.5 +40,-40 kick 244, offset collimators -5mm and 50mm aperture 2-40 -11,14 1.5 19.5 +42,-40 June 26, 2020 For fiber harp try removing 3/5 collimators. Actually, displace all colimators radially in 2.5mm. Keep it simple Start with run_2-37/20200617_142252 with 1ns bunch. run_2-40 20200626_090735, Now try increasing collimator diameter 20200626_200804 June 23, 2020 vertical width - config_br_18kV_play_y gets radial centroid but width too small - 220.e-4 190.e-4 205.e-4 - config_br_18kV_play_z/20200611_135121 gets radial width but centroid too big 200.e-4 170.e-4 185.e-4 - Try kick halfway in between. Also set initial vertial beta to 5 from 10 (based on vertical mismatch) config_br_18kV_play_z/20200623_094947 20200623_094954 20200623_095013 20200623_095017 210.e-4 180.e-4 195.e-4, beta_v inf = 5 Complete analysis and plot this last. Good match to radial width. Average radial too high. For more statistic - submit batch config_br_18kV_play_y/ use 220.e-4 190.e-4 205.e-4 play/20200623_195122 20200623_195131 20200623_195136 20200623_195140 fiber harps - the closed orbit distortion peaks at -2.5 mm at 9m and +2.5mm at 30mm. The collimators are at the end of Q2 short, Q2 long, Q3 long Q4 short and Q4 long, that is 15.8m, 19.2m, 27.2 m, 30.4m 38.1m A shortcut to including the closed orbit distortion is to displace the collimators. 15.8 > +1mm, 19.2 > 0,27.2 > -2mm, 30.4> 2.5mm, 38.1 > -.5mm Set up in run_2-39. In retrospect not sure how this helps. The radial out aperture is smaller. But the radially in is no bigger. June 22, 2020 STuff to do 1. Beta mismatch ~/development9_linux/g-2/mytest/mismatch - the vertical mismatch is pretty extreme. Try setting beta_y smaller at inflector exit. That might reduce eventual vertical distribution? 2. Why does centroid and width oscillate at revolution frequency? I would expect that number of muons would oscillate (FR signal) but not the average position. 3. How to include nonuniform field? June 17, 2020 Set bunch length to 1ns. That way all particles get the same kick. run_2-37. 20200617_142252 - bunch length = 1ns., kicker =244 G 20200617_193249 - bunch length = 1ns., kicker=292 G - the 'Beam_moments_by_element.dat' agrees with centroid data. Next repeat with realistic bunch length and more data June 16, 2020 Harp comparison. Plotting centroid +sign*width. Is the sum greater than the aperture? Copy run_2-27/20200604_124602 to run_2-36 for convenience. This run had energy loss off. To see how it fills apertures. June 12, 2020 run_2-34 plot (centroid sign)* width + centroid. Sim is 5-10mm less than measurement. Plotting width from FiberHarp.dat from run_2-21 looks very different from width from Beam_moments_by_element. Maybe the 149 ns bin is too big? What if we get Beam_moments_by_element for each element (rather than full turn). Try that in run_2-34. set save_element_by_element_info = T Also run_2-35/ input from run_2-34 with 2.5ns bin. June 11, 2020 Try that last excercise again. Repeat run_2-22 angle, kicker,distr. Note that scraping is different. June 10, 2020 run_2-33. Increased angle. Still not making CBO. Are the collimators right? Something is not right. A difference from run_2-22 is the distribution. From the file in run_2-33 and new from run_2-22. Try run_2-33 with random dist. Another difference is that muon decay is turned on in run_2-22. Go back to run_2-30 and rerun with random distribution. As in run_2-22 set pzsigma=0.026. June 9, 2020 Modify lattice with 24 (rather than 12) markers for time dependence of width. Run test job /config_b4_18kV_play_y/ to make sure it is working before submitting a load. 20200609_105109. Close but wants bigger kick. Requires some minor modification of compute_time_dep_moments_calo.f90. Create new versions of ploting scripts. Fiber harp/ run_2-30. Increase angle of run_2-29 to -3mrad and submit 25 jobs - CBO too big. Try angle = -2.5mrad run_2-31. Centroid too small. Try -2.75mrad run_2-32 vertical width - config_br_18kV_play_y/ 20200610_102811 - with 10G increase in kicker. Looks OK. start 4 more jobs same input.dat 20200610_204531 20200610_204536 20200610_204544 20200610_204627 Jun 8, 2020 Modify so that if there is only one file to read, the output gets written to that directory (as well as main directory). That way it gets saved. Create local plotting script plot_harp.gnu to plot from FiberHarp.dat for those directories to help figure out what's what with all the runs in run_2-27. Decide to run for more statistics with inputs from run_2-27/20200605_203649/input.dat > run_2-29 submit 25 runs /run_2-27/20200605_144834/input.dat > run_2-28 submit 25 runs More statistics for phase-correlation study. June 7, 2020 Increase angle more. 20200607_072208. Try same angle but no offset. 20200607_133758. CBO got smaller !!! Next try bigger collimators 20200607_134347 also no help. Try random distribution rather than Diktus. June 6, 2020 More kicker. high. Got to 254G. 20200605_203649. Now need more CBO. Increase angle, reduce offset, -0.001 0.0 0.0 -0.0025 0 0 20200606_203036. CBO shifts down. June 5, 2020 latest/run_2-27/20200604_202126/ 0.01 20200603_190201 - reasonable. Next use injection angle and kicker from run_2-22/input.dat 20200604_103242. - strange. CBO is smaller and average is too high? width looks good. Using Diktus distr. Maybe statistics. Try again with 100k vs 25k. run_2-27/ 20200604_124602. No energy loss. Turns out ift was off. Try again with energy loss June 2, 2020 Use Dyktis distribution with input from 20200531_135810 -> play/'20200602_072207' Modify tracking_master, create_phase_space, read_dmuons, muon_interface, to specify the number of muons to read from a file and the first muon to read With that feature play/'20200602_105603 20200602_105616 20200602_105631 20200602_110047' each run reads next 100k muons (or as many as are left) June 1, 2020 Maybe its about the radial field. Try using BrFourier2016.dat and input from 20200531_135810 > play/ 20200601_100826 20200601_100924 no help. Vertical is worse. Try opposite sign Br Change sign of radial field in subroutine generalize_cyl_exp /play/'20200601_152222 20200601_15222' May 31, 2020 Redo that last as kicker inadvertenly set to zero. play/'20200531_090213' kicker_params%kicker_field = 210.e-4 180.e-4 195.e-4 ! Renee + 10 - centroid matches but vertical width too big, horizontal too small. Try more inj angle. (y) play/'20200531_135810 very close-vertical width a bit high. Try more inj angle. -0.001 0.0 0.0 -0.002 0 0, kick = renee + 10 play/'20200531_175429'. CBO too big. Vertical width too big. May 30, 2020 increase kicker to bring down CBO play '20200530_093959' looks good but cbo still too big. Increase kicker a bit more play/'20200530_195038' - kicker at 0. May 29, 2020 The problem seems to be only in the radial width 10-30 us. Vertical width looks OK. Try running g2tracking with 149.2ns bin again. Somethng funny about that last attempt. play/'20200529_111751' May 28, 2020 play/ ' 20200527_183248' (y) inflector_end_target = -0.00185 0.0 0.0 -0.00125 0 0, vertical width OK but CBO too big, radial width too small. Reduce angle, keep offset. (z) inflector_end_target = -0.00185 0.0 0.0 -0.00025 0 0 play/'20200528_071649' vertical width too big. Maybe horizontal CBO and width are at wrong relative phase. Add a plot. Find that relative phase width and amplitude in good agreement with measurement. May 27, 2020 Forward momentum/correlation distributions with unequal kickers in /nfs/gm2/data2/dlr10/g-2/mytest/energy_vs_time_vs_turn/config_008 and config_009 to tyler. /play/'20200527_110918' - with differential kicker voltages from Renee. But otherwise same as. Use config_br_18kV_play_x input.dat with differential kicks. Find that reducing the kick makes the vetical width smaller, (too small) Also CBO is to big. Try reduing injection angle. Init (r) (-1mrad) play/20200527_143053. CBO too big. Vertical width too big. radial width too small. May 25, 2020 Turns out that compute_moments_s_time_calo was doig the right thing. The problem was in compile_all_time_dep combining 10ns bins into 149.2 ns bins. This is fixed so that re running compile_all_time_dep will work. Use option'N'. Try again with tracking starting after inflector. This time with restored compute_moments_vs_time_calo play/'20200525_104150' Radial width is a few mm bigger than tracker. May 22, 2020 20200521_170741 with 149.2 ns bins. Width and amplitude in Time_Dep_Moments_at_END.dat now look identical to Beam_moments_by_element.dat. Is the problem in the way the bins are combined? Meanwhile, no calo data was written. Must be a bug. May 21, 2020 Create . Modification of so that both sums and averages are written to files with '_at_' and '_sum_' so that can try to understand what's happening. Two things to try - Increase bin width in input.dat to 149.2 ns - play/'20200521_170741' with latest modification of that writes both average and sum - decrease momentum width of the initial districtuon so there is no debunching May 20, 2020 /play ' 20200520_073918' injection through inflector, with version of compute_time_dep_moments that sums version of compute_time_dep_moments_calo that collects sums. Modify compile_all_time_dep so that it can translate sums as well as ave. Test of this feature on 20200519_19620 suggests that this fixes the problem with width! /g-2/mytest/energy_vs_time_vs_turn/config_008/ kicker 1 - 20, kicker 3 +20 May 19, 2020 /play/20200519_190620 edit compute_time_dep_moments_calo.f90 so that sums are saved rather than sigma. Start tracking after inflector. May 18, 2020 /g-2/mytest/energy_vs_time_vs_turn/config_008/ kicker 1 + 20, kicker 3 -20 May 13, 2020 Time to find out what varying individual kickers does. Decrease kicker 1 increase kicker 3. play/'20200513_201758 20200513_201815 20200513_201817 20200513_201821' May 12, 2020 play/'20200512_071716 20200512_071722 20200512_071726 20200512_07173' decrease kicker slightly(200.0 to 198.) decrease horizontal angle slightly (-1.25 to -1mrad) config_br_18kV_play_x - inflector_end_target = -0.00085 0.0 0.0 -0.00125 to get vertical width. - But CBO amplitude is too big. May 11, 2020 Change initial horizontal angle. -1mm,-1.5mrad (m) Vertical angle back to 0 play/' 20200511_083129 20200511_083252 20200511_083300 20200511_083306' CBO average a bit low. Amplitude a bit high. Vertical lines up pretty well both centroid and width. Radial width amplitude agrees at 60 us . A bit low at earlier time. But minimum of width is a few mm below minimum of measured width. Try a bit smaller angle. A bit lower kicker. play/'20200511_130616 20200511_130624 20200511_130641 20200511_130647' CBO way too big and vertical width too small. Try increasing kicker play/'20200511_185443 20200511_185450 20200511_185527 20200511_185534' vertical width very close, CBO too big May 10, 2020 20200510_073020 - single partle, on momentum, -1mrad vert 20200510_083506 single particle. No scattering. 20200510_110615 single particle. No scattering. 50ppm radial. increases vertical ptp. which we know reduces vertical width 20200510_124030 single particle. No scatter. Br=0. py_init=1mrad > 1.6mrad at inflector. gives 3 times ppt as 100ppm bradial. 20200510_124845 20200510_124857 20200510_124904 20200510_124912 - py_init=1mrad. scatter in inflector is on. Not much effect on width That means an incoming vertical angle should do the same. May 9, 2020 Maybe somehow a vertical offset or angle from inflector is equivalent in some way to radial field? Try an offset at inflector. enter at 2mm,0mrad, exit inflector with -1.2mrad vert, play/'20200509_150416 20200509_150422 20200509_150430 20200509_150435' MISTAKE. There is no -1.2mrad. Vertical angle is zero May 8, 2020 Run '20200501_181949 20200501_181955' with more statistics. Appears a bit closer to measured vertical width? But this time turn off muon decay. play/ '20200508_082514 20200508_082521 20200508_082532 20200508_082539' vertical width too big Try radial field. Radial field does reduce width. Try 50 ppm. play/'20200508_213314 20200508_213323 20200508_213332 20200508_213339' vertical width closer but still too big. Horizontal ptp is very close. Why does increasing radial field also increase mean radial? May 7, 2020 Getting th scraping right seems to have helped. Start looking at vertical rather than horizontal. Rus from 20200501 both short on statistics. play '20200507_164938 20200507_164947 20200507_164954 20200507_165004'. same as '20200501_122036 20200501_123056'. May 4, 2020 /g-2/programs/compile_all_time_dep.f90 - edit to loop through all locations and write plot_width_cboamp_10-30us.dat that is loaded by config_ref/plot_width_cboamp_10-30us.gnu and labels plot and output file /g-2/mytest/energy_vs_time_vs_turn/config_007/ 25ns early started 12:22 May 3, 2020 /g-2/mytest/energy_vs_time_vs_turn/config_006/all_Energy_vs_time_0.dat 25 ns later (started 8:56 am) /g-2/mytest/energy_vs_time_vs_turn/config_007/ 25ns early May 1, 2020 Edit track1_preprocess so that scraping differentially exponentially dissapears with tau= 7.e-6 - focus_scrape_scale = init_quad_focus * exp(- (quad_time-quad_ramp_start_time)/tau). There is no longer a stop time. The differential asymptotically approaches zero. Decay time fixed to 7 us for time being. (ma) play/'20200501_122036 20200501_123056' no difference. But extra scattering. Set extra scattering back to zero and try again. (mb) play/'20200501_181949 20200501_181955' no difference April 30, 2020 Still confused. Maybe I should get the scraping time dependence in the right way. April 26, 2020 Set 18.3-15.1 (vs 13.1) and 50mm collimator a26 /play/'20200426_070054 20200426_070108 20200426_070132 20200426_070138' Did the width get smaller? April 25, 2020 Comparison with tracker data suggests that scrape voltage change is less than in simulation. Especially vertical. Try reducing change. April 19, 2020 Maybe its the colimator at 180 deg that scrapes the waist. Try opening that collimator (a19a) play/'20200419_132656 20200419_132714 20200419_132728 20200419_132736' nothing. Increase both collimators to 50mm (a19b) play/' 20200419_172726 20200419_172730 20200419_172737 20200419_172812' width withing 0.5mm. ptp cbo close but CBO simulation decays more quickly than data. Does that mean there is too much mom April 18, 2020 Try positive angle (w) (a18) play '20200418_140306 20200418_140309 20200418_140317 20200418_140319' No help April 17, 2020 Turning scraping off increases width. Turning off just horizontal width has almost no effect on horizontal width. Does that make sense? Not sure about that but it does seem to be implemented properly Try radial B-field - set to 100 ppm in lattice file and quad_input.dat Back to (r). bad resistors. horiozntla scraping on (a17a) /play/'20200417_090600 20200417_092713 20200417_092725 20200417_092736 20200417_092740' Shifted up 8mm. Width is 0.5mm narrower. CBO ptp -5:17. Try something a bit smaller. 20ppm (17b) play/'20200417_114137 20200417_114208 20200417_114237 20200417_114254' April 15, 2020 Increase scattering in inflector ends /play/ set extra scatter factor to 5, turn on scraping and bad resistors and (a15a) play/'20200415_101206 20200415_101211 20200415_101218 20200415_101226' No effect on width. extra_inf_scatter_factor =0. Track1_custom now has a scale factor that allows multiplication of the end of the inflector scatter. Normally extra_inf_scatter_factor=0. Modify track1_preprocess so that horizontal scraping can be turned off independently. logical horizontal_scrape if false turns off horiozntal voltage change (r) (a15b) play/'20200415_164037 20200415_164042 20200415_164047 20200415_164051' width is 8:17, radial centroid is 1-3mm too great. Maybe a bit less inj angle? Try combination of (p) and no horizontal scrape (a15c) play/'20200415_192902 20200415_192905 20200415_192909 20200415_192912' cbo ptp -5:21, width 8.5:17 April 14, 2020 (a14) play/ turn off scraping '20200414_210912 20200414_210920 20200414_210941 20200414_210948' radial width does increase to nearly match tracker. Centroid amplitude is now smaller ~2-3 mm. Also tracker vertical mean shows scraping change in vertical orbit is smaller than in simulation but still there. April 13, 2020 Compare config_br_18kV_play_t_nodecay/ and config_br_18kV_play_t_nodecay/. The feature that vertical width decreased with time was evidently statistical as no longer happens. Meanwhile tracker data is in g-2/files/TrackerData/ .C files are modified to .dat so that they are gnuplot readable. Names of files are /g-2/files/TrackerData/plot_form.gnu to be loaded when plotting. Tracker width 10:19 mm. Centroid measurements > sim and average is > sim ? larger inj angle? Vetical - width 13.25 vs 12.75 measurement. Vertical mean at S12 more or less agrees with simulation. So simulated vertical width is too big. Simulated horizontal width is too small. April 11, 2020 config_br_18kV_play_t_nodecay/ complete, make plots. Wdith vs time almost no change to 300 us. No decay config_gr_18kV_play_t_nodecay April 8, 2020 show results from config_br_18kV_play_t/ in phase-acceptance meeting. The big discrepancy is that the width shrinks too fast. More statistics create config_br_18kV_play_t_nodecay/ all the same as config_br_18kV_play_t but with decay turned off. submit jobs Fix /config_ref/plot_vert_one_dir - label horizontal (not vertical) centroid plot /config_br_18kV_play_v - kicker is 210 G. Widths are different. But vertical width nevertheless too small. April 7, 2020 submit (v) config_gr_18kV_play_v /g-2/mytest/energy_vs_time_vs_turn/config_005/ all_Energy_vs_time__0.dat 50ns early April 6, 2020 (u) /play/'20200405_141805 20200405_141815 20200405_141843 20200405_141913' - e_x too small. try kick 210. (v) play/'20200406_075059 20200406_075109 20200406_075116 20200406_075123' 10:150 = 5.87 - try config_gr_18kV_play_v /g-2/mytest/energy_vs_time_vs_turn/config_004/all_Energy_vs_time_0.dat 50 ns later /g-2/mytest/energy_vs_time_vs_turn/config_005/ 50ns early April 5, 2020 /nfs/gm2/data2/dlr10/g-2/mytest/energy_vs_time_vs_turn/config_004 correlated distribution kicker time +50ns back to efield_pitch_bad_resistors/play. Two things to try. Bigger kick to get r_e closer. And more scattering to increase width. Start with kick. Increase from 204 to 224. Label (t) /play/'20200405_141805 20200405_141815 20200405_141843 20200405_141913' April 4, 2020 plot results from config_gr_18kV_play_t/ and create a presentation g-2/documentation/bad_resistors/WidthvsTimePosition_20200404 April 3, 2020 config_br_18kV_play_t/ $pb/compile_all_time_dep 'QUADM1' 149.2e-9 'all' for each location and END gnup500 -e 'title="bad resistors"' ../config_ref/plot_vert_one_dir.gnu Features - Plot width vs time at 12 locations. Lost muons - more low energy muons are lost. =6.83 is a bit high (closest to End Game) Plot fraction of muons lost. Plot width and CBO 10-30us /config_ref/plot_width_cboamp_10-30us.gnu There are 67,167 muons that decay after 35us. 207 muons lost after 35us, 55 muons lost after 35us with p>p_magic, 152 lost after 35us with p< p_magic Fix up compile_Time_Dep so that it writes a file of lost muons with just those lost after 35us - hist_lost_muons.pdf Copy input.dat from config_br_18kV_play_t to config_gr_18kV_play_t. Turn off bad resistors and start 50 jobs April 2, 2020 Since (t) was pretty close, use input.dat from 20200401_152555 and submit 50 jobs into directory /config_br_18kV_play_t/ April 1, 2020 Discover that inflector scattering was turned off because tracking_method=custom was commented out in bmad_grid_fringe_inf.bmad. Fixed (s) Rerun (r) with scattering in inflector entrance and exit. play/'20200401_064716 20200401_064727 20200401_064735 20200401_064738' Not much different from (r) Next look at collimators. Sudeshna says the 2 collimators were between Q3short and Q3long (near calo 16) and at about 270 halfway from Q3long to Q4short. Comment out custom tracking in all other collimators in bmad_es_br_8_grid. (t) Rerun (s) play/'20200401_152530 20200401_152541 20200401_152550 20200401_152555' 10-30us width ptp 7:17- 8:18, 100us 12:18, CBO ptp -5:20 at 10us to -2:14 at 100us March 27-30, 2020 That last experiment to reduce scraping to increase width did just the opposite. With the reduced scraping the centroid amplitude increased and the width decreased. (a)Try increasing scraping? Increase scraping 50% play/'20200327_073357 20200327_073446 20200327_073505 20200327_073523' (b)Reduce scraping voltage change in half. submit 4 jobs play/20200326_194142 20200326_194223 20200326_194233 20200326_194239 Again, amplitude is bigger, width is smaller. (c) Go back to nominal voltage and shift ramp start time to 7.5 us (D. Tarazona's recommendation) 0., -2mrad play/'20200327_115759 20200327_115809 20200327_115821 20200327_115834' Does not help - OSC amplitude a bit too big. ptp=-10-20 and width ptp = 7-16.5 (d) Try reducing injection angle a bit to -1mm -1.5mrad play/'20200327_164118 20200327_164131 20200327_164143 20200327_164157'. Now the CBO amplitude is too small (16mm) but the width did increase a bit ptp = 8-17.5. (e) Try -2mm -1.75 play/'20200328_020457 20200328_020508 20200328_020515 20200328_020524' CBO ptp -3:16, width ptp 7:17 (f) Try -2mm -2.25 play/'20200328_102519 20200328_102531 20200328_102540 20200328_102552' width ptp 7:16.5 CBO ptp -4:16, (g) Try -1mm -2.25 play/'20200328_160624 20200328_160633 20200328_160649 20200328_160701', width ptp 7:17 CBO pt -3:16 (h) Try -2mm -3mrad play/'20200329_074521 20200329_074529 20200329_074539 20200329_074545' width ptp 7:17, CBO ptp -3:16 (j) Try -2mm -3mrad again. This time restore scrape start time to 15us play/'20200329_133837 20200329_133842 20200329_133851 20200329_133856' no change (k) Restore inflector to 0.97 (harp optimum), Then to run 2-21. 0.,-2mrad, start scrape at 7.5us play/'20200329_184146 20200329_184232 20200329_184240 20200329_184250' CBO ptp -6:20, width ptp 6:15 (l) Very interesting. Now try -1mm, -2mrad play/'20200330_071616 20200330_071629 20200330_071642 20200330_071653' CBO ptp -7:21 width ptp 6-16 (m) Try -1mm, -1.5mrad play/'20200330_111715 20200330_111721 20200330_111727 20200330_111732' at QUADM10, CBO ptp -5:22, width ptp 6:15 almost no difference (p) 0.,0. inflector = 0.98 play/'20200330_171315 20200330_171321 20200330_171326 20200330_171329' at QUADM10 (near tracker 18) CBO ptp -3:18 width ptp 6:17 (r) 0.,-0.001 inflector = 0.98 play/'20200331_154344 20200331_154354 20200331_154402 20200331_154407' at QUADM10 (near tracker 18) CBO ptp -5:19 width ptp 6:17 March 26, 2020 generalize so that the bin width can be changed. There are two inputs from the command line, location - QUADM1, and desired width 149.2e-9 With 149.2 ns bin, can compare CBO amplitude and width and equilibrium radius to measurements. Both amplitude and width are a bit too small. Increase emittance and injection angle. and run test job in play/20200326_102040 Further generalize compile_all_time_dep.f90 so that a specific subset of directories can be input at the command line. Find that play/20200326_102040 now has the proper CBO amplitude but the width is not affected. Maybe I am scraping too aggressively. March 25, 2020 /energy_vs_time_vs_turn/ config_002 and config_003 all_Energy_vs_time_0.dat forward to Josh and Tyler. Need to write some code to automate the compilation. Rewrite to search through all of the subdirectories, look for phase_space files END028_phase_space.dat, and compile a local Energy_vs_time_0.dat file. Then cat together in March 24, 2020 - /efield/pitch_bad_resistors/config_br_18kv/ same as config_ref/20200323_114801 - submit jobs /efield/pitch_bad_resistors/config_gr_18kv/ same as config_ref/20200323_183557 - submit jobs energy_vs_time_vs_turn. Try again. bad g2.sh script. config_003, use cat.dat to combine March 23, 2020 - in /config_ref there is a bug when writing End of tracking phse space. Sometimes. ? I started a db version to see if I get a hint. 20200323_085907 Add more markers (12) to lattice and modify compute_moments_vs_time_calo.f90. Modify lattice in config_ref 20200323_114801 20200323_114801 - intesting. 12 markers. plot_vert_one_dir.pdf No muons lost after 30us. More statistics? Should do the same without bad resistors. 20200323_183557 __________________________________________________________________________________________________________________________ March 22, 2020 - lost muons, vertical width, gm22/efield_pitch_bad_resistors/config_ref/, plot_lost_muons.pdf, plot_vertical_width.pdf (run compile_all_time_dep). Will generalize 'compile_all_time_dep' so that 'Time_Dep_Moments_at_QUADM#' are compiled Removing what seems to be about efield and pitch calc from this version but for safety cp compile_all_time_dep.f90 to compile_all_time_dep.f90_save Works fine like this ./compile_all_time_dep where is QUADM1, QUADM2,..., QUADM8, or END. Writes to EndTime_location.dat harp/run_2-22-dp - more statistic and still width does notmatch measurement ? gm22/mytest/energy_vs_time_vs_turn/config_003 - kicker time + 100ns March 21, 2020 - gm22/mytest/energy_vs_time_vs_turn/config_002 - compiled into all_Energy_vs_time_0.dat and ready to go kick is 100ns early gm22/mytest/efield_pitch_bad_resistors/config_ref - submit many jobs to generate lost muon statistics. (lost muons are compiled with compile_Time_Dep March 21, 2020 - gm22/mytest/energy_vs_time_vs_turn/config_002 - compiled into all_Energy_vs_time_0.dat and ready to go kick is 100ns early gm22/mytest/efield_pitch_bad_resistors/config_ref - submit many jobs to generate lost muon statistics. (lost muons are compiled with compile_Time_Dep gm22/mytest/harp/run_2-22-dp jobs on lnx6186 to increase statistics March 20, 2020 - gm22/mytest/energy_vs_time_vs_turn/config_001 - complete, nominal /config_002 - kicker time - 100ns gm22/mytest/efield_pitch_bad_resistors/config_ref - for a look at lost muons and vertical distribution with bad resistors. Having fixed problem, do a trial run to make sure data is written at all of the calo markers 7:38. Fixed 9:00 Trail run with nmuons = 10000 Another bug with writing data for calo markers. There was no final call to write in tracking_master. This must have gotten lost when I was confused about versions. Checks out 9:38. When other grid jobs are complete will launch. __________________________________________________________________________________ March 19, 2020 - A version of compile_Time_Dep.f90 called compile_all_time_dep.f90 claims to use a 149ns bin (rather than the 10ns standard) but this requires that g2_tracking was run with 149ns bin. Or that it be generalized to sum what it reads from Time_Dep_moments_at_END.dat into appropriate bin size. Needs to be done Create momentum time correlated distributions - Meanwhile, to generate more correlation distributions for Josh. Find working directory /gm2/data2/dlr10/g-2/mytest/energy_vs_time_vs_turn. Data was originally in file all_Energy_vs_time.dat The program/energy_vs_time.f90 creates Energy_vs_time_0.dat from files with END000 and END028 To write the phase space every n turns set the parameter in input.dat runs energy_vs_time in each subdirectory to plot constructed from ls -d 20*/energy_vs_time.dat to create all_Energy_vs_time_0.dat Now that I remember how to do this. Create subdirectories to energy_vs_time_vs_turn with configs 001 - shift kickers 100ns earlier /run_2-22-dp looks promising. Need more data. keeps track of hits on planes at markers QUADM1.. if the lattice has these elements. For seeing how width varies around ring. The number of turns is passed through . I had forgotten to set in tracking_master. Fixed ________________________________________________________________________________________________________________________________________________ March 18, 2020 - initialize in tracking_master.f90 so it gets to compute_moments_vs_time.f90. This was necessary when QUADM markers were added in track1_custom.f90 to keep track of hits between short and long quads. And that was for the circumferential dependence of beta from the bad resistors ____________________________________________________________________________________________________________ August 10., 2019 - In create_phase_space initialize lifetime (muons(i)%coord%r =1.e7) to very long August 9, 2019 Add parameter to input.dat. If n>0 then phase space is written every n turns to a file with the number of turns in the title. Default is zero. July 18, 2019 Add subroutine fit_to_ibms to optimize_incident.f90. To determine incident angle and offset and inflector field to match ibms 1,2,3 The target ibms values are loaded into first 3 places of inflector_end_target and fourth > 10 flags program to do the right thing July 5, 2019 Create ibms_lattice. with superimpose with longitudinal positions from Brynn Edit track1_custom to include IBMS1, IBMS2, IBMS3 May 20, To create distribution at end of injection line nmuons = 200000 create_new_distribution = T ! muon_file = INJ_TO_RING_phase_space.dat twiss_ref = 'end' start_tracking_at_inflector_exit = F initial_offsets = -2.9343E-02 0. 0. 1.6292E-02 0. 0. !Inf = -2mrad, 0mm, -2mrad write_phase_space_file = T To read distribution nmuons = number available create_distribution = F muon_file = 'INJ_TO_RING_phase_space.dat' twiss_ref = 'use_as_is' start_tracking_at_inflector_exit = T initial_offsets = 0. 0. 0. 0. 0. 0. write_phase_space = F May 19, to create distribution at end of injection line to then read with start_tracking_at_inflector, use MARK_INFLECTOR_DS_phase_space.dat (before patch that changes coordinate system). Set 'twiss_ref' = 'use_as_is' so that create_phase_space does not try to match beta. and do not reset timing distribution. Add if(twiss_ref /= use_as_is) to call generate_long_time_dist May 17, tracking_master.f90 - set muons%coord%state = lost$ at start of tracking if lifetime is less than BetaCrossE_start_time. May 16. Declare ele_init as pointer rather than normal structure in track1_preprocess so that it does not cause memory leak. May 13. Modify set_dipole_params (in set quad_params.f90) to set radial field Add ele_start structure to bmad_parameters and set equal to ele after quad grids are determined in set_quad_param. Refer to ele_start when scaleing for scraping in track1_preprocess May 7, Modify BetaCrossE starting time. The integrals are initiated internal to track_all_int_efield if %t > start time. write_phase_space modified to write only muons with %t> start_time. Add BetaCrossE_start_time to calling sequence for track_all_int_efield, and write_phase_space. Update muon_interface. May1, create g-2/py and add Josh's script to create input and quad misalignments May 1, 2019 - tracking_master.f90 - Add BetaCrossE_start_time input variable to start integration at start of data taking. April 5, 2019 - tracking_master.f90 - In interpolating to muon decay point, check if time between bounding points is <0 April 4, 2019 - track1_preprocess.f90 - quad plates are grids 3-6 (not 2-5), this since. grid(1) is main B-field. grid(2) is radial B field March 13, 2019 - track1_preprocess and track1_postprocess are modified to change vec(6) at entrance and exit to quad by voltage change. March 9, 2019 - correct Beta Cross B in track_all_int_efield.f90 to |B| - |beta X B| March 9, 2019 - add option to initialize offset with respect to closed orbit - logical/initial_offset_from_co in tracking_master.f90 March 8, 2018 - add option to correct acceleration in electrostatic quads by restoring vec(6) after tracking through element. See track_all_int_efield.f90 (If standard track_all is used this will not be operational - logical/no_energy_change May 17, 2014 - Notes about tracking programs Main = tracking_master All subroutine are in code/ directory Need to figure out how to rebuild finalfocus/ and magneticfield/ after having put all subroutines into code/ tracking_master now propagates through backleg and inflector Inflector apertures at each end are defined in lattice file for rectangular aperture. The "D" shape of the aperture is accessed in TRACK1_CUSTOM - for these elements (check TRACK1_CUSTOM to see whats incorporated) Also scattering in coil ends and cryo window is from TRACK1_CUSTOM Scattering is no longer controlled in input.dat. It can be turned off by removing the marker elements from the lattice file or editing TRACK1_CUSTOM MARK_CRYO_US MARK_INFLECTOR_US MARK_INFLECTOR_DS If in the lattice file inj: line = (inject, inj_to_ring, ring_br) then particles are tracked through the backleg inj: line= (injinf, inj_to_inrg, ring_br) then particles are tracked using taylor maps In both cases, the distribution emittance and twiss parameters is defined at the midpoint of the inflector. The distribution is propagated to the end of the inflector and then back to the opening of the hole in the iron. Note that the taylor maps are not precisely symplectic so the inverse is approximate. If the number of muons is one then the trajectory through the backleg and fringe and inflector is written to unit 71 and the twiss parameters are computed assuming the initial values in the lattice file and written to unit 72. The beam parameters computed from the distribution after propagating through injection line to end of inflector is written to EndInfAfterScatter.dat August 11, 2014 - The subroutine optimize_twiss finds the twiss parameters at the start of the injection line (30 cm upstream of iron) that give the specified (in the input file) twiss parameters at the end of element INFA in the inflector. August 12, 2014 - The routine get_branch_inverse_matrix inverts the transfer matrix through the injection line. It had been using the full line, from 30cm upstream of iron to end of inflector. Set the endpoint in this routine to be at element 'INFA'. August 14, 2014 Modify tracking_master to write phase space for each element in the injection line. Files are named ele%name//"phase_space.dat" Plot using plotting_scripts/hist_any_file.gnu for example like so gnuplot -e "filename='CRYO_USphase_space.dat'" ../plotting_scripts/hist_any_file.gnu Add ability to use matrices for propagation through injection channel. The flag in the input file is inj_matrix_tracking. Definitely more particles make it through. Remember that the map for the fringe field cuts off at 6mm, and 25mm. The code assumes that beyond the boundaries of the map the field is uniform. But of course this gets the focusing effect wrong. Of course the transfer matrices won't be right for the 36mm aperture inflector since the reference trajectory will go beyond the 6mm boundary. August 15, 2014 The field map for the fringe field cuts off at +6mm in x with respect to the center line and +-25mm in y. Beyond the map we assume B has the value at the boundary. This means that for the nominal 9mm inflector that which the reference orbit is all within the bounds of the map, that will not be true for all of the particles in the distribution. 1. Perhaps a reasonable approximation is to use the matrices computed with respect to the reference to propagate the particle distribution. 2. But for the 18mm inflector even the reference orbit is outside the bounds of the map. Are the matrices associated with this reference valid? If not then using matricies to propagate phase space in this case is not sensible. Let's check it out. Compare propagation of beta for 18mm inflector and 9mm. The answer to this question is that the propagation of the twiss functions is very different using these approximations for the field map. It therefore is not sensible to use the related matrices to propagate phase space. In order to calculate with the larger inflector we need a better map. Try to figure out how to read HeHe's map. Meanwhile, update repository. Check out on linux. Repeat calcs in injection_line/ and they look OK. Next step to update g-2 Sanity check. With a single muon, fort.71 is trajectory through injection channel, and fort.72 is the beta. August 20, 2014 Add comments to "create_phase_space" Check that random distribution of muons gives capture efficiency consistent with VD... Note that the emittances in the input file are for 1 sigma and the 95% is 2 sigma (or 4 times the emittance) August 21, 2014 Add lattice name to input.dat Add comments to subroutine collect_times 2014_0904 NSF: Adding Wuzheng's larger B-field map for the ring/backleg/hole. The first 3 lines of the file describe the number of gridpoints in the {xyz}-directions, the number of field components, and the arrangement of the data in the rest of the file. The spatial extent of the map can be read from the first/last data lines after the header: 711 cm < x < 731 cm 0 cm < y < 3 cm -430 cm < z < 10 cm The B-field unit is again Gauss, as it was with the smaller map. Wuzheng did not include Hy(Oe) in the larger map, which helps reduce file size, but makes it more difficult to tell when muons are in the backleg steel (Hy: logical - if true use twiss parameters defined in lattice file to propagate through injection line. so that it is possible to use twiss set in lattice file. This does not converge so well. Return to varying betax and alphax at end of inflector through input file and find that if twiss = 1.7642, 10.0, -0.7502, 0, 2.0, 0., 0., 0., 0.7, 0.7, 0., 0., beam just fits through inflector with max of 44.6mm in ring. f=45/7.7 =>95% emit=34 mm-mrad - Note this is independent of the distribution. (f defined in plotting script) Now it would be nice to see if these better optimized values give more muons. Create new directory BetaTest Copy input file and lattice file from ../KickTimeTest/127cm-20153028 Set optimized beta in input file - 348 stored ? seems low ---------------------------- I would like a fresh calculation of capture with old kicker vs new (including realistic pulse) -create /KickTimeTest/821kick-20150614. Copy input from ../../BetaTest. Restore nominal twiss. and run as a check - ge 398. Looks reasonable and the 348 with the new betas really was low ??? - Meanwhile, I found that KickTimeTest/127cm_table_20150507/Kick1-3Scan/ has the appropriate run with the full pulse - Back to /KickTimeTest/821kick-20150614. Set input for 821 kicker circuit - We get 217 stored with kickers at kicker_params%kicker_field = 210.0e-4 210.0e-4 210.0e-4 - Now do scan ************** Comment out line 175 in fields.f90 that writes to unit 344. This information gives kicker pulse but generates a very large file ********** ------------------------------------------------------ October 12, 2015 code/fields.f90 Edit calculation of quadrupole efield so that - between quad plates (0.05) and chamber wall (0.1) the efield is taken to be plate_voltage/(distance to wall) - beyond the vacuum chamber wall, quad field is set to zero. (This is important for electron tracking) - programs/efield_test.f90 calls fields.f90 and can compute fields. ___________________________________________ December 23, 2015 Add bmad style electrostatic multipoles to lattice file bmad_es_multipoles. Turn on/off bmad multipoles (vs straight expansion in em_field_custom) by setting field_calc = custom (or not) in definition of FULLRING. Update set_quad_params to do the right thing with bmad multipoles The good thing about the bmad style is that the entrance and exit fringe effect is included The bad thing is that there is no easy way to deal with muons (or positrons) near or outside the plates) But maybe the correction to the fringe fixed the peculiar energy dependence of omega_a? Try that out ____________________________________________________________ Attempt to reproduce tracker 1. (mb) play/'20200501_181949 20200501_181955' statistics limited. vwidth slightly high. rwidth close after dip. CBOa bit low 2. 20200510_124845 20200510_124857 20200510_124904 20200510_124912 - py_init=1mrad - vwidth high, Everything else pretty close 3. '20200511_185443 20200511_185450 20200511_185527 20200511_185534' vwidth very close. CBO too big 4. '20200511_130616 20200511_130624 20200511_130641 20200511_130647' vwidth and rwidth both close. CBO too big 5. 20200511_083129 20200511_083252 20200511_083300 20200511_083306' all close. CBO high peak agrees, low peak too neg. 6. '20200512_071716 20200512_071722 20200512_071726 20200512_07173' vwidth high, rwidth close. CBO damps quicker 7. /'20200513_201758 20200513_201815 20200513_201817 20200513_201821' vwidth slightly low, rwidth close. CBO big