30. FADC    Appendix

This appendix contains a few extra figures about the FADC signals. Sec. 30.1 contains additional figures – similar to fig. 71 used in the main thesis – about the distribution of rise and fall times. Sec. 30.2 contains more specifics related to the FADC veto. In the context of the FADC veto in the main body the expected cluster size is mentioned, which is supported by a figure in sec. 30.4.

30.1. FADC rise and fall time

These figures show a few extra figures of the FADC signal rise and fall times comparing the \cefe calibration data with background data, for Run-2 and Run-3 of the CAST data taking campaign. In the Run-2 figures more variation is visible, due to the different FADC amplifier settings. These are similar (and include) fig. 71 shown in the main body. See in particular figures 5 and 6 for the impact of the rise and fall time based on the different settings. The fall time figures show that the difference between signal and background is not very pronounced. This is expected, as the fall times are dominated by the resistor-capacitor behavior of the circuit.

fadc_riseTime_kde_signal_vs_background_run2.svg
Figure 1: Figure 181: KDE of the rise time of the FADC signals in the \cefe and background data of the CAST Run-2 dataset. The X-ray data is a single peak with a mean of about \(\SI{70}{ns}\) while the background distribution is extremely wide, motivating a veto based on this data.
fadc_riseTime_kde_signal_vs_background_run3.svg
Figure 2: Figure 182: KDE of the rise time of the FADC signals in the \cefe and background data of the CAST Run-3 dataset. The X-ray data is a single peak with a mean of about \(\SI{55}{ns}\) while the background distribution is extremely wide, motivating a veto based on this data.
fadc_fallTime_kde_signal_vs_background_run2.svg
Figure 3: Figure 183: KDE of the rise time of the FADC signals in the \cefe and background data of the CAST Run-2 dataset. Difference in the two signal types is negligible. Multi-peak structure is due to different FADC settings, see fig. 5.
fadc_fallTime_kde_signal_vs_background_run3.svg
Figure 4: Figure 184: KDE of the fall time of the FADC signals in the \cefe and background data of the CAST Run-3 dataset. Difference in the two signal types is negligible.
fadc_riseTime_kde_signal_vs_background_different_fadc_amp_settings_run2.svg
Figure 5: Figure 185: KDE of the rise time of the FADC signals in the \cefe data of Run-2 split by the different FADC settings.
fadc_fallTime_kde_signal_vs_background_different_fadc_amp_settings_run2.svg
Figure 6: Figure 186: KDE of the fall time of the FADC signals in the \cefe data of Run-2 split by the different FADC settings. Impact on the fall time is more pronounced than on the rise time above.

\clearpage

30.1.1. Generate plots for signal and background comparison    extended

These plots are generated using plotFadc in sec. 12.5.2.6.

30.2. FADC veto

Only briefly mentioned in sec. 12.5.2 is the addition of a cut on the skewness of the FADC signal, namely a skewness \(< -0.4\). Fig. 7 shows the FADC signal rise times of all events in Run-2 and fig. 8 for Run-3 against the skewness of the signal (i.e. a measure of how one sided the signal is due to the negative from baseline shape of a single FADC pulse). The color scale indicates whether the event is considered 'noisy' by our noise filter.

We can see the majority of all noise events above skewness values of \(\geq 0.4\), roughly. There are pockets of non-noisy events above this skewness value, in particular rise times of \(\numrange{180}{210}\) and skewness \(\numrange{-0.7}{0.3}\) in Run-2. Events in this range were inspected by eye (see extended thesis). They contain other noisy events not registered by the noise filter and certain types of multi cluster events resulting in peculiar shapes.

Finally, fig. 9 shows the achievable signal efficiencies against background suppression as a function of the rise time. In this case only the upper range is cut (in practice the cut is symmetric on lower and upper end). This illustrates the efficiency of the FADC veto without any additional detector parts. At our used \(\SI{99}{\%}\) upper range cut the background is suppressed to about \(\SI{60}{\%}\) of the full background in the energy range of the \cefe photopeak.

fadc_risetime_skewness_run2.svg
Figure 7: Figure 187: Scatter plot of all FADC events in Run-2 of the rise time of each event against the skewness. Colorcoded is whether each event is considered noisy by our noise filter.
fadc_risetime_skewness_run3.svg
Figure 8: Figure 188: Scatter plot of all FADC events in Run-3 of the rise time of each event against the skewness. Colorcoded is whether each event is considered noisy by our noise filter.
fadc_rise_time_efficiencies_run3.svg
Figure 9: Figure 189: Signal efficency achievable using only the FADC veto for \cefe calibration data by cutting on the rise time (only the upper end) compared to the corresponding background suppression (for Run-3 data).

