BetaTest


Hardware Setup

Analysis Macros

The following are C++ macros that, once downloaded, can be run with ROOT on the output files from the SCTDAQ software, i.e. the output files from 3PointGain, TrimRange etc or Threshold and Latency scans run using the Prague group's macro.

ExternalTrigger _BetaSource_ATLYS_daqload.cpp (from Prague)

Function: ExternalTrigger _BetaSource_ATLYS_daqload(void)

Outputs:

  • A .root file with either threshold or latency scan data depending on which lines are commented
Usage:
  1. Open ROOT
  2. Load the file with the parameters as desired, descriptions of which are in the notes below
Notes:
  • You must edit the macro to change: latency (variable 1004), threshold (var. 1), the bounds of the scan (from what latency/threshold to what latency/threshold), step size, trigger number and compression mode (var. 11)
  • One decides whether to run a latency or threshold scan at the end of the macro.

merge_thresholds.cpp

Function: merge_thresholds(string inDirectory = "Desktop/Data", TString outFile = "Desktop/output.root")

Inputs:

  • inDirectory - Location on your computer containing many threshold scans/runs that need to be merged into one file.
  • outFile - The location and name of an output file for
Outputs:
  • A .root file just like the ones in the inDirectory that come from a threshold scan except with data from all the merged scans/runs
Usage:
  1. Open ROOT
  2. Load the file with the parameters for inDirectory and outFile as desired. For example, to merge all files in the folder "Scans/ThresholdScans07_08_2018" into "combined07_08_2018.root":
 merge_thresholds("Scans/ThresholdScans07_08_2018", "combined07_08_2018.root")

Notes:

  • This macro is meant to merge threshold plots that are output as .root files from the ExternalTrigger _BetaSource_ATLYS_daqload.cpp macro
  • There should NOT be a / after the directory in 'inDirectory'. For example, use "Desktop/Data", NOT "Desktop/Data/"
  • list_files() will try reading all .root files in the 'inDirectory' for the appropriate data, so only keep the .root files you want to merge together in that folder
  • If you want to merge a specific list of files manually, then add the list of file names to strFileList and comment out the following block:
    list_files(&inDirectory[0], strFileList); for(int i = 0; i < strFileList.size(); i++){ strFileList[i] = inDirectory + "/" + strFileList[i]; }

threshold_plots.cpp

Functions: threshold_plots(TString strFileName, TString strBias = "-400V", TString strTriggers = "10k", TString strLatency = "17", TString strSaveName = "-1",)

Inputs:

  • strFileName - Location on computer containing the threshold file
  • strBias - Adds a string to the threshold plot with the correct value
  • strTriggers - Adds a string to the threshold plot with the correct value
  • strLatency - Adds a string to the threshold plot with the correct value
  • strSaveName - The location and name of the output file. Leave as '-1' and it will not save
  • Currently need to manually edit the save locations at the end of the macro or rewrite the macro
Outputs:
  • A 2D histogram, with channels on on the x-axis (channel = strip on silicon), and the threshold being scanned at on the y-axis. The colour at that point is the number of hits corresponds to the number of hits in that channel at that given threshold.
  • A 3D version of the histogram, with colour (hits) being represented by a change in height
  • Projection along the channels, so channels are one axis and all thresholds are merged. Perhaps useful for finding excessively noisy channels, however, a noise scan would be better for this
  • Projection along the threshold, so all channels are merged. Tells the number of hits in all strips as a function of threshold, useful for visualizing when noise becomes less relevant in the detector
Usage:
  1. Open ROOT
  2. Manually edit the save locations at the end of the macro
  3. Load the file with the parameters as desired
 threshold_plots("Scans/ThresholdScan_111_111_101.root", "-250V", "100k", "16ns", "ThresholdScanOutput")

Notes:

  • Should probably just make the information, like voltage, triggers, latency, etc, not have to be input in the function call
  • Note, that it autosaves to locations like: Exports/ThresholdMerged/2d_threshold_" + strSaveName + ".png this should be altered to the users preferred location, or perhaps recoded so it just saves to the right location without having to re-write the macro each time
  • This is meant to be used with the .root files output by the ExternalTrigger _BetaSource_ATLYS_daqload.cpp macro

noise_plots.cpp

Functions: noise_plots(TString strSaveName = "-1")

Inputs:

  • strSaveName - The location and name of the output file. Leave as '-1' and it will not save
  • Currently need to manually edit the save locations at the end of the macro or rewrite the macro
  • Must enter the locations and names of the files to be read and plotted, which should be .txt files output by a 3 point gain test
Outputs:
  • .png and .eps files of input noise can be saved or just displayed, as well as a projection of the total noise between runs on a different canvas if desired
Usage:
  1. Open ROOT
  2. Manually add files from 3PtGain test to check the noise of, for example:
    strFileList.push_back("Dropbox/Data/ABC130CoincidenceLabviewResults/ABC130_R0H1_daqload_08s_RC_344_1.txt");
  3. Manually edit the save locations at the end of the macro
