Difference between revisions of "Performing Dithering Corrections"

From PREX Wiki
Jump to: navigation, search
(Created page with "This code uses data taken during beam modulation, or dithering. It uses bpms 4aX, 4aY, 4eX, 4eY, and 12X and detectors asym_usl, asym_usr, asym_dsl, and asym_dsr as dependent...")
 
Line 1: Line 1:
This code uses data taken during beam modulation, or dithering. It uses bpms 4aX, 4aY, 4eX, 4eY, and 12X and detectors asym_usl, asym_usr, asym_dsl, and asym_dsr as dependent variables (DVs). It calculates the dithering slopes and uses either the slopes from a single run or the average slopes over the whole slug to correct the DVs.
+
This code uses data taken during beam modulation, or dithering. It uses 5 bpms ''diff_4aX, diff_4aY, diff_4eX, diff_4eY'', and ''diff_12X'' as independent variables (IVs), and the 4 main detectors ''asym_usl, asym_usr, asym_dsl'', and ''asym_dsr'' as dependent variables (DVs). It calculates the dithering slopes and uses either the slopes from a single run or the average slopes over a slug to correct the DVs.
  
 
== Getting Started ==
 
== Getting Started ==
 +
First, you will need to find the slopes that you will use to perform the correction.
 
# Login to the apar account on aonl2: <code>ssh apar@aonl2 </code>
 
# Login to the apar account on aonl2: <code>ssh apar@aonl2 </code>
# <code> cd ~/PREX/prompt/beam-mod </code>
+
# <code> cd ~/PREX/prompt/beam-mod/rootfiles </code>
 +
# <code> source setup_japan.tcsh </code>
 +
# Choose a list of runs that you would like to analyze and put them in a file called "filename.list"
 +
#* To analyze a slug, choose the list in <code> ~/PREX/prompt/collector/run_list/ </code>
 +
# Next, run <code> ./dit_runlist.sh filename.list </code>
 +
 
 +
This creates a root file called "dit_slopes_filename.root" in the <code> cd ~/PREX/prompt/beam-mod/rootfiles </code> directory.
 +
 
 +
It contains the following variables:
 +
#run: The runnumber
 +
#''DV''_''IV'': the slope of the graph of ''DV'' vs IV''
 +
#* '''Example:''' usr_4aY contains the slopes of asym_usr vs diff_bpm4aY
 +
#* There is one for each pair of the following variables:
 +
#** DV: asym_usl, asym_usr, asym_dsl, asym_dsr
 +
#** IV: diff_bpm4aX, diff_bpm4aY, diff_bpm4eX, diff_bpm4eY, diff_bpm12X
  
 
<span style="color:red"> Describe how to create a root file that has all the slopes here </span>
 
<span style="color:red"> Describe how to create a root file that has all the slopes here </span>

Revision as of 22:04, 25 July 2019

This code uses data taken during beam modulation, or dithering. It uses 5 bpms diff_4aX, diff_4aY, diff_4eX, diff_4eY, and diff_12X as independent variables (IVs), and the 4 main detectors asym_usl, asym_usr, asym_dsl, and asym_dsr as dependent variables (DVs). It calculates the dithering slopes and uses either the slopes from a single run or the average slopes over a slug to correct the DVs.

Getting Started

First, you will need to find the slopes that you will use to perform the correction.

  1. Login to the apar account on aonl2: ssh apar@aonl2
  2. cd ~/PREX/prompt/beam-mod/rootfiles
  3. source setup_japan.tcsh
  4. Choose a list of runs that you would like to analyze and put them in a file called "filename.list"
    • To analyze a slug, choose the list in ~/PREX/prompt/collector/run_list/
  5. Next, run ./dit_runlist.sh filename.list

This creates a root file called "dit_slopes_filename.root" in the cd ~/PREX/prompt/beam-mod/rootfiles directory.

It contains the following variables:

  1. run: The runnumber
  2. DV_IV: the slope of the graph of DV vs IV
    • Example: usr_4aY contains the slopes of asym_usr vs diff_bpm4aY
    • There is one for each pair of the following variables:
      • DV: asym_usl, asym_usr, asym_dsl, asym_dsr
      • IV: diff_bpm4aX, diff_bpm4aY, diff_bpm4eX, diff_bpm4eY, diff_bpm12X

Describe how to create a root file that has all the slopes here

Setting up for analysis

To get set up, all you have to do is make sure you know the run number you would like to correct.

QuerySlugNumber.C

Give this macro your run number, and it will tell you what slug it belongs too

black.list

This file is a list of all the runs whose slopes are "outliers" and should not be used. To check that your slopes are good:


Running the analysis

There are two scripts that have several options that you can control.

DitAlias.C

This macro will use slopes from either a specific run number or the average from a slug, and uses them to correct the detector asymmetries. It draws plots of the detector asymmetry before and after the correction.

CorrectTree.C

This macro will use the slug average to correct the detector asymmetries. It saves the uncorrected and corrected detector asymmetries to a root file.