PS Energy Calibration
During the spring 2015 run the pair spectrometer (PS) magnet's field was changed which didn't correspond to the current field map. A histogram of the reported PS energy associated with a given tagger channel showed a large spread in the PS energy. The source of this energy spread can be seen when plotting the total PS energy against the asymmetry of the electron-positron pair (the electron's energy over the total energy). The distribution is parabolic where the maximum occurs when the pairs are symmetric in energy.
The plugin PS_E_calib is used to determine the corrections required to flatten the PS energy vs PS energy asymmetry plot. This plugin will generate a ROOT file from an EVIO or HDDM file that contains TH2F histograms of the PS energy vs PS energy asymmetry for each hodoscope and microscope channel. A separate ROOT macro will analyze and fit these histograms and provide a table for the CCDB as well as an output ROOT file containing the results for verification.
In the spring 2015 runs the hodoscope covers a larger range of energy than the PS which makes it difficult to use the hodoscope to determine proper corrections. It is recommended that the microscope is used to determine the correction parameters. The parameters from each channel are averaged to create a single set of parameters to be used to correct the PS energy values.
- Eparms-TAGM.out (recommended)
- Eparms-TAGM-calib-chal.out (default values)
Generating a ROOT file
- If running to find the correction parameters, set the flag CORRECTIONS to false in the plugin
- If testing the correction parameters, set the flag CORRECTIONS to true
To run the plugin, use the following command:
hd_root -PPLUGINS=PS_E_calib /path/to/datafile
If a different output filename must be used, change the output file name by adding the following to the hd_root command
- Note: If a file other than hd_root.root is used as the input file for the fitting macro, the macro will need it's input file changed.
Using the ROOT macro
Once the file ROOT file has been generated use the macro PSEcorr.C in the following way
$ root -l -b -q 'PSEcorr.C("hd_root.root")'
This will load the macro PSEcorr.C and then call the method PSEcorr(). Once it finishes it will exit ROOT. No display will be set.
The following flags exist in the PSEcorr.C file
- CORRECTIONS - Set to false when determining correction parameters, set to true when checking the validity of the parameters
- TAGM - Set to true when using the TAGM to determine correction parameters
- TAGH - Set to true when using the TAGH to determine correction parameters
- Note: Both TAGH and TAGM can be set to true but the TAGM is recommended and the default
Verifying the corrections
The ROOT macro PSEcorr.C will create output ROOT files called profiles.root and check.root.
- profiles.root will show the generated TProfile plots with their fits.
- check.root is generated when the CORRECTIONS flag is set to true and shows histograms using the correction parameters. These plots should be roughly horizontal.
The macro will also produce an output file called Eparms-TAGM.out or Eparms-TAGH.out depending on which detectors are used.
- This file contains one line of three numbers: the constant, linear, and quadratic terms of the correction parameters. This can be added directly to CCDB.
- There is also a timing histogram in hd_root.root to verify that the correct timing window was used for PS/TAGX coincidence
Adding the time-walk parameters to CCDB
To add files to the CCDB, type the following
ccdb add /PHOTON_BEAM/pair_spectrometer/fine/energy_corrections -v default -r $RunNo-$RunNo Eparms-TAGM.out
- To start with initial default parameters, add Eparms_calib_chal.out.
- If using a different variation, change "default" to "<variation name>"