Difference between revisions of "TAGM TW Calibration"

From GlueXWiki
Jump to: navigation, search
(Overview)
(Generating a ROOT file)
Line 19: Line 19:
  
 
<pre>
 
<pre>
hd_root -PPLUGINS=TAGM_TW /path/to/datafile
+
hd_root -PPLUGINS=TAGM_TW /path/to/PS-skim.evio
 
</pre>
 
</pre>
  
If a different output filename must be used, change the output file name by adding the following to the hd_root command
+
If the calibrations vary greatly from previous runs, it might be useful to add the option -PTAGMHit:DELTA_T_ADC_TDC_MAX=500 in order to form hits if the tdc - adc time are within 500 ns of each other. If this difference is too large, it is likely the plugin will not histogram the event properly and thus the fit will fail.
 
+
<pre>
+
-o new_filename.root
+
</pre>
+
 
+
*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 ==
 
== Using the ROOT macro ==

Revision as of 20:09, 7 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 fADC time, as the fADC 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

Generating a ROOT file

To run the plugin, use the following command:

hd_root -PPLUGINS=TAGM_TW /path/to/PS-skim.evio

If the calibrations vary greatly from previous runs, it might be useful to add the option -PTAGMHit:DELTA_T_ADC_TDC_MAX=500 in order to form hits if the tdc - adc time are within 500 ns of each other. If this difference is too large, it is likely the plugin will not histogram the event properly and thus the fit will fail.

Using the ROOT macro

Once the file ROOT file has been generated use the macro tw_corr.C in the following way

$ root -l -b -q 'tw_corr.C("hd_root.root")'

This will load the macro tw_corr.C and then call the method tw_corr(). Once it finishes it will exit ROOT. No display will be set.

  • Screen output has been turned off by default. If you would like to see the results as they are computed, change the flag OUTPUT to true at the top of the macro.
  • There is also a flag for debugging, DEBUG, that can be set to true for additional screen output.
  • If the input file is not hd_root.root, edit the command so that it matches the correct filename.

Verifying the corrections

The ROOT macro tw_corr.C will create an output ROOT file called results.root which will contain the time-walk histograms before and after the corrections as well as the TProfile used for fitting. It will also create a text file sigmas.out that contains the final sigmas of the timing distributions.

results.root contains three main directories: dt_vs_pp, dt_vs_pp_corr, and dt_vs_pp_profile.

  • dt_vs_pp
    • These directories contain the initial time-walk curves for the 100 readout channels
  • dt_vs_pp_corr
    • These directories contain the corrected time-walk curves for the 100 readout channels
  • dt_vs_pp_profile
    • These directories contain the TProfile plots used during the fitting process.

The histograms in dt_vs_pp_corr should be roughly horizontal for good channels. Low amplitude channels may not be horizontal.

In the main directory there are two summary plots, sigmas_before and sigmas_after, which show the timing resolution for each channel before and after the corrections.

Adding the time-walk parameters to CCDB

To add files to the CCDB, type the following

ccdb add /PHOTON_BEAM/microscope/tdc_timewalk_corrections -v default -r $RunNo-$RunNo tagm_tw_parms.out

To start with initial default parameters, add tagm_tw_parms_defaults.out.