Difference between revisions of "Beam Modulation"

From PREX Wiki
Jump to navigationJump to search
 
(84 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
== How to Run Beam Modulation ==
 
== How to Run Beam Modulation ==
 
*First, make sure Coda is running
 
*First, make sure Coda is running
 +
*look at the PREX Analyzer Control Tool on the CODA computer, which contains Aq Feedback, Parity Realtime Analyzer Status, and Beam Modulation Status (on the bottom part).
 +
**[[Image:Screenshot_at_2020-01-10_20-34-53_bmw1.png | 400px|modulation coil plot ]]
 +
*To start the beam modulation
 +
**Press "Kill All" button in the Beam Modulation Section only
 +
**Select BMOD file the "ProductionModulation_Pause10Min_120Hz_pking.py" and accept it.
 +
***[[Image:Screenshot at 2020-01-10 20-35-30_bmw2.png | 400px|modulation coil plot ]]
  
*You need to be logged in apar account on adqa3:
+
**Press "Launch Beam Modulation" button it will become to gray color and you will see a terminal shown up following you action.
**<pre> ssh apar@adaq3 </pre>
 
  
*Go to directory:
+
== Modulation online plots ==
**<pre> cd /adaqfs/home/apar/vowen/BMWClient/PyGreenMonster/ </pre>
 
  
*Run beam modulation code:
+
[[Image:Screen_Shot_2019-07-14_at_12.48.10_PM.png |400px|modulation coil plot ]]
**<pre> python3 ProductionModulation_Pause10Min.py </pre>
+
Task for the analysis shift expert:
 +
For each run,
 +
* Check the online plot ( the top plot on the BMW plot page), we should see all 7 coils (colorful bars) at least for one super cycle (one bunch). If not, check the beam trips, if this run has a lot of beam trips, then check the other more stable runs. If you still miss one or more coils,  then please call Ye: 803-553-3570.
 +
* Check the online plot ( on the BMW Cycle page ).
  
*# Beam modulation will automatically run for 7 days
+
* [[BMOD | BMOD meetings]]
*# In order to quit beam modulation
+
* Beam Modulation Documentation [[Beam_Mod_Portal | Portal]]
*#* <pre> control+c </pre>, to crash out of the beam modulation program.
 
*#* <pre> python3 gm_bmw_clearall.py </pre>, to clean up the DAQ records and release the EPICS FFB pause states.
 
  
 +
== Dithering slopes extraction ==
 +
*<span style ="color:red">To get dithering slope root file for each slug for pass1
 +
# Login to the apar account on aonl2: <code>ssh apar@aonl2 </code>
 +
# <code> cd ~/PREX/prompt/beam-mod/scripts </code>
 +
# If you haven't done a "gojapan" yet then <code> source setup_japan.tcsh </code>
 +
*To analyze for a slug, choose the corresponding list in <code> ~/PREX/prompt/collector/run_list/ </code>
 +
# Next, run <code> ./dit_runlist_alldet.sh ~/PREX/prompt/collector/run_list/slugnumber.list </code>
 +
# The output root files are saved in the directory: ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1
 +
# If you want to look at the dithering slopes versus super cycle plot for each slug
 +
#*<code> cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1 </code>
 +
#*<code>root -l 'dithering_plot_cyc.C(slugNo)'</code>
 +
[[Image:Screenshot-1.png |400px|modulation coil plot ]]
 +
*To analyze for a run, choose the corresponding run number
 +
# Next, run <code> ./auto-dit_alldet.sh runNo </code>
 +
# The output root files are saved in the directory: ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1
 +
# If you want to look at the dithering slopes versus super cycle plot for each slug
 +
#*<code> cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1 </code>
 +
#*<code>root -l 'dithering_plot_cyc.C(slugNo)'</code> (will fill the "dit" tree with super cycle dithering slopes for the run into the corresponding slug )
 +
*<span style ="color:red"> To analyze for a run with lower beam current (<60uA)
 +
#run <code> ./auto-dit_alldet_bcmcut.sh runNo </code> (The bcm_dg_ds>50 cut is set for the code right now.  If you want to analyze the run with lower beam current, you have to change the cut condition in three files: japan_plot_beammod_BPMS_cyc_bcmcut.C, japan_plot_beammod_quartz_cyc_bcmcut.C, japan_plot_beammod_at_cyc_bcmcut.C)
  
* [[BMOD | BMOD meetings]]
+
*<span style ="color:red">To get dithering slope root file for each slug for pass2
* Beam Modulation Documentation [[Beam_Mod_Portal | Portal]]
+
The above dithering slope plot shows that here are couple outlier points, which need to be marked as flag=0 in the sensitivity text file.  And we need to generate new slope root files with the proper flag that can be saved in the directory ~/PREX/prompt/beam-mod/rootfiles_alldet_pass2.
 +
#<code> cd ~/PREX/prompt/beam-mod/scripts/dit_11X12X_txt </code>
 +
[[Image:Screenshot-2.png |400px|modulation coil plot ]]
 +
Each output txt file each row has runnumber      cyclenumber          flagvalue      .......................
 +
we need to change the flag value based on the above plot (0----outlier point; 1----good point)
 +
#After we finish this for the whole slug, then <code> cd ~/PREX/prompt/beam-mod/scripts </code>
 +
#run <code> ./dit_runlist_alldet_pass2.sh ~/PREX/prompt/collector/run_list/slugnumber.list </code> (This step just use the modified txt file to create dithering slope root files with the right flag value for the further analysis)
 +
#<code>cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass2</code>
 +
#*<code>root -l 'dithering_plot_cyc.C(slugNo)'</code> (run the code by plotting the slopes with flag==1 to check that if you need to do more modification)
 +
#*[[Image:Screenshot-3.png |400px|modulation coil plot ]]
 +
#If some special case happened, i.e. magnets are tripped, changing the target, and DAQ issue, and those will shown in the plot as big fluctuations (which is expected), see the plots as follows
 +
#*[[Image:Screenshot-4.png |400px|modulation coil plot ]]
 +
#*adding all slug root files in pass2 together and run <code>root -l 'dithering_plot_cyc.C(slugNo)'</code> to cross check.
 +
 
 +
*<span style ="color:red"> To check the singularity for dithering 5 by 5 inverse matrix 
 +
# <code> cd ~/PREX/prompt/beam-mod/scripts/dit_11X12X_txt </code>
 +
# <code> ./add_runlist_txt.sh ~/PREX/prompt/collector/run_list/slugnumber.list</code> (generate Quartz/AT/BPMs_sensitivity_slugnumber.txt)
 +
#<code> cd ~/PREX/prompt/beam-mod/scripts/dit_11X12X_txt </code>
 +
#<code>root -l 'sensitivity_plot_BPMs_uptodate.C(slugNo)' </code>(plots for a whole slug)
 +
#<span style ="color:red"> <code>root -l 'sensitivity_plot_BPMs_run.C(runNo)' </code>(plots for a run to check the singularity after the  beam tuning)
 +
#* Check the top two plots of the last three canvas (c43, c44, c45), if the absolute Y mean is smaller than 0.1. We need to retune the beam to get proper dithering slopes.
 +
*<span style ="color:red"> To do the dithering correction
 +
# The '''pass2''' root files should be used.
 +
# Get the root files <code> cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass2</code>(mark the out layer points as flag=0)

Latest revision as of 21:55, 10 January 2020

In the process of editing and updating this page. Please contact Juliette Mammei crowder@jlab.org with questions or suggestions.

PREX Main << Expert Tools

How to Run Beam Modulation

  • First, make sure Coda is running
  • look at the PREX Analyzer Control Tool on the CODA computer, which contains Aq Feedback, Parity Realtime Analyzer Status, and Beam Modulation Status (on the bottom part).
    • modulation coil plot
  • To start the beam modulation
    • Press "Kill All" button in the Beam Modulation Section only
    • Select BMOD file the "ProductionModulation_Pause10Min_120Hz_pking.py" and accept it.
      • modulation coil plot
    • Press "Launch Beam Modulation" button it will become to gray color and you will see a terminal shown up following you action.

Modulation online plots

modulation coil plot Task for the analysis shift expert:

For each run, 
  • Check the online plot ( the top plot on the BMW plot page), we should see all 7 coils (colorful bars) at least for one super cycle (one bunch). If not, check the beam trips, if this run has a lot of beam trips, then check the other more stable runs. If you still miss one or more coils, then please call Ye: 803-553-3570.
  • Check the online plot ( on the BMW Cycle page ).

Dithering slopes extraction

  • To get dithering slope root file for each slug for pass1
  1. Login to the apar account on aonl2: ssh apar@aonl2
  2. cd ~/PREX/prompt/beam-mod/scripts
  3. If you haven't done a "gojapan" yet then source setup_japan.tcsh
  • To analyze for a slug, choose the corresponding list in ~/PREX/prompt/collector/run_list/
  1. Next, run ./dit_runlist_alldet.sh ~/PREX/prompt/collector/run_list/slugnumber.list
  2. The output root files are saved in the directory: ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1
  3. If you want to look at the dithering slopes versus super cycle plot for each slug
    • cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1
    • root -l 'dithering_plot_cyc.C(slugNo)'

modulation coil plot

  • To analyze for a run, choose the corresponding run number
  1. Next, run ./auto-dit_alldet.sh runNo
  2. The output root files are saved in the directory: ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1
  3. If you want to look at the dithering slopes versus super cycle plot for each slug
    • cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass1
    • root -l 'dithering_plot_cyc.C(slugNo)' (will fill the "dit" tree with super cycle dithering slopes for the run into the corresponding slug )
  • To analyze for a run with lower beam current (<60uA)
  1. run ./auto-dit_alldet_bcmcut.sh runNo (The bcm_dg_ds>50 cut is set for the code right now. If you want to analyze the run with lower beam current, you have to change the cut condition in three files: japan_plot_beammod_BPMS_cyc_bcmcut.C, japan_plot_beammod_quartz_cyc_bcmcut.C, japan_plot_beammod_at_cyc_bcmcut.C)
  • To get dithering slope root file for each slug for pass2

The above dithering slope plot shows that here are couple outlier points, which need to be marked as flag=0 in the sensitivity text file. And we need to generate new slope root files with the proper flag that can be saved in the directory ~/PREX/prompt/beam-mod/rootfiles_alldet_pass2.

  1. cd ~/PREX/prompt/beam-mod/scripts/dit_11X12X_txt

modulation coil plot Each output txt file each row has runnumber cyclenumber flagvalue ....................... we need to change the flag value based on the above plot (0----outlier point; 1----good point)

  1. After we finish this for the whole slug, then cd ~/PREX/prompt/beam-mod/scripts
  2. run ./dit_runlist_alldet_pass2.sh ~/PREX/prompt/collector/run_list/slugnumber.list (This step just use the modified txt file to create dithering slope root files with the right flag value for the further analysis)
  3. cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass2
    • root -l 'dithering_plot_cyc.C(slugNo)' (run the code by plotting the slopes with flag==1 to check that if you need to do more modification)
    • modulation coil plot
  4. If some special case happened, i.e. magnets are tripped, changing the target, and DAQ issue, and those will shown in the plot as big fluctuations (which is expected), see the plots as follows
    • modulation coil plot
    • adding all slug root files in pass2 together and run root -l 'dithering_plot_cyc.C(slugNo)' to cross check.
  • To check the singularity for dithering 5 by 5 inverse matrix
  1. cd ~/PREX/prompt/beam-mod/scripts/dit_11X12X_txt
  2. ./add_runlist_txt.sh ~/PREX/prompt/collector/run_list/slugnumber.list (generate Quartz/AT/BPMs_sensitivity_slugnumber.txt)
  3. cd ~/PREX/prompt/beam-mod/scripts/dit_11X12X_txt
  4. root -l 'sensitivity_plot_BPMs_uptodate.C(slugNo)' (plots for a whole slug)
  5. root -l 'sensitivity_plot_BPMs_run.C(runNo)' (plots for a run to check the singularity after the beam tuning)
    • Check the top two plots of the last three canvas (c43, c44, c45), if the absolute Y mean is smaller than 0.1. We need to retune the beam to get proper dithering slopes.
  • To do the dithering correction
  1. The pass2 root files should be used.
  2. Get the root files cd ~/PREX/prompt/beam-mod/rootfiles_alldet_pass2(mark the out layer points as flag=0)