\clearpage

30.3. Generate plot of rise time vs skewness    extended

The code here originates from: ./../org/Doc/StatusAndProgress.html

That section also contains the commands and studies of the aforementioned regions of non noisy events in 'larger than veto' skewness values at low rise times.

import nimhdf5, ggplotnim
import std / [strutils, os, sequtils, stats, strformat]
import ingrid / [tos_helpers, fadc_helpers, ingrid_types, fadc_analysis]

proc getFadcSkewness(h5f: H5File, run: int): DataFrame =
  let fadcRun = readRecoFadcRun(h5f, run)
  let recoFadc = readRecoFadc(h5f, run)
  let num = fadcRun.eventNumber.len
  var skews = newSeqOfCap[float](num)
  for idx in 0 ..< fadcRun.eventNumber.len:
    skews.add fadcRun.fadcData[idx, _].squeeze.toSeq1D.skewness()
  result = toDf({skews, "riseTime" : recoFadc.riseTime.asType(float), "noisy" : recoFadc.noisy})
  echo result

proc main(fname: string,
          outpath = "/tmp/",
          suffix = "") =
  let tmpFile = "/tmp/" & fname.extractFilename.replace(".h5", ".csv")
  var df = newDataFrame()
  if not fileExists tmpFile:
    var h5f = H5open(fname, "r")
    let fileInfo = h5f.getFileInfo()
    var dfs = newSeq[DataFrame]()
    for run in fileInfo.runs:
      echo "Run = ", run
      let fadcGroup = fadcRecoPath(run)
      if fadcGroup in h5f: # there were some runs at end of data taking without any FADC (298, 299)
        dfs.add h5f.getFadcSkewness(run)
    df = assignStack(dfs)
    df.writeCsv(tmpFile)
  else:
    df = readCsv(tmpFile)
  echo df
  df = df.mutate(f{int -> bool: "noisy" ~ (if `noisy` == 0: false else: true)})
  
  ggplot(df, aes("skews")) +
    geom_density() +
    ggsave(&"{outpath}/fadc_skewness_kde_{suffix}.pdf")

  ggplot(df, aes("skews", "riseTime", color = "noisy")) +
    #geom_point(size = 1.0, alpha = 0.2) +
    geom_point(size = 0.5, alpha = 0.75) +
    xlab("Skewness") + ylab("riseTime [ns]") + 
    themeLatex(fWidth = 0.9, width = 600, baseTheme = singlePlot) + 
    ggsave(&"{outpath}/fadc_risetime_skewness_{suffix}.pdf", dataAsBitmap = true)
    
when isMainModule:
  import cligen
  dispatch main

Run-2:

WRITE_PLOT_CSV=true \
    ./fadc_data_skewness \
    -f ~/CastData/data/DataRuns2017_Reco.h5 \
    --outpath ~/phd/Figs/FADC/ \
    --suffix "run2"

and for sanity, Run-3:

WRITE_PLOT_CSV=true \
    ./fadc_data_skewness \
    -f ~/CastData/data/DataRuns2018_Reco.h5 \
    --outpath ~/phd/Figs/FADC/ \
    --suffix "run3"

30.4. Expected cluster size

While not strictly speaking FADC data, the expected size of clusters was mentioned in sec. 12.5.2 to be about \(\SI{6}{mm}\) in length for \cefe calibration data. This is shown in fig. 10.

length_run83_187_chip3_0.04833333333333333_binSize_binRange-0.0_14.5_region_crSilver_rmsTransverse_0.1_1.1_applyAll_true.svg
Figure 10: Figure 190: Cluster lengths in millimeter of \cefe calibration data during the Run-2 data taking campaign. These \(\SI{5.9}{keV}\) clusters peak at around \(\SI{5.5}{mm}\) in length with significant drop in statistics from \(\SI{6}{mm}\).

30.4.1. Generate cluster length plot    extended

WRITE_PLOT_CSV=true LINE_BREAK=true T_MARGIN=1.75 USE_TEX=true WIDTH=600 HEIGHT=420 \
   plotData --h5file ~/CastData/data/CalibrationRuns2017_Reco.h5 \
            --runType rtCalibration \
            --chips 3 \
            --config ~/CastData/ExternCode/TimepixAnalysis/Plotting/karaPlot/config.toml \
            --ingrid \
            --cuts '("rmsTransverse", 0.1, 1.1)' \
            --applyAllCuts \
            --region crSilver \
            --plotPath ~/phd/Figs/expectedClusterSize/
Click on any heading marked 'extended' to open it