Difference between revisions of "RF Calibration"
From GlueXWiki
(→Intra-system Jitter) |
m (changed $HALLD_HOME to $HALLD_RECON_HOME following split of recon and sim repositories) |
||
(70 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
** '''CAEN TDCs:''' <span style="color:red">TOF</span> | ** '''CAEN TDCs:''' <span style="color:red">TOF</span> | ||
** '''FADC250s:''' <span style="color:red">TAGH</span>, <span style="color:red">ST</span> | ** '''FADC250s:''' <span style="color:red">TAGH</span>, <span style="color:red">ST</span> | ||
− | * Since the RF signal is the highest-resolution time measurement for the event (particularly in the TOF CAEN TDC), it is used as a baseline to help line up the timing offsets of the different detector systems. | + | * Since the RF signal has a known frequency, it can be used to test the understanding of the electronics (e.g. resolutions). |
− | * | + | * Also, since the RF signal is the highest-resolution time measurement for the event (particularly in the TOF CAEN TDC), it is used as a baseline to help line up the timing offsets of the different detector systems. |
+ | * During analysis, detected tracks will "vote" on the beam bunch that caused the event, and then it's time can be used as an event start time for computing particle-ID confidence levels. | ||
* Because the RF signal is periodic it is effectively self-analyzing: it can be compared against itself to study our understanding of the timing. It also serves as a good test of whether the TDC → time conversion is working properly. | * Because the RF signal is periodic it is effectively self-analyzing: it can be compared against itself to study our understanding of the timing. It also serves as a good test of whether the TDC → time conversion is working properly. | ||
* However, the FADC250 algorithms were not designed to extract the pulse times from signals with a waveform of the RF distribution (degraded square-wave, see plot), so these signals are ignored. | * However, the FADC250 algorithms were not designed to extract the pulse times from signals with a waveform of the RF distribution (degraded square-wave, see plot), so these signals are ignored. | ||
Line 14: | Line 15: | ||
== Notes / References == | == Notes / References == | ||
* For questions regarding these procedures, please contact <span style="color:red">Paul Mattione</span>. | * For questions regarding these procedures, please contact <span style="color:red">Paul Mattione</span>. | ||
− | * Link to the <span style="color:#0000FF">RF_online</span> plugin and scripts, which contains all of the code needed for these calibrations: [https:// | + | * Link to the <span style="color:#0000FF">RF_online</span> plugin and scripts, which contains all of the code needed for these calibrations: [https://github.com/JeffersonLab/sim-recon/tree/master/src/plugins/monitoring/RF_online Link] |
** The ROOT macros for studying the data are located in the <span style="color:#0000FF">calib_scripts</span> subfolder in this plugin directory. | ** The ROOT macros for studying the data are located in the <span style="color:#0000FF">calib_scripts</span> subfolder in this plugin directory. | ||
− | * | + | ** The locations where the rocs/modules/channels the RF signal are hooked up is found in the translation table (TT). Information about the TT can be found at: [[Translation_Table |Link]] |
− | + | ||
− | + | ||
− | + | ||
* A wiki page detailing which ROCs are which can be found at: [https://halldweb.jlab.org/wiki/index.php/HallD_Online_IP_Name_And_Address_Conventions Link] | * A wiki page detailing which ROCs are which can be found at: [https://halldweb.jlab.org/wiki/index.php/HallD_Online_IP_Name_And_Address_Conventions Link] | ||
Line 30: | Line 28: | ||
|- | |- | ||
| PHOTON_BEAM/RF/rf_period | | PHOTON_BEAM/RF/rf_period | ||
− | | The period of time between RF beam bunches arriving from the accelerator. | + | | The period of time between MO signals on the RF signal cable arriving from the accelerator. |
+ | |- | ||
+ | | PHOTON_BEAM/RF/beam_period | ||
+ | | The period of time between beam bunches arriving from the accelerator. | ||
|- | |- | ||
| PHOTON_BEAM/RF/time_offset | | PHOTON_BEAM/RF/time_offset | ||
Line 45: | Line 46: | ||
* Except for <span style="color:#0000FF">rf_period</span>, each entry is a table with 4 columns (<span style="color:red">TOF</span>, <span style="color:red">TAGH</span>, <span style="color:red">PSC</span>, <span style="color:red">FDC</span>) and 1 row (the values for that constant). | * Except for <span style="color:#0000FF">rf_period</span>, each entry is a table with 4 columns (<span style="color:red">TOF</span>, <span style="color:red">TAGH</span>, <span style="color:red">PSC</span>, <span style="color:red">FDC</span>) and 1 row (the values for that constant). | ||
* Since the <span style="color:red">TOF</span> RF signal has the best resolution, its <span style="color:#0000FF">time_offset</span> and <span style="color:#0000FF">time_offset_var</span> constants should be <span style="color:red">0</span>. | * Since the <span style="color:red">TOF</span> RF signal has the best resolution, its <span style="color:#0000FF">time_offset</span> and <span style="color:#0000FF">time_offset_var</span> constants should be <span style="color:red">0</span>. | ||
+ | |||
+ | == Special RF-Test Runs == | ||
+ | |||
+ | * The data acquisition can be configured to take a quick, special run for testing all of the procedures in this document. However, "normal" runs can be used instead, since all of the ROCs that the RF signals are hooked up to are typically read out in any "normal" run. | ||
+ | * To setup a quick run, run the data acquisition with: | ||
+ | RUN: EXPERT | ||
+ | SETUP: hd_synctest.tsg_noGTP | ||
+ | CONFIG: pulser.conf | ||
+ | * You only need a few minutes of data (i.e. 10k - 100k events). | ||
== Validating TI-Time Uniformity == | == Validating TI-Time Uniformity == | ||
− | * As detailed in [ | + | * As detailed in [https://halldweb.jlab.org/doc-private/DocDB/ShowDocument?docid=2686 GlueX Doc 2686], a copy of the global system clock time is present on each ROC (on the Trigger Interface (TI) board). To check whether they are all consistent with each other, run the <span style="color:#0000FF">RF_online</span> plugin on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_ROCTITimes.C</span> macro on the resulting ROOT file: |
<pre> | <pre> | ||
root -l hd_root.root | root -l hd_root.root | ||
− | . | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_ROCTITimes.C |
− | + | ||
</pre> | </pre> | ||
Line 65: | Line 74: | ||
== TDC → Time Conversion == | == TDC → Time Conversion == | ||
− | * The details of how to convert the F1TDC and CAEN TDC signals to times are in [ | + | * The details of how to convert the F1TDC and CAEN TDC signals to times are in [https://halldweb.jlab.org/doc-private/DocDB/ShowDocument?docid=2686 GlueX Doc 2686]. These algorithms are implemented by the <span style="color:#0000FF">DTTabUtilities</span> class (in sim-recon/src/libraries/TTAB). |
* '''F1TDCs:''' The F1TDC times are converted using the ROC TI time as the reference time. The <span style="color:#0000FF">DF1TDCConfig</span> class contains the necessary constants for performing the conversion. If this class is not present in the data stream, the constants in the CCDB are used ([https://halldweb.jlab.org/cgi-bin/ccdb/versions?table=/F1TDC/rollover Link]). Also, the <span style="color:#0000FF">DF1TDCConfig</span> information in the data stream was incorrect for runs <= <span style="color:red">2965</span>, so the CCDB constants are used for these runs as well. Otherwise, the CCDB constants should no longer be used. | * '''F1TDCs:''' The F1TDC times are converted using the ROC TI time as the reference time. The <span style="color:#0000FF">DF1TDCConfig</span> class contains the necessary constants for performing the conversion. If this class is not present in the data stream, the constants in the CCDB are used ([https://halldweb.jlab.org/cgi-bin/ccdb/versions?table=/F1TDC/rollover Link]). Also, the <span style="color:#0000FF">DF1TDCConfig</span> information in the data stream was incorrect for runs <= <span style="color:red">2965</span>, so the CCDB constants are used for these runs as well. Otherwise, the CCDB constants should no longer be used. | ||
* '''CAEN TDCs:''' The TDC → time conversion constant for the CAEN TDCs was derived by Ben Raydo and is documented in [https://mailman.jlab.org/pipermail/halld-electronics/2015-April/000026.html this email]. It is <span style="color:red">23.4375 +/- 0.0012 ps</span>. This uncertainty is small enough that a channel-by-channel pulser measurement of the TDC → time conversion constant is unnecessary. | * '''CAEN TDCs:''' The TDC → time conversion constant for the CAEN TDCs was derived by Ben Raydo and is documented in [https://mailman.jlab.org/pipermail/halld-electronics/2015-April/000026.html this email]. It is <span style="color:red">23.4375 +/- 0.0012 ps</span>. This uncertainty is small enough that a channel-by-channel pulser measurement of the TDC → time conversion constant is unnecessary. | ||
− | ** As mentioned in the GlueX timing document ([ | + | ** As mentioned in the GlueX timing document ([https://halldweb.jlab.org/doc-private/DocDB/ShowDocument?docid=2686 GlueX Doc 2686]), the 6-fold-ambiguity CCDB constant (<span style="color:#0000FF">/TOF/tdc_shift</span>) has been fixed. It is fixed to a constant value of <span style="color:red">0</span>, and should not need to be changed. |
*** This can be checked by running the <span style="color:#0000FF">TOF_TDC_shift</span> plugin on EVIO data. | *** This can be checked by running the <span style="color:#0000FF">TOF_TDC_shift</span> plugin on EVIO data. | ||
+ | |||
+ | === RF Signal Pre-Scaling === | ||
+ | * The RF signal has a frequency of <span style="color:#0000FF">499 MHz</span>, which is far too frequent for the electronics readout: If it tries to record at that rate it will overflow the buffer. | ||
+ | * So, the RF signals are pre-scaled down by large multipliers so that there are only a few signals recorded for each channel in the readout window. | ||
+ | * This pre-scaling is typically between <span style="color:red">1/64</span> and <span style="color:red">1/512</span>, inclusive. | ||
+ | ** E.g. if the TOF signal was read out <span style="color:red">1/128</span> times, the time difference between TOF RF signals should be at 128*1000/499 = <span style="color:red">256.513 ns</span>. | ||
+ | * The pre-scale factors can be modified through the EPICS GUIs. From the main menu, press the <span style="color:red">"Master Oscillator / RF"</span> button in the <span style="color:red">"Beam"</span> section. | ||
+ | ** Then change the value in the <span style="color:red">"Prescale Setpoint"</span> field to change the prescale factor. The value should typically be somewhere between 64 - 512. | ||
+ | *** If you cannot set it to the desired value, it may be that the separate, board prescale value is not high enough. Click on the "MO Boards" link to open the page the board, and change the board prescale value. This is because there are 2 separate multipliers: one for the board, and one for the channel, which are combined together to give the "Prescale Readback" value that you are entering. Changing the <span style="color:red">"Prescale Setpoint"</span> changes the channel multiplier to achieve the desired total prescale factor. | ||
=== Validation === | === Validation === | ||
Line 78: | Line 96: | ||
<pre> | <pre> | ||
root -l hd_root.root | root -l hd_root.root | ||
− | . | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_TDCConversion.C |
− | + | ||
</pre> | </pre> | ||
* This macro will draw histograms for each detector system of the time difference between the first RF signal in an event and the times of the subsequent RF signals. Zoom in on these histograms and confirm that the secondary peaks are occurring at the correct times. | * This macro will draw histograms for each detector system of the time difference between the first RF signal in an event and the times of the subsequent RF signals. Zoom in on these histograms and confirm that the secondary peaks are occurring at the correct times. | ||
− | ** The | + | ** The pre-scale factor is not recorded, nor does it's value matter, as long as you several sharp spikes at fixed intervals with no sidebands. |
− | + | ||
− | * If the RF signals don't arrive at their expected times, notify the online and/or electronics experts. | + | * If the RF signals don't arrive at their expected times, reset the prescale factors for the RF signals. Do this by pulling up the prescale factor GUI window as detailed in the '''Pre-Scaling''' section above, then click on the <span style="color:red">"MO Boards"</span> button. Select the desired board (Tagger/Hall), then press the <span style="color:red">"RESET TO DEFAULTS"</span> button. Close the window, and then re-set the desired pre-scale factors. If you are still experiencing issues, notify the online and/or electronics experts. |
* Example plots: | * Example plots: | ||
Line 93: | Line 109: | ||
| [[Image:RFCalib_TDCConversion_Zoom.png|thumb|left|550px|TDC Conversion Test: Zoomed in]] | | [[Image:RFCalib_TDCConversion_Zoom.png|thumb|left|550px|TDC Conversion Test: Zoomed in]] | ||
|} | |} | ||
+ | |||
+ | === Timing Consistency === | ||
+ | * The consistency of the timing within each detector can be checked by using the RF signal. This is done by comparing the time difference between the first-arriving signal and subsequent signals, the second-arriving signal and subsequent signals, etc. These distributions are then lined up near zero by shifting them by ~2.004 ns * Prescale factor * delta_N (e.g. when comparing 1st signal and 4th signal, delta_N is 3). The means, sigmas, skewness, and kurtosis of these distributions can be studied to see if there are any anomalies in the TDC -> time conversion. | ||
+ | |||
+ | * To study these distributions, run the <span style="color:#0000FF">RF_online</span> plugin on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_InternalDeltaTs.C</span> macro on the resulting ROOT file: | ||
+ | |||
+ | root -l hd_root.root | ||
+ | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_InternalDeltaTs.C | ||
+ | |||
+ | * This should produce histograms similar to the following: | ||
+ | {| class="wikitable" | ||
+ | | [[Image:RFDeltaT_Mean_TOF_Fixed.png|thumb|left|600px|Mean]] | ||
+ | | [[Image:RFDeltaT_Resolution_TOF_Fixed.png|thumb|left|600px|Resolution]] | ||
+ | |- | ||
+ | | [[Image:RFDeltaT_Skewness_TOF_Fixed.png|thumb|left|600px|Skewness]] | ||
+ | | [[Image:RFDeltaT_Kurtosis_TOF_Fixed.png|thumb|left|600px|Kurtosis]] | ||
+ | |} | ||
+ | <br style="clear:both;"/> | ||
+ | |||
+ | * If you notice any behavior that is anomalous (e.g. highly-skewed distributions), notify the electronics group. | ||
== RF Time Calibration == | == RF Time Calibration == | ||
Line 104: | Line 140: | ||
<pre> | <pre> | ||
root -l hd_root.root | root -l hd_root.root | ||
− | . | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_SignalPeriod.C |
− | + | ||
</pre> | </pre> | ||
Line 113: | Line 148: | ||
<br style="clear:both;"/> | <br style="clear:both;"/> | ||
− | === | + | === Beam Bunch Period === |
− | * At the beginning of each run period, the | + | * At the beginning of each run period, the beam bunch period needs to be determined. It will typically be <span style="color:red">4.008 ns</span> (<span style="color:red">249.5 MHz</span>), but can sometimes be other values (e.g. <span style="color:red">2.004 ns</span> (<span style="color:red">499 MHz</span>) during Fall 2014 data). |
− | ** Remember, the period of the | + | ** Remember, the period of the beam bunches is not necessarily the same as the period of the RF signal. |
− | * To determine the | + | * To determine the beam period, run the <span style="color:#0000FF">RF_online</span> plugin on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_BeamBunchPeriod.C</span> macro on the resulting ROOT file: |
<pre> | <pre> | ||
root -l hd_root.root | root -l hd_root.root | ||
− | . | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_BeamBunchPeriod.C |
− | + | ||
</pre> | </pre> | ||
* This will produce a histogram showing the time difference between different tagger hits in the same counter within the same event. It should look similar to the following, where the time difference between the peaks indicates the period of the beam bunches (here <span style="color:red">4.008 ns</span>): | * This will produce a histogram showing the time difference between different tagger hits in the same counter within the same event. It should look similar to the following, where the time difference between the peaks indicates the period of the beam bunches (here <span style="color:red">4.008 ns</span>): | ||
− | [[Image:RFCalib_BeamBunchPeriod.png|thumb|left|900px|Peaks indicate | + | [[Image:RFCalib_BeamBunchPeriod.png|thumb|left|900px|Peaks indicate Beam Bunch Period (NOT the RF signal period!)]] |
<br style="clear:both;"/> | <br style="clear:both;"/> | ||
− | * The resolution of the tagger times is not good enough to determine the actual frequency from this histogram. Instead, compare the difference between the peaks to the expected value of the | + | * The resolution of the tagger times is not good enough to determine the actual frequency from this histogram. Instead, compare the difference between the peaks to the expected value of the beam period (here, <span style="color:red">249.5 MHz = 4.008 ns</span>). |
− | * If the | + | * If the beam bunch period has changed, create a new, single-line text file (e.g. <span style="color:red">beam_period.txt</span>) containing one number, the value of the new beam bunch period: |
<pre> | <pre> | ||
Line 135: | Line 169: | ||
</pre> | </pre> | ||
− | * Then check the new constant into the | + | * Then check the new constant into the database with the following (using the appropriate variation <span style="color:red"><variation></span>, and the appropriate for run numbers for <span style="color:red"><run_min></span> & <span style="color:red"><run_max></span>): |
− | + | ||
− | ccdb add PHOTON_BEAM/RF/ | + | ccdb add PHOTON_BEAM/RF/beam_period -v <span style="color:red"><b><variation></b></span> -r <span style="color:red"><b><run_min></b></span>-<span style="color:red"><b><run_max></b></span> beam_period.txt #"Beam bunch period" |
− | + | ||
=== RF Time Resolution === | === RF Time Resolution === | ||
Line 148: | Line 181: | ||
<pre> | <pre> | ||
root -l hd_root.root | root -l hd_root.root | ||
− | . | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_SelfResolution.C |
− | + | ||
</pre> | </pre> | ||
Line 157: | Line 189: | ||
<br style="clear:both;"/> | <br style="clear:both;"/> | ||
− | * It will also print the time-resolution-squared for each system to screen and to a text file. Check | + | * It will also print the time-resolution-squared for each system to screen and to a text file. Check these constants into the database with the following (using the appropriate variation <span style="color:red"><variation></span>, and the appropriate for run numbers for <span style="color:red"><run_min></span> & <span style="color:red"><run_max></span>): |
− | + | ||
− | ccdb add PHOTON_BEAM/RF/time_resolution_sq -r <run_min>-<run_max> rf_time_resolution_sq.txt #"time resolution squared" | + | ccdb add PHOTON_BEAM/RF/time_resolution_sq -v <span style="color:red"><b><variation></b></span> -r <span style="color:red"><b><run_min></b></span>-<span style="color:red"><b><run_max></b></span> rf_time_resolution_sq.txt #"time resolution squared" |
− | + | ||
=== Coarse Time Offsets === | === Coarse Time Offsets === | ||
Line 166: | Line 197: | ||
** Since the RF signal period is <span style="color:red">2.004 ns</span>, you would think that you should just be able to propagate the times to each other (shift by <span style="color:red">N * 2.004 ns</span>) and take the difference. However, this procedure is sensitive to small inaccuracies in the RF signal period since the times can be offset by several micro-seconds. It's better to do a coarse offset first, and use this method for a fine alignment in the next step. | ** Since the RF signal period is <span style="color:red">2.004 ns</span>, you would think that you should just be able to propagate the times to each other (shift by <span style="color:red">N * 2.004 ns</span>) and take the difference. However, this procedure is sensitive to small inaccuracies in the RF signal period since the times can be offset by several micro-seconds. It's better to do a coarse offset first, and use this method for a fine alignment in the next step. | ||
* To determine the coarse time offsets, run the <span style="color:#0000FF">RF_online</span> plugin on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_CoarseTimeOffsets.C</span> macro on the resulting ROOT file: | * To determine the coarse time offsets, run the <span style="color:#0000FF">RF_online</span> plugin on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_CoarseTimeOffsets.C</span> macro on the resulting ROOT file: | ||
+ | ** Below, <span style="color:red"><b>"<run_number>"</b></span> is any run number in the run range in which you are trying to set the constants. The run number is needed to make sure that the new offset values are combined with the appropriate, old offset constants to create new offset values. | ||
− | + | root -l hd_root.root | |
− | root -l hd_root.root | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_CoarseTimeOffsets.C(<span style="color:red"><b><run_number></b></span>, <span style="color:red"><b><variation></b></span>); |
− | . | + | |
− | + | ||
− | </ | + | |
* This should produce histograms similar to the following: | * This should produce histograms similar to the following: | ||
Line 177: | Line 206: | ||
<br style="clear:both;"/> | <br style="clear:both;"/> | ||
− | * It will also print the coarse time offsets for each system to screen. These offsets are automatically combined with the current time offsets in the CCDB to produce new time offsets. These values are printed to screen, as well as to a text file. Check these constants into the database with the following (using the appropriate run numbers for <span style="color:red">run_min</span> & <span style="color:red">run_max</span>): | + | * It will also print the coarse time offsets for each system to screen. These offsets are automatically combined with the current time offsets in the CCDB to produce new time offsets. These values are printed to screen, as well as to a text file. Check these constants into the database with the following (using the appropriate variation <span style="color:red"><variation></span>, and the appropriate for run numbers for <span style="color:red"><run_min></span> & <span style="color:red"><run_max></span>): |
− | + | ||
− | < | + | ccdb add PHOTON_BEAM/RF/time_offset -v <span style="color:red"><b><variation></b></span> -r <span style="color:red"><b><run_min></b></span>-<span style="color:red"><b><run_max></b></span> rf_coarse_time_offsets.txt #"coarse time offsets" |
− | + | ||
− | + | ||
=== Fine Time Offsets === | === Fine Time Offsets === | ||
− | * After performing the coarse time offsets and checking in the constants, fine-grained time offsets can be found by propagating the times from each system to each other by shifting by a multiple of <span style="color:red">2.004 ns</span>. This should produce a Gaussian time-difference distribution between <span style="color:red">+/- | + | * After performing the coarse time offsets and checking in the constants, fine-grained time offsets can be found by propagating the times from each system to each other by shifting by a multiple of <span style="color:red">4.008 ns</span>. Note that the beam period is used instead of the <span style="color:red">2.004 ns</span> RF period. This is to make sure that the times are not offset by <span style="color:red">2.004 ns</span>. This should produce a Gaussian time-difference distribution between <span style="color:red">+/- 2.004 ns</span> that can be fit to produce the final time-offsets. |
* To determine the final time offsets (and their uncertainties), re-run the <span style="color:#0000FF">RF_online</span> plugin (after checking in the coarse time offsets) on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_FineTimeOffsets.C</span> macro on the resulting ROOT file: | * To determine the final time offsets (and their uncertainties), re-run the <span style="color:#0000FF">RF_online</span> plugin (after checking in the coarse time offsets) on a small sample of data (e.g. 10000 events), and then run the <span style="color:#0000FF">RFMacro_FineTimeOffsets.C</span> macro on the resulting ROOT file: | ||
+ | ** Below, <span style="color:red"><b>"<run_number>"</b></span> is any run number in the run range in which you are trying to set the constants. The run number is needed to make sure that the new offset values are combined with the appropriate, old offset constants to create new offset values. | ||
− | + | root -l hd_root.root | |
− | root -l hd_root.root | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_FineTimeOffsets.C(<span style="color:red"><b><run_number></b></span>, <span style="color:red"><b><variation></b></span>); |
− | . | + | |
− | + | ||
− | </ | + | |
− | * This should produce histograms similar to the following, which can be fit to a special function: a sum of two Gaussians with identical heights and widths, and means that are separated by exactly <span style="color:red">1000/499 ns</span>: | + | * This should produce histograms similar to the following (although instead between <span style="color:red">+/- 2.004 ns</span> (the plots are old)), which can be fit to a special function: a sum of two Gaussians with identical heights and widths, and means that are separated by exactly <span style="color:red">1000/499 ns</span>: |
[[Image:RFCalib_FineTimeOffsets.png|thumb|left|900px|Coarse time offsets between RF signals]] | [[Image:RFCalib_FineTimeOffsets.png|thumb|left|900px|Coarse time offsets between RF signals]] | ||
<br style="clear:both;"/> | <br style="clear:both;"/> | ||
− | * The means of this fit are the fine timing offsets, and the mean fit uncertainties are the uncertainties on the offsets. The fit means are automatically combined with the coarse time offsets in the CCDB to produce the final time offsets. These values are printed to screen, as well as to text files. Check these constants into the database with the following (using the appropriate run numbers for <span style="color:red">run_min</span> & <span style="color:red">run_max</span>): | + | * The means of this fit are the fine timing offsets, and the mean fit uncertainties are the uncertainties on the offsets. The fit means are automatically combined with the coarse time offsets in the CCDB to produce the final time offsets. These values are printed to screen, as well as to text files. Check these constants into the database with the following (using the appropriate variation <span style="color:red"><variation></span>, and the appropriate for run numbers for <span style="color:red"><run_min></span> & <span style="color:red"><run_max></span>): |
− | + | ||
− | < | + | ccdb add PHOTON_BEAM/RF/time_offset -v <span style="color:red"><b><variation></b></span> -r <span style="color:red"><b><run_min></b></span>-<span style="color:red"><b><run_max></b></span> rf_fine_time_offsets.txt #"fine time offsets" |
− | + | ccdb add PHOTON_BEAM/RF/time_offset_var -v <span style="color:red"><b><variation></b></span> -r <span style="color:red"><b><run_min></b></span>-<span style="color:red"><b><run_max></b></span> rf_time_offset_vars.txt #"time offset variances" | |
− | ccdb add PHOTON_BEAM/RF/time_offset_var -r <run_min>-<run_max> rf_time_offset_vars.txt #"time offset variances" | + | |
− | + | ||
=== Intra-system Jitter === | === Intra-system Jitter === | ||
Line 219: | Line 242: | ||
<pre> | <pre> | ||
root -l hd_root.root | root -l hd_root.root | ||
− | . | + | .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_TaggerComparison.C |
− | + | ||
</pre> | </pre> | ||
Latest revision as of 14:37, 20 August 2018
Contents
Overview
- The RF signal from the accelerator comes in at a frequency of 499 MHz, regardless of the beam bunch frequency (typically 249.5 MHz). It is multiplexed and read out in 6 different locations; in one channel of each of the following crates:
- F1TDCs: TAGH, FDC, PSC
- CAEN TDCs: TOF
- FADC250s: TAGH, ST
- Since the RF signal has a known frequency, it can be used to test the understanding of the electronics (e.g. resolutions).
- Also, since the RF signal is the highest-resolution time measurement for the event (particularly in the TOF CAEN TDC), it is used as a baseline to help line up the timing offsets of the different detector systems.
- During analysis, detected tracks will "vote" on the beam bunch that caused the event, and then it's time can be used as an event start time for computing particle-ID confidence levels.
- Because the RF signal is periodic it is effectively self-analyzing: it can be compared against itself to study our understanding of the timing. It also serves as a good test of whether the TDC → time conversion is working properly.
- However, the FADC250 algorithms were not designed to extract the pulse times from signals with a waveform of the RF distribution (degraded square-wave, see plot), so these signals are ignored.
Notes / References
- For questions regarding these procedures, please contact Paul Mattione.
- Link to the RF_online plugin and scripts, which contains all of the code needed for these calibrations: Link
- The ROOT macros for studying the data are located in the calib_scripts subfolder in this plugin directory.
- The locations where the rocs/modules/channels the RF signal are hooked up is found in the translation table (TT). Information about the TT can be found at: Link
- A wiki page detailing which ROCs are which can be found at: Link
RF Calibration Constants
- The following calibration constants are in the CCDB for the RF signal:
CCDB Table Name/Path | Description |
---|---|
PHOTON_BEAM/RF/rf_period | The period of time between MO signals on the RF signal cable arriving from the accelerator. |
PHOTON_BEAM/RF/beam_period | The period of time between beam bunches arriving from the accelerator. |
PHOTON_BEAM/RF/time_offset | The time difference between the other RF signals and the TOF RF signal. |
PHOTON_BEAM/RF/time_offset_var | The variance of time_offset. |
PHOTON_BEAM/RF/time_resolution_sq | The square of the resolution of the measurement of the RF signal. |
- Except for rf_period, each entry is a table with 4 columns (TOF, TAGH, PSC, FDC) and 1 row (the values for that constant).
- Since the TOF RF signal has the best resolution, its time_offset and time_offset_var constants should be 0.
Special RF-Test Runs
- The data acquisition can be configured to take a quick, special run for testing all of the procedures in this document. However, "normal" runs can be used instead, since all of the ROCs that the RF signals are hooked up to are typically read out in any "normal" run.
- To setup a quick run, run the data acquisition with:
RUN: EXPERT SETUP: hd_synctest.tsg_noGTP CONFIG: pulser.conf
- You only need a few minutes of data (i.e. 10k - 100k events).
Validating TI-Time Uniformity
- As detailed in GlueX Doc 2686, a copy of the global system clock time is present on each ROC (on the Trigger Interface (TI) board). To check whether they are all consistent with each other, run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_ROCTITimes.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_ROCTITimes.C
- It will print to screen any ROCs whose system clock is out of time with the average system clock times from the other ROCs. It will also draw the corresponding histograms. ROC 1 (the trigger supervisor crate) is known to be out of time with the others, and is currently being looked into by the Triggering expert.
- If any of the other ROCs are out of time with the others, notify the Triggering expert.
- Example plots:
TDC → Time Conversion
- The details of how to convert the F1TDC and CAEN TDC signals to times are in GlueX Doc 2686. These algorithms are implemented by the DTTabUtilities class (in sim-recon/src/libraries/TTAB).
- F1TDCs: The F1TDC times are converted using the ROC TI time as the reference time. The DF1TDCConfig class contains the necessary constants for performing the conversion. If this class is not present in the data stream, the constants in the CCDB are used (Link). Also, the DF1TDCConfig information in the data stream was incorrect for runs <= 2965, so the CCDB constants are used for these runs as well. Otherwise, the CCDB constants should no longer be used.
- CAEN TDCs: The TDC → time conversion constant for the CAEN TDCs was derived by Ben Raydo and is documented in this email. It is 23.4375 +/- 0.0012 ps. This uncertainty is small enough that a channel-by-channel pulser measurement of the TDC → time conversion constant is unnecessary.
- As mentioned in the GlueX timing document (GlueX Doc 2686), the 6-fold-ambiguity CCDB constant (/TOF/tdc_shift) has been fixed. It is fixed to a constant value of 0, and should not need to be changed.
- This can be checked by running the TOF_TDC_shift plugin on EVIO data.
- As mentioned in the GlueX timing document (GlueX Doc 2686), the 6-fold-ambiguity CCDB constant (/TOF/tdc_shift) has been fixed. It is fixed to a constant value of 0, and should not need to be changed.
RF Signal Pre-Scaling
- The RF signal has a frequency of 499 MHz, which is far too frequent for the electronics readout: If it tries to record at that rate it will overflow the buffer.
- So, the RF signals are pre-scaled down by large multipliers so that there are only a few signals recorded for each channel in the readout window.
- This pre-scaling is typically between 1/64 and 1/512, inclusive.
- E.g. if the TOF signal was read out 1/128 times, the time difference between TOF RF signals should be at 128*1000/499 = 256.513 ns.
- The pre-scale factors can be modified through the EPICS GUIs. From the main menu, press the "Master Oscillator / RF" button in the "Beam" section.
- Then change the value in the "Prescale Setpoint" field to change the prescale factor. The value should typically be somewhere between 64 - 512.
- If you cannot set it to the desired value, it may be that the separate, board prescale value is not high enough. Click on the "MO Boards" link to open the page the board, and change the board prescale value. This is because there are 2 separate multipliers: one for the board, and one for the channel, which are combined together to give the "Prescale Readback" value that you are entering. Changing the "Prescale Setpoint" changes the channel multiplier to achieve the desired total prescale factor.
- Then change the value in the "Prescale Setpoint" field to change the prescale factor. The value should typically be somewhere between 64 - 512.
Validation
- Since they are periodic, the RF time signals are excellent for checking whether the TDC signals are being properly converted to time. To check this, run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_TDCConversion.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_TDCConversion.C
- This macro will draw histograms for each detector system of the time difference between the first RF signal in an event and the times of the subsequent RF signals. Zoom in on these histograms and confirm that the secondary peaks are occurring at the correct times.
- The pre-scale factor is not recorded, nor does it's value matter, as long as you several sharp spikes at fixed intervals with no sidebands.
- If the RF signals don't arrive at their expected times, reset the prescale factors for the RF signals. Do this by pulling up the prescale factor GUI window as detailed in the Pre-Scaling section above, then click on the "MO Boards" button. Select the desired board (Tagger/Hall), then press the "RESET TO DEFAULTS" button. Close the window, and then re-set the desired pre-scale factors. If you are still experiencing issues, notify the online and/or electronics experts.
- Example plots:
Timing Consistency
- The consistency of the timing within each detector can be checked by using the RF signal. This is done by comparing the time difference between the first-arriving signal and subsequent signals, the second-arriving signal and subsequent signals, etc. These distributions are then lined up near zero by shifting them by ~2.004 ns * Prescale factor * delta_N (e.g. when comparing 1st signal and 4th signal, delta_N is 3). The means, sigmas, skewness, and kurtosis of these distributions can be studied to see if there are any anomalies in the TDC -> time conversion.
- To study these distributions, run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_InternalDeltaTs.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_InternalDeltaTs.C
- This should produce histograms similar to the following:
- If you notice any behavior that is anomalous (e.g. highly-skewed distributions), notify the electronics group.
RF Time Calibration
RF Signal Period
- Because the RF signal is being recorded several times in each channel for each event, the frequency of the RF signal can be determined by comparing these times to each other. It should be about 499 MHz.
- Note that this is not the same as the beam bunch frequency, which is typically 249.5 MHz.
- Remember, as discussed in the section on TDC → Time Conversion, that the signals are read out at a reduced rate.
- To confirm that the RF signal is arriving approximately every 2.004 ns (499 MHz), run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_SignalPeriod.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_SignalPeriod.C
- This should produce histograms similar to the following, showing the 2.004 ns signal period:
- If the signal period is not 2.004 ns, notify the electronics expert.
Beam Bunch Period
- At the beginning of each run period, the beam bunch period needs to be determined. It will typically be 4.008 ns (249.5 MHz), but can sometimes be other values (e.g. 2.004 ns (499 MHz) during Fall 2014 data).
- Remember, the period of the beam bunches is not necessarily the same as the period of the RF signal.
- To determine the beam period, run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_BeamBunchPeriod.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_BeamBunchPeriod.C
- This will produce a histogram showing the time difference between different tagger hits in the same counter within the same event. It should look similar to the following, where the time difference between the peaks indicates the period of the beam bunches (here 4.008 ns):
- The resolution of the tagger times is not good enough to determine the actual frequency from this histogram. Instead, compare the difference between the peaks to the expected value of the beam period (here, 249.5 MHz = 4.008 ns).
- If the beam bunch period has changed, create a new, single-line text file (e.g. beam_period.txt) containing one number, the value of the new beam bunch period:
4.008016032
- Then check the new constant into the database with the following (using the appropriate variation <variation>, and the appropriate for run numbers for <run_min> & <run_max>):
ccdb add PHOTON_BEAM/RF/beam_period -v <variation> -r <run_min>-<run_max> beam_period.txt #"Beam bunch period"
RF Time Resolution
- To study the resolution of the RF time signal, the RF signal can be compared to itself, since the frequency of the signal is known. The difference between the first two RF signals in a given event can be shifted by a multiple of 2.004 ns such that the difference lines up near zero. Doing this for many events gives the resolution of the RF signal measurement.
- This resolution is dominated by the resolution of the readout electronics modules (F1TDCs, CAEN TDCs).
- To do this, run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_SelfResolution.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_SelfResolution.C
- It should produce plots similar to the following:
- If these distributions are malformed, then it is likely that the TDC -> time conversion is incorrect. Revisit that step.
- It will also print the time-resolution-squared for each system to screen and to a text file. Check these constants into the database with the following (using the appropriate variation <variation>, and the appropriate for run numbers for <run_min> & <run_max>):
ccdb add PHOTON_BEAM/RF/time_resolution_sq -v <variation> -r <run_min>-<run_max> rf_time_resolution_sq.txt #"time resolution squared"
Coarse Time Offsets
- The timing offsets between the different RF signals can be quite large (on the order of several micro-seconds). Thus the timing offset calibration is separated into two steps: A course alignment and a fine alignment.
- Since the RF signal period is 2.004 ns, you would think that you should just be able to propagate the times to each other (shift by N * 2.004 ns) and take the difference. However, this procedure is sensitive to small inaccuracies in the RF signal period since the times can be offset by several micro-seconds. It's better to do a coarse offset first, and use this method for a fine alignment in the next step.
- To determine the coarse time offsets, run the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_CoarseTimeOffsets.C macro on the resulting ROOT file:
- Below, "<run_number>" is any run number in the run range in which you are trying to set the constants. The run number is needed to make sure that the new offset values are combined with the appropriate, old offset constants to create new offset values.
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_CoarseTimeOffsets.C(<run_number>, <variation>);
- This should produce histograms similar to the following:
- It will also print the coarse time offsets for each system to screen. These offsets are automatically combined with the current time offsets in the CCDB to produce new time offsets. These values are printed to screen, as well as to a text file. Check these constants into the database with the following (using the appropriate variation <variation>, and the appropriate for run numbers for <run_min> & <run_max>):
ccdb add PHOTON_BEAM/RF/time_offset -v <variation> -r <run_min>-<run_max> rf_coarse_time_offsets.txt #"coarse time offsets"
Fine Time Offsets
- After performing the coarse time offsets and checking in the constants, fine-grained time offsets can be found by propagating the times from each system to each other by shifting by a multiple of 4.008 ns. Note that the beam period is used instead of the 2.004 ns RF period. This is to make sure that the times are not offset by 2.004 ns. This should produce a Gaussian time-difference distribution between +/- 2.004 ns that can be fit to produce the final time-offsets.
- To determine the final time offsets (and their uncertainties), re-run the RF_online plugin (after checking in the coarse time offsets) on a small sample of data (e.g. 10000 events), and then run the RFMacro_FineTimeOffsets.C macro on the resulting ROOT file:
- Below, "<run_number>" is any run number in the run range in which you are trying to set the constants. The run number is needed to make sure that the new offset values are combined with the appropriate, old offset constants to create new offset values.
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_FineTimeOffsets.C(<run_number>, <variation>);
- This should produce histograms similar to the following (although instead between +/- 2.004 ns (the plots are old)), which can be fit to a special function: a sum of two Gaussians with identical heights and widths, and means that are separated by exactly 1000/499 ns:
- The means of this fit are the fine timing offsets, and the mean fit uncertainties are the uncertainties on the offsets. The fit means are automatically combined with the coarse time offsets in the CCDB to produce the final time offsets. These values are printed to screen, as well as to text files. Check these constants into the database with the following (using the appropriate variation <variation>, and the appropriate for run numbers for <run_min> & <run_max>):
ccdb add PHOTON_BEAM/RF/time_offset -v <variation> -r <run_min>-<run_max> rf_fine_time_offsets.txt #"fine time offsets" ccdb add PHOTON_BEAM/RF/time_offset_var -v <variation> -r <run_min>-<run_max> rf_time_offset_vars.txt #"time offset variances"
Intra-system Jitter
- As seen in the Fine Time Offsets section, the resolution of the time-difference histograms is much larger than you would naively expect from the time resolutions of the individual channels determined in the RF Time Resolution section. This increased uncertainty due to the jitter between the systems means that when reporting the RF time for the event, only a single source should be used.
- Since the TOF RF signal has higher resolution than the other systems, it is used when reporting the RF time during reconstruction (the DRFTime object). If for some reason no signal is present for this channel, the data from the other systems are used, in order of increasing time resolution.
- When reporting an official value for the DRFTime, the average of the RF times from the best system is used. Of course it is not a straight average, but rather, the later times are propagated back to the first time (via multiples of 2.004 ns), and then averaged. This gives a better resolution than just using the first recorded time.
- Log Entry 3342826 has a naive interpretation of the measured widths.
Check Alignment to Tagger Hodoscope
- After the timing offsets for the tagger hodoscope have been determined (by the HLDetectorTiming plugin), the matching between the RF times and the tagger hodoscope can be confirmed by running the RF_online plugin on a small sample of data (e.g. 10000 events), and then run the RFMacro_TaggerComparison.C macro on the resulting ROOT file:
root -l hd_root.root .x $HALLD_RECON_HOME/src/plugins/monitoring/RF_online/calib_scripts/RFMacro_TaggerComparison.C
- This will produce a histogram for each RF source showing the time difference between them and the tagger. If these are not lined up with zero, re-run the HLDetectorTiming plugin to line up the tagger with the RF.
MO Phase Drift
- A note detailing the phase drift of the master oscillator that supplies the RF signal can be found in Log Entry 3340814.
- At the moment the phase drift is small and introduces a negligible uncertainty in the RF time offsets as a function of time. However, it should be monitored to see whether it gets worse and needs to be corrected for. These EPICs variables should be written to the data stream.