Notes:

L0ID _BCID.cpp

Functions: L0ID _BCID(string inDirectory = "Desktop/Data", TString outFile = "Desktop/output.root")

Inputs:

  • inDirectory - Location on your computer containing many .dat files from a ThresholdScan
  • outFile - The location and name of an output file for
Outputs:
  • Plots of L0ID and BCID for a scan
Usage:
  1. Open ROOT
  2. Load the file with the parameters for inDirectory and outFile as desired
Notes:
  • Use more than one .dat as it appears the first one doesn't always load, e.x. use .dat files from, say, 5 different scans
  • A healthy L0ID is one that is 256-cyclic, that is, it looks like a sawtooth resetting at 256
  • A healthy BCID looks like completely random noise

latency_overlay.cpp

Functions: latency_overlay(TString strTriggers = "10k", TString strThr = "80V", TString strSaveName = "-1")

Inputs:

  • strTriggers - Number of triggers all the latency scans were run at (assumes they're constant)
  • strThr - Threshold that all the latency scans were run at (also assumes it's constant)
  • strSaveName - What to save the file as, '-1' means do not save
Outputs:
  • A graph with all of the different latency scan results overlaid on top of each other
  • Only the projections along the Y from the latency scans, that is, the X axis is the latency in BCO, and the Y axis is the number of hits
Usage:
  1. Open ROOT
  2. Manually add files from the latency scan to compare:
    strFileList.push_back("Dropbox/Data/ABC130CoincidenceLabviewResults/strun355_1.root"); strFileList.push_back("Dropbox/Data/ABC130CoincidenceLabviewResults/strun304_1.root");
  3. Manually add notes to distinguish what's different between the scans, so in this example, it's compression mode, in other examples, it may be the bias voltage:
    strBiasList.push_back("Comp XXX"); strBiasList.push_back("Comp 01X");
  4. Manually edit the save locations at the end of the macro
Notes:
  • Uncomment the lines that say 'Normalize histogram' to produced normalized histograms, this is important for differing bias voltages where the efficiency changes

cluster_string_removal.cpp

Functions: cluster_string_removal(string inDirectory = "Desktop/Data", TString outFile = "Desktop/Data/output.out")

Inputs:

  • inDirectory - list of .dat files from a Threshold Scan
  • outFile - Location of the .out file
Outputs:
  • A large .out file that will have only the '6 Lo' lines
Usage:
  1. Open ROOT
  2. Load the file with the parameters for inDirectory and outFile as desired
Notes:
  • Marks the lines in the .out file with R, S, or T, based on the Run number of the threshold scan, Scan number of the threshold scan, and voltage Threshold that the lines came from
  • May take a while (on order of minutes for a couple hundred 10k scans)

cluster_study.cpp

Functions: cluster_study(TString inFile = "Desktop/SampleData/output.out", TString strSaveName = "-1")

Inputs:

  • inFile - the .out file from the cluster_string_removal.cpp
  • strSaveName - The location and name of the output file. Leave as '-1' and it will not save
Outputs:
  • A 2D histogram that shows the threshold voltage on the x-axis, and a clustersize on the y-axis. The Z axis is the number of occurences of clusters of that size at that voltage. The number of occurences of consecutive 1s in the input file is a cluster. For example, if a line looks like 00010001000001111000010000111110001111000 then there are: Three clusters of size 1. 2 clusters of size 4. One cluster of size 5.
Usage:
  1. Open ROOT
  2. Load the file with the parameters for inFile and strSaveName as desired by COMPILING the code or it will take a very long time. To do this, just add a + at the end:
    cluster_study("Data/Cluster_string_removal.out", TString strSaveName = "My2DHistogram")
Notes:
  • Run in compiled mode or it will be extremely slow
  • Very interesting ROOT bug where it, for some reason, puts hits where they aren't. For example, it may say there is 1 occurence of a cluster of size 125 at the threshold 56mV, which is ridiculous even for 100k triggers. This leaves a single dot somewhere on the histogram where it doesn't reasonably make sense to be. This is a ROOT bug that has to do with the way data is moved in memory. Should maybe be reported through ROOT's JIRA bug reporting...

cluster_projection.cpp

Functions: cluster_projection(TString inFile, TString strSaveName = "-1")

Inputs:

  • inFile - the .root file from the cluster_study.cpp
  • strSaveName - The location and name of the output file. Leave as '-1' and it will not save
Outputs:
  • A 1D histogram, where the x-axis is threshold, and the y axis shows the average clustersize at that threshold
Usage:
  1. Open ROOT
  2. Load the file with the parameters for inFile and strSaveName as desired
Notes:
  • Should be barely higher than 1 in high voltages
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2016-08-16 - JustinKulp
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback