Analysis Scripts

From SBS wiki
Jump to: navigation, search

<<SBS Main<< HOW TOs (BigBite Spectrometer)

HCal Analysis Scripts

This page compiles some of the more commonly used HCal analysis scripts. These are primarily used by the HCal experts, but they may be of use to shift crews during events like checking signal centering after DAQ changes, long downs, or kinematic changes.

Event-by-Event Display

This is one of the more generally useful scripts for checking the quality of HCal data. It displays the fADC waveform for each of the 288 modules on an event-by-event basis. This allows the user to check if the signal is well centered in the fADC window or if there are distortions to that signal. The display has four tabs, one for each of the four HCal subassemblies starting at the top of HCal. When the waveform is blue there was no TDC signal detected and when it is green there was a TDC signal.

  • This script can be found on a-onl@aonl1 in the /adaqfs/home/a-onl/sbs/HCal_replay/hcal/displays directory.
  • The script is executed by entering the following in the terminal:
 root -l display_v2.C\(Run#\)
  • The run must have been replayed using one of the HCal expert replays as it requires the fADC samples in the tree.

Signal Centering Script

The signal centering script is used to check where the peak of the signals coincident with BB appear in the fADC window. Currently the fADC window is 160 ns so centering the signal at ~60 ns is ideal. The script outputs a rootfile with a histogram called 'ADC time over all channels' which shows a plot of the average ADC times for all 288 modules. There is a cut on 0 time events and a cut to check for BB coincidence. There should be a peak somewhere in the ADC time showing where most of the coincident events occur in the window, and this peak is roughly where the signals are centered (aim for ~60 ns).

  • This script can be found on a-onl@aonl1 in the /adaqfs/home/a-onl/sbs/HCal_replay/hcal/signal_centering directory.
  • The script is executed by entering the following in the terminal:
 root -b 'hcal_signal_centering.C(Run#)'
  • The run must have been replayed using one of the HCal expert replays.
  • The output rootfile can be found in the /adaqfs/home/a-onl/sbs/HCal_replay/hcal/signal_centering/outfiles directory as SignalCentering_Run#_v2.root.

Energy Calibration Script (Expert only)

The energy calibration script is used to determine the adc gain coefficients for all 288 channels in HCal. This is accomplished by mapping the energy projected to HCal as determined from tracks in BigBite to the ADC signal from clusters in HCal per event. This mapping is via a chi-squared minimization scheme of systems of equations which account for the total energy of a single projected hadron into several channels in HCal per event. To run the script:

  • Configure sHCalECal_GEn.cfg
    • Data should be from several LH2 runs with substantial elastic yield (zero field or 30% field with HCal at 17 m is advised)
    • All experimental parameters are described in this .cfg file
  • Run calibration script
    • root -l HCalECal.C
  • Output gain coefficients are output to terminal. Copy them and paste them into the following HCal database file:
    • $DB_DIR/db_sbs.hcal.dat
      • Where possible, observe the proper pull request procedure to ensure version and quality control
      • Where possible, use timestamps to preserve previous database gain coefficients