Difference between revisions of "TAGM TW Calibration"

From GlueXWiki
Jump to: navigation, search
(Using the ROOT macro)
Line 64: Line 64:
  
 
To start with initial default parameters, add tagm_tw_parms_defaults.out.
 
To start with initial default parameters, add tagm_tw_parms_defaults.out.
 
== Debugging the ROOT macro ==
 
If problems arise with the ROOT macro, set the flag DEBUG to true. This will print out the current position of the code and can help narrow down the problem.
 

Revision as of 12:20, 9 December 2015

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. In the spring 2015 run the TAGM has a large time-walk effect and requires looking for coincidences with the pair spectrometer in order to find the best RF time. This plugin will generate a ROOT file from an EVIO or HDDM file that contains 100 histograms, the time difference versus pedestal-subtracted pulse peak amplitude for all 100 readout channels. 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.

Files:

  • JEventProcessor_TAGM_TW.cc
  • JEventProcessor_TAGM_TW.h
  • tw_corr.C
  • defaults.C
  • tagm_tw_parms_defaults.out
  • tagm_tw_parms.out
  • sigmas.out
  • results.root

Generating a ROOT file

To run the plugin, use the following command:

hd_root -PPLUGINS=TAGM_TW /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

-o new_filename.root
  • 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 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_0, 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_0
    • These directories contain the adjusted time-walk curves for the 100 readout channels which have been centered about 0
  • 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.

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.