Difference between revisions of "TAGM TW Calibration"

From GlueXWiki
Jump to: navigation, search
(Calibration Procedure)
(Calibration Procedure)
Line 18: Line 18:
  
 
== Calibration Procedure ==
 
== Calibration Procedure ==
(Note: The most up to date procedure will be kept in [https://github.com/JeffersonLab/sim-recon/tree/master/src/plugins/Calibration/TAGM_TW sim-recon in the README file].
+
(Note: The most up to date procedure will be kept in [https://github.com/JeffersonLab/sim-recon/tree/master/src/plugins/Calibration/TAGM_TW sim-recon in the README file].)
 +
 
 +
Please have CCDB 1.06 or greater. 1.05b does not work with timing.py.
  
 
To calibrate the microscope, follow this procedure:
 
To calibrate the microscope, follow this procedure:

Revision as of 18:10, 28 February 2017

Overview

The plugin TAGM_TW is used to determine the time-walk of the tagger microscope TDCs. Instead of using the fADC for a time reference, the RF signal is used. This is done by finding the RF time nearest to the ADC time, as the ADC has its timewalk corrected through firmware. This RF time provides an excellent reference for measuring the TAGM timewalk.

In addition, the plugin can also be used to calibrate the microscope timing. It can align the ADC to the RF and then match the TDC to the ADC time. It does not align the microscope with the halls in the detector as another plugin does that already.

For efficient calibrations, this plugin should be used on PS skims with about 500k events, though less may suffice. This is roughly the first 10 skim files for a run.

The plugin produces timewalk curves (dt vs pulse peak) using both the "corrected" and uncorrected TDC times. The corrected TDC curves can be used to see the quality of the calibration. The plugin also produces plots of ADC - RF for all columns, including individual fibers, as well as corrected TDC - ADC.

Files:

  • JEventProcessor_TAGM_TW.cc
  • JEventProcessor_TAGM_TW.h
  • tw.py
  • timing.py
  • display.C

Note: You must have your CCDB environment variables set as timing.py pulls the constants before generating new ones.

Calibration Procedure

(Note: The most up to date procedure will be kept in sim-recon in the README file.)

Please have CCDB 1.06 or greater. 1.05b does not work with timing.py.

To calibrate the microscope, follow this procedure:

  1. hd_root -PPLUGINS=TAGM_TW /path/to/PS-skim.evio
  2. Get updated calibration constants for the ADC using the (ADC - RF) histogram
    1. python timing.py -b <root file> <run number> rf <CCDB variation>
    2. This produces the file adc_offsets-####.txt
  3. ccdb add PHOTON_BEAM/microscope/fadc_time_offsets -v default -r ####-#### adc_offsets-####.txt
  4. hd_root -PPLUGINS=TAGM_TW /path/to/PS-skim.evio
  5. Now measure the timewalk
    1. python tw.py -b <root file> <run number>
    2. This produces the file tw-corr.txt
  6. ccdb add PHOTON_BEAM/microscope/tdc_timewalk_corrections -v default -r ####-#### tw-corr.txt
  7. hd_root -PPLUGINS=TAGM_TW /path/to/PS-skim.evio
  8. With the adc aligned with the RF and the timewalk calibrated, align the TDC to the ADC
    1. python timing.py -b <root file> <run> self <CCDB variation>
    2. This generates the file tdc_offsets-####.txt
  9. ccdb add PHOTON_BEAM/microscope/tdc_time_offsets -v default -r ####-#### tdc_offsets-####.txt
  10. hd_root -PPLUGINS=TAGM_TW /path/to/PS-skim.evio
  11. Check TDC - ADC timing distributions
    1. python timing.py -b <root file> <run> validate <CCDB variation>

Verifying the timewalk corrections

The ROOT macro display.C will show the timewalk distributions for all channels.

 root -l 'display.C("/path/to/rootfile.root")'