User Tools


This is an old revision of the document!


Available Code

The latest version of the code is available here:

http://www.phys.hawaii.edu/~kurtisn/software/2013-06-03_conversion_code.tar.gz

The following is the general procedure to produce summary ROOT files. It is a number of steps, but each major step can usually be automated with simple scripts.

  1. Produce pedestal files:
    1. Use “ConvertToRootNoAuxDataMultiScrod <SCROD ID> <input raw data file> <output ROOT file>”
      1. For output files, I usually use the scheme of keeping the original raw data file name, dropping the extension, and naming the output <original_base_name>.scrodXX.root (where XX is the SCROD ID that you're converting over).
    2. Use “CalculatePedestals <input root file> <output pedestal file>” to create a pedestal file for all required SCRODs.
      1. For pedestal files, I usually replace .root with .ped
  2. Convert data files for runs of interest:
    1. To convert SCROD data, again use “ConvertToRootNoAuxDataMultiScrod <SCROD ID> <input raw data file> <output ROOT file> <pedestal file>”
      1. I use the same convention as before, changing the .dat to .scrodXX.root
      2. Unlike the usual case with pedestals, in this case the same raw data file has data for all SCRODs, so you may have to run over it 4 times to do a full conversion for all modules.
    2. To convert CAMAC data, use “ConvertCamacToROOT <input file> <output ”
      1. I use the convention for output file names of calling them <original_base_name>.cmc.root.
      2. Depending on the CAMAC configuration, you may need to change the crate setup in src/lib/CamacStructure.cpp (see lines 89-113)

Your next steps will depend on what you're trying to do. I suggest below some things that I often do.

Visual Waveform Checks

If you want to look over a few waveforms by eye to see if they look reasonable, do the following:

In ROOT, open the file produced with ConvertToRootNoAuxDataMultiScrod with a command like:

TFile *f1 = new TFile(“<filename>.root”)

Load the script:

.L scripts/DrawWaveform4Segments.C+

Then:

DrawAll()

And press enter to cycle through waveforms. You can also edit the script to insert some cuts to only look at waveforms from a channel you're interested in, or satisfying some selection that you'd like to see.

Timing Calibration Resolution Studies

The following are the best known procedures for performing timing calibration using the pulser, and performing MCP-PMT timing measurements. The parameters of these procedures have only been roughly scanned, so further improvements are almost certainly possible. If you find something that works better, let me know!

Current Best Calibration Procedure

Current Best MCP-PMT Timing Procedure

Produce Feature Extracted ROOT Trees

To do TOP analysis, the waveform is often superfluous information. You may rather just have an estimate of a hit and a pulse height for each photon candidate. The following is a way to produce such files:

  1. Use the code scripts/ConvertFullEvents.C :
    1. .x scripts/ConvertFullEvents.C+(“<input_base_file_name_up_to_first_dot>”,“<output ROOT file>”)

The output file will have just the summary data, no waveforms. It is convenient for plotting tdc:ch distributions, etc. If you want to look at multiple such files, make many of them and then chain them together using TChain.

For further analysis, here are the branch names and types (see TTree documentation):

  • “evt/i” (32-bit unsigned integer) - Event number, as written into the data stream. The conversion code requires that all modules + CAMAC agree on an event number to write it to the summary output file.
  • “nhits/i” (32-bit unsigned integer) - Number of regions of interest passing the loose criteria in ConvertFullEvents.C.
  • “raw_mod[nhits]/s” (16-bit unsigned integer) - electronics module number (0-3) corresponding to each hit
  • “raw_scrod[nhits]/i” (32-bit unsigned integer) - SCROD ID of the module corresponding to each hit
  • “raw_row[nhits]/s” (16-bit unsigned integer) - electronics row (0-3) corresponding to each hit
  • “raw_col[nhits]/s” (16-bit unsigned integer) - electronics col (0-3) corresponding to each hit
  • “raw_ch[nhits]/s” (16-bit unsigned integer) - electronics ASIC ch (0-7) corresponding to each hit
  • “hit_pmt[nhits]/s” (16-bit unsigned integer) - PMT # in the Belle II scheme
  • “hit_pmt_ch[nhits]/s” (16-bit unsigned integer) - channel # within a PMT in the Belle II scheme
  • “hit_ch[nhits]/s” (16-bit unsigned integer) - flattened channel number, increasing by column, then by row. So first 64 channels correspond to innermost row, next 64 to the second to innermost row, …, last 64 to the outermost row.
  • “hit_tdc[nhits]/F” (32-bit floating point) - extracted time for this hit (uses CFD in posted version). Includes the coarse time correction based on windows/reference window as well as the time correction for the FTSW trigger phase.
  • “hit_tdc_fwd[nhits]/F” (32-bit floating point) - time defined by first zero crossing after the peak. From previous studies, this is not a very high precision measurement of the pulse time, but the distance between hit_tdc and this time give some information about the pulse shape which may be useful in rejecting some non-pulses.
  • “hit_tdc_samp[nhits]/F” (32-bit floating point) - sample within the 128-samples of the ASIC sampling array corresponding to the location where the hit_tdc was found. May be used to check quality of timing calibration or develop secondary calibrations to remove residual structures.
  • “hit_adc[nhits]/F” (32-bit floating point) - Peak ADC value found in the waveform. Found by a simple search of the array.
  • “ftsw_phase/F” (32-bit floating point) - FTSW trigger phase from the CAMAC system, converted to ns already. This is corrected out as part of the hit_tdc calculation, but may be interesting to look at either for residual structures or for identifying race conditions on the trigger that may cause timing slips by a full sampling period (47 ns).

Other CAMAC quantities can and should be added as we know what they correspond to.


Top