wavecatcher-analysis
|
#include <ReadRun.h>
Public Member Functions | |
TH1F * | BaselineCorrectionResults (int, int, float=-5, float=5, int=200) |
Histograms of the contents of baseline_correction_result. | |
void | ChargeCorrelation (float, float, float, float, float, float, int, int, int, bool=false) |
Plot correlation of integrals/amplitudes between two channels. | |
float * | ChargeList (int, float=20, float=80, float=0, float=300, bool=1) |
Returns array with the individual "charge"/amplitude for all events of one channel. | |
TH1F * | ChargeSpectrum (int, float, float, float=0, float=300, float=-50, float=600, int=750) |
Histogram of the "charge" spectrum for one channel. | |
void | CorrectBaseline (float, float=-999) |
Baseline correction constant window. | |
void | CorrectBaseline_function (TH1F *, float, float, int) |
Helper function called by CorrectBaseline() | |
void | CorrectBaselineMin (int=100, double=0.5, int=0, int=0, int=2) |
Baseline correction using minimum sum ( \(\propto\) mean) in range for correction. | |
void | CorrectBaselineMin (vector< float >, double=0, int=2, int=2) |
Baseline correction using minimum sum ( \(\propto\) mean) in range for correction. | |
void | CorrectBaselineMinSlopeRMS (int=100, bool=false, double=0.5, int=0, int=0, int=2) |
Baseline correction method searching for non-monotonic, rather constant regions. | |
void | CorrectBaselineMinSlopeRMS (vector< float >, double=0, int=2, int=3) |
Baseline correction method searching for non-monotonic, rather constant regions. | |
void | FilterAll (double=.3, double=.9, double=.2) |
Filter all waveforms. | |
void | FractionEventsAboveThreshold (float=4, bool=true, bool=true, double=0., double=0., bool=false) |
Find events with max/min above/below a certain threshold. | |
int | GetChannelIndex (int) |
Match channel number (wavecatcher input channel) to channel index. | |
int | GetCurrentChannel (int) |
Get the current channel index for a certain waveform index. | |
int | GetCurrentEvent (int) |
Get the current event index for a certain waveform index. | |
int | GetEventIndex (unsigned int) |
Returns index of a certain event number (if data files are read in parallel threads) | |
int * | GetIntWindow (TH1F *, float, float, float, float, int=0) |
Determine indices for integration window for peaks. | |
float | GetPeakIntegral (TH1F *, float, float, float, float, int=0) |
Calculate the integral around a peak with several options explained in GetIntWindow(). | |
void | GetTimingCFD (float=.3, float=100, float=140, double=0., bool=true, int=2, bool=false) |
Determine the timing of the maximum peak with constant fraction discrimination. | |
TH1F * | Getwf (int) |
Helper that returns the waveform histogram for a certain waveform number number. | |
TH1F * | Getwf (int, int, int=1) |
Helper that returns the waveform histogram for a certain channel number and a certain event number. | |
double * | getx (double=0.) |
Get array of x axis (time) for standard wavecatcher settings. | |
double * | gety (int) |
Get array of y values for a certain waveform. | |
double * | gety (int, int) |
Get array of y values for a certain waveform. | |
TH1F * | His_GetTimingCFD (int, float, float, int=-999) |
Plot results of GetTimingCFD() | |
TH1F * | His_GetTimingCFD_diff (vector< int >, vector< int >, float, float, int=-999) |
Plot timing difference between the mean timings of two channel ranges. | |
void | IntegralFilter (vector< float >, vector< bool >, float, float, float=50, float=250, bool=false, bool=false) |
Skip events with threshold on integral. | |
TGraph2D * | MaxDist (int, float=0, float=300) |
Finds maximum amplitude for a given channel in time window ["from", "to"] and creates 3d map of waveforms ordered by maxima. | |
int | Nevents_good () |
Number of good events that are not skipped. | |
bool | PlotChannel (int) |
Check if a channel index should be plotted according to ReadRun::plot_active_channels. | |
void | PlotChannelAverages (bool=false) |
Plot averages only of the good, corrected waveforms for each channel. | |
void | PlotChannelSums (bool=false, bool=false, double=0., double=0., int=2) |
Plot sums of all raw waveforms for each channel. | |
void | PlotWFHeatmaps (float=-20, float=200, int=880, string="", float=0, EColorPalette=kGistEarth) |
Plot stacks of all non-skipped waveforms for all active channels. | |
void | Print_GetTimingCFD (float=100, float=140, int=0, int=-999, string="S", bool=true) |
Plot results of GetTimingCFD() | |
void | Print_GetTimingCFD_diff (vector< int >, vector< int >, float=100, float=140, int=0, int=-999, float=-999, float=-999, string="RS", bool=true) |
Plot timing difference between the mean timings of two channel ranges. | |
void | PrintBaselineCorrectionResults (float=-5, float=5, int=200) |
Print histogram of the baseline correction values for all channels. | |
void | PrintChargeSpectrum (float, float, float=0, float=300, float=-50, float=600, int=750, float=0., float=0., int=99, int=0, bool=false) |
Plots the "charge" spectrums of all channels. | |
void | PrintChargeSpectrumWF (float, float, float=0, float=300, int=1, float=0., float=0., float=0., float=0.) |
Plot waveforms of all channels for a given event number and add the determined integration windows to the plot. | |
void | PrintDCR (float=15, float=85, float=0, float=300, double=3) |
Calculate (SiPM) dark count rate. | |
void | PrintMaxDist (float=0, float=300) |
Finds maximum amplitude for a given channel in time window ["from", "to"] and creates 3d map of waveforms ordered by maxima. | |
void | PrintSkippedEvents () |
Prints a list of all skipped events into the terminal for diagnostics. | |
void | PrintTimeDist (float=0, float=300, float=0, float=300, int=100, int=0, float=.3) |
Time distribution of maximum, CFD, or 10% - 90% rise time in a certain time window. | |
void | PrintWFProjection (float=0, float=320, float=-50, float=50, int=200) |
Plots waveform projection histograms of all channels. | |
void | ReadFile (string, bool=false, int=9, string="out.root", bool=false) |
Routine to read files created by the wavecatcher. | |
ReadRun (int max_no_of_bin_files_to_read=0, int min_no_of_bin_files_to_read=0) | |
Constructor of the class. | |
void | SaveChargeLists (float=20, float=80, float=0, float=300, bool=1) |
Saves TGraphs to root file with the individual "charge"/amplitude for all events and all channels. | |
void | ShiftAllToAverageCF () |
This function shifts all waveforms to the average signal starting times for each channel. | |
void | SkipEventsPerChannel (vector< float >, float=0, float=0, bool=false) |
Skip events above/below individual thresholds per channel. | |
void | SkipEventsTimeDiffCut (int, int, double, double, bool=false) |
Skip events where the time difference between two channels is outside of specified range. | |
void | SmoothAll (double, int) |
Smoothing all waveforms which are not skipped (for testing, careful when using for analysis!) | |
void | SmoothAll (double, string="Gaus") |
Smoothing all waveforms which are not skipped (for testing, careful when using for analysis!) | |
TH1F * | TimeDist (int, float=0, float=300, float=0, float=300, int=100, int=0, float=.3) |
Time distribution of maximum, CFD, or 10% - 90% rise time in a certain time window. | |
void | UnskipAll () |
Sets skip_event flag to false for all events, removing any previous cuts. | |
TH2F * | WFHeatmapChannel (int, float=-20, float=200, int=880) |
2D histogram of all non-skipped waveforms for one channel | |
TH1F * | WFProjectionChannel (int, int=0, int=1024, float=-50, float=50, int=200) |
Waveform projections for one channel. | |
virtual | ~ReadRun () |
Destructor. | |
Static Public Member Functions | |
static pair< float, bool > | LinearInterpolation (float, float, float, float, float) |
Simple linear interpolation for x. | |
Public Attributes | |
vector< int > | active_channels |
Stores the numbers of the active channels. | |
float ** | amplValuessum |
Collects sums of all waveforms for each channel. | |
vector< vector< float > > | baseline_correction_result |
Stores baseline correction results for CorrectBaseline() and related functions. | |
int | binNumber = 1024 |
Number of bins (always 1024 samples per waveform). Do not change! | |
float | DAQ_factor = 250. / 4096. |
DAQ conversion factor for wavecatcher output to mV. | |
string | data_path |
Path to data. | |
bool | discard_original_eventnr = false |
Can be used to discard the original event numbering of the data. | |
int | end_read_at_channel = -1 |
See ReadRun::start_read_at_channel. | |
vector< unsigned int > | eventnr_storage |
Events will be stored here in the order they have been read. | |
vector< TFitResultPtr > | fit_results |
Stores the fit results of PrintChargeSpectrum() for all channels and all function calls in ascending order. | |
int | MaxNoOfBinFilesToRead |
Number of last .bin file to be read in. | |
int | maxNWF = 1e7 |
Maximum possible number of waveforms in data: number of active channels x number of events. | |
int * | maxSumBin |
Stores bin numbers where the sum of waveforms have their maximum. | |
vector< float > | mean_integral |
Stores the mean integral/lightyield from PrintChargeSpectrum() for all channels. | |
int | MinNoOfBinFilesToRead |
Number first of .bin file to be read in. | |
int | nchannels |
Number of active channels in data. | |
int | nChannelsWC = 64 |
Wavecatcher hardware max. number of channels (reduce/increase if not using the 64 channel crate) | |
int | nevents |
Number of triggered events in data. | |
int | nwf |
Total number of waveforms read from data: number of active channels x number of events. | |
vector< int > | plot_active_channels |
Stores the numbers of the active channels which should be plotted. | |
vector< vector< float > > | PrintChargeSpectrum_cal = vector(nChannelsWC, vector<float>(2, 1)) |
Calibration values to normalize charge spectrum to number of photoelectrons Chennels must be ordered as in plot_active_channels. The first entry must be the gain and the second the position of the pedestal. | |
vector< float > | PrintChargeSpectrum_pars |
Starting values of the fit parameters for PrintChargeSpectrum() | |
TFile * | root_out |
Stores results of analysis. | |
TClonesArray * | rundata |
Stores data. | |
bool | Shift_WFs_in_file_loop = false |
Shift waveforms with CFD so that all events start at the same time Call after initializing class and before calling ReadFile(). Set the constant fraction, the bin to shift the signal to, and the search window with tWF_CF, tWF_CF_bin, and tWF_CF_lo and tWF_CF_hi, respectively. | |
vector< bool > | skip_event |
Stores the event numbers which should be skipped in the analysis. | |
float | SP = .3125 |
Sampling: ns per bin of data, sampling rate 3.2 GS/s -> 0.3125 ns. | |
int | start_read_at_channel = -1 |
Do analysis only for limited range of channels to reduce memory usage. | |
vector< int > | switch_polarity_for_channels |
Stores the channel number where the polarity should be inverted. Example use to switch polarity for channel 0 and channel 14: mymeas.switch_polarity_for_channels = {0, 14}; . Needs to be called before ReadFile(). | |
float | tCutEndg |
End of time window for baseline correction when using ReadRun::Using_BaselineCorrection_in_file_loop. | |
float | tCutg |
Start of time window for baseline correction when using ReadRun::Using_BaselineCorrection_in_file_loop. | |
vector< TFitResultPtr > | timing_fit_results |
Stores the fit results of Print_GetTimingCFD() for all channels. | |
vector< vector< float > > | timing_results |
Matrix to store timing of peaks from GetTimingCFD() | |
float | tWF_CF = 0.3 |
Constant fraction of maximum (between ~0.1 and 1) for ReadRun::Shift_WFs_in_file_loop. | |
int | tWF_CF_bin = 375 |
Time bin all events will be shifted to for ReadRun::Shift_WFs_in_file_loop Needs to be 300<"tWF_CF_bin"<500 ("tWF_CF_bin"=375 means all peaks will be shifted to 375*.3125 ns=117.1875 ns) | |
int | tWF_CF_hi = 500 |
End of range of bins where the signal is expected for ReadRun::Shift_WFs_in_file_loop. | |
int | tWF_CF_lo = 320 |
Start of range of bins where the signal is expected for ReadRun::Shift_WFs_in_file_loop. | |
bool | Using_BaselineCorrection_in_file_loop = false |
Set true for baseline correction during data reading. Needs to be called before ReadFile(). | |
Protected Member Functions | |
void | checkData () const |
Primitive check to see if data has been loaded. | |
Constructor of the class.
max_no_of_bin_files_to_read | Number of last .bin file to be read in. Set it to =>1 in order to constrain the number of .bin files to be read from the target folder. Intended for quick tests on a fraction of the full dataset or for batch reading if combined with min_no_of_bin_files_to_read. |
min_no_of_bin_files_to_read | Number first of .bin file to be read in. Can be used to batch read large datasets in chunks of files. |
Definition at line 24 of file ReadRun.cc.
|
virtual |
Destructor.
Definition at line 376 of file ReadRun.cc.
TH1F * ReadRun::BaselineCorrectionResults | ( | int | channel_index, |
int | which, | ||
float | rangestart = -5 , |
||
float | rangeend = 5 , |
||
int | nbins = 200 |
||
) |
Histograms of the contents of baseline_correction_result.
See PrintBaselineCorrectionResults() for parameters.
Definition at line 1118 of file ReadRun.cc.
void ReadRun::ChargeCorrelation | ( | float | windowlow, |
float | windowhi, | ||
float | start, | ||
float | end, | ||
float | rangestart, | ||
float | rangeend, | ||
int | nbins, | ||
int | channel1, | ||
int | channel2, | ||
bool | ignore_skipped_events = false |
||
) |
Plot correlation of integrals/amplitudes between two channels.
See GetIntWindow() and PrintChargeSpectrum() for parameters.
windowlow | Integrate from "windowlow" ns from max... |
windowhi | ...to "windowhi" ns from max. |
start | Find max from "start" in ns... |
end | ...to "end" in ns. |
rangestart | Plot x & y range start |
rangeend | Plot x & y range end |
nbins | Number of x & y bins of the histogram |
channel1 | First channel number to compare |
channel2 | second channel number to compare |
ignore_skipped_events | Set true to plot only events which passed filtering, else all events will be plotted |
Definition at line 1765 of file ReadRun.cc.
float * ReadRun::ChargeList | ( | int | channel_index, |
float | windowlow = 20 , |
||
float | windowhi = 80 , |
||
float | start = 0 , |
||
float | end = 300 , |
||
bool | negative_vals = 1 |
||
) |
Returns array with the individual "charge"/amplitude for all events of one channel.
See SaveChargeLists() and GetIntWindow().
channel_index | Index of the channel. |
windowlow | Integrate from "windowlow" ns from max... |
windowhi | ...to "windowhi" ns from max. |
start | Find max from "start" in ns... |
end | ...to "end" in ns. |
negative_vals | If true will save negative values. If false will set negative values to 0. |
Definition at line 1697 of file ReadRun.cc.
TH1F * ReadRun::ChargeSpectrum | ( | int | channel_index, |
float | windowlow, | ||
float | windowhi, | ||
float | start = 0 , |
||
float | end = 300 , |
||
float | rangestart = -50 , |
||
float | rangeend = 600 , |
||
int | nbins = 750 |
||
) |
Histogram of the "charge" spectrum for one channel.
See PrintChargeSpectrum() for parameters.
Definition at line 1807 of file ReadRun.cc.
|
inlineprotected |
Baseline correction constant window.
Corrects the baseline (DC offset) of all waveforms.
Uses the mean between t=0 and t="tCut" or between t="tCut" and t="tCutEnd" as offset.
Call method before ReadFile() if you want it to happen while reading.
Most simple and fast method.
Useful for measurements with very few background events/dark counts.
Using a constant window for the baseline means there might be a background pulse which would lead to wrong correction.
Stores results for all channels and all events in ReadRun::baseline_correction_result.
Results will be visualized for each event in PrintChargeSpectrumWF().
tCut | Time denoting the end or the beginning (if "tCutEnd" is set) of the integration window. |
tCutEnd | Time denoting the end of the integration window. |
Definition at line 707 of file ReadRun.cc.
Helper function called by CorrectBaseline()
Definition at line 730 of file ReadRun.cc.
void ReadRun::CorrectBaselineMin | ( | int | nIntegrationWindow = 100 , |
double | sigma = 0.5 , |
||
int | max_bin_for_baseline = 0 , |
||
int | start_at = 0 , |
||
int | smooth_method = 2 |
||
) |
Baseline correction using minimum sum ( \(\propto\) mean) in range for correction.
This is a deprecated version of CorrectBaselineMin. It will be removed in future releases.
Corrects the baseline (DC offset) of all waveforms.
Searches for
\(\mathbf{min}\left( \sum y_i \right) \)
in range {"start_at", "max_bin_for_baseline"}, summing over "nIntegrationWindow" bins.
Make sure the search range is shortly before the triggered signal is expected to arrive.
Helpful for (groups of/irradiated) SiPMs with very high dark count rate (DCR) where the voltage rarely relaxes back to the constant baseline before the next dark count/signal arrives:
\( \Rightarrow DCR \sim 1/t_{signal} \)
Stores results for all channels and all events in ReadRun::baseline_correction_result.
Results will be visualized for each event in PrintChargeSpectrumWF().
nIntegrationWindow | Number of bins used for baseline correction. The correction factor will be the signal averaged over this number bins. |
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns for gauss kernel and convolution. Set to 0 for no smoothing. Use with care! |
max_bin_for_baseline | Maximum bin for search window. |
start_at | Minimum bin for search window. |
smooth_method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
Definition at line 1035 of file ReadRun.cc.
void ReadRun::CorrectBaselineMin | ( | vector< float > | window, |
double | sigma = 0 , |
||
int | smooth_method = 2 , |
||
int | increment = 2 |
||
) |
Baseline correction using minimum sum ( \(\propto\) mean) in range for correction.
Corrects the baseline (DC offset) of all waveforms.
Searches for
\(\mathbf{min}\left( \sum y_i \right) \)
in range {window[1], window[2]}, summing over window[0] ns.
Make sure the search range is shortly before the triggered signal is expected to arrive.
Helpful for (groups of/irradiated) SiPMs with very high dark count rate (DCR) where the voltage rarely relaxes back to the constant baseline before the next dark count/signal arrives:
\( \Rightarrow DCR \sim 1/t_{signal} \)
Stores results for all channels and all events in ReadRun::baseline_correction_result.
Results will be visualized for each event in PrintChargeSpectrumWF().
window | Vector containing {length for averaging, search start, search end} in ns. Example: {20, 10, 90} would search for the best baseline candidate from 10 ns to 90 ns, averaging over 20 ns. |
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns for gauss kernel and convolution. Set to 0 for no smoothing. Use with care! |
smooth_method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
increment | Increment for search in bins per step. Default value is 3 (=0.9375 ns). |
Definition at line 938 of file ReadRun.cc.
void ReadRun::CorrectBaselineMinSlopeRMS | ( | int | nIntegrationWindow = 100 , |
bool | smooth = false , |
||
double | sigma = 0.5 , |
||
int | max_bin_for_baseline = 0 , |
||
int | start_at = 0 , |
||
int | smooth_method = 2 |
||
) |
Baseline correction method searching for non-monotonic, rather constant regions.
This is a deprecated version of CorrectBaselineMinSlopeRMS. It will be removed in future releases.
Corrects the baseline (DC offset) of all waveforms.
Determines the region of "nIntegrationWindow" bins where the squared sum plus the square of the sum of the slope of the (smoothed) waveform reaches its minimum:
\(\mathbf{min}\left( \sum \left(\Delta y_i \right)^2 + \left(\sum \Delta y_i \right)^2 \right) \)
Here, \(\sum \left(\Delta y_i \right)^2 \to 0\) if the region is constant and \(\left( \sum \Delta y_i \right)^2 \to 0\) if the region is constant or oscillating around a constant value. The second term penalizes monotonic regions with a small, but rather constant slope (e. g. tails).
Slow, but versatile since it searches for the optimal baseline candidate region in a defined range.
Will prefer constant sections of the waveform for the estimation of the baseline.
Not well suited if there is not constant baseline in the signal, which can happen if the dark count rate is so high that dark counts overlap (e. g. an array of SiPMs) or if the baseline level fluctuates. In such a case use CorrectBaselineMin()
Stores results for all channels and all events in ReadRun::baseline_correction_result.
Results will be visualized for each event in PrintChargeSpectrumWF().
nIntegrationWindow | Number of bins used for baseline correction. The correction factor will be the signal averaged over this number bins. |
smooth | Deprecated! If true will apply smoothing to all waveforms. This will change all waveforms, which should rather be done with SmoothAll(). |
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns for gauss kernel and convolution. Set to 0 for no smoothing. Use with care! |
max_bin_for_baseline | Maximum bin for search window. |
start_at | Minimum bin for search window. |
smooth_method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
Definition at line 902 of file ReadRun.cc.
void ReadRun::CorrectBaselineMinSlopeRMS | ( | vector< float > | window, |
double | sigma = 0 , |
||
int | smooth_method = 2 , |
||
int | increment = 3 |
||
) |
Baseline correction method searching for non-monotonic, rather constant regions.
Corrects the baseline (DC offset) of all waveforms.
Determines the region of window[0] ns between window[1] ns and window[2] ns where the squared sum plus the square of the sum of the slope of the (smoothed) waveform reaches its minimum:
\(\mathbf{min}\left( \sum \left(\Delta y_i \right)^2 + \left(\sum \Delta y_i \right)^2 \right) \)
Here, \(\sum \left(\Delta y_i \right)^2 \to 0\) if the region is constant and \(\left( \sum \Delta y_i \right)^2 \to 0\) if the region is constant or oscillating around a constant value. The second term penalizes monotonic regions with a small, but rather constant slope (e. g. tails).
Slow, but versatile since it searches for the optimal baseline candidate region in a defined range.
Will prefer constant sections of the waveform for the estimation of the baseline.
Not well suited if there is not constant baseline in the signal, which can happen if the dark count rate is so high that dark counts overlap (e. g. an array of SiPMs) or if the baseline level fluctuates. In such a case use CorrectBaselineMin()
Stores results for all channels and all events in ReadRun::baseline_correction_result.
Results will be visualized for each event in PrintChargeSpectrumWF().
window | Vector containing {length for averaging, search start, search end} in ns. Example: {20, 10, 90} would search for the best baseline candidate from 10 ns to 90 ns, averaging over 20 ns. |
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns for gauss |
smooth_method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
increment | Increment for search in bins per step. Default value is 3 (=0.9375 ns). |
Definition at line 784 of file ReadRun.cc.
Filter all waveforms.
Experimental. See Filters::ResponseFilter() or Filters::SecondOrderUnderdampedFilter().
sigma1 | First. |
sigma2 | Second. |
factor | Factor for negative part (0 < factor < 1). |
Definition at line 641 of file ReadRun.cc.
void ReadRun::FractionEventsAboveThreshold | ( | float | threshold = 4 , |
bool | max = true , |
||
bool | greater = true , |
||
double | from = 0. , |
||
double | to = 0. , |
||
bool | verbose = false |
||
) |
Find events with max/min above/below a certain threshold.
Needs to be called before the charge spectrum etc functions.
Baseline correction should be called before this function.
threshold | Threshold in mV. |
max | If true uses max, else uses min. |
greater | If true looks for events with max/min>threshold, else looks for events with max/min<threshold. |
from | Start search at "from" in ns. |
to | End search at "to" in ns. |
verbose | Set true for extra verbosity. |
Definition at line 1328 of file ReadRun.cc.
Match channel number (wavecatcher input channel) to channel index.
channel_number | Number of the channel as defined in the wavecatcher software |
Definition at line 2615 of file ReadRun.cc.
Get the current channel index for a certain waveform index.
waveform_index |
Definition at line 2630 of file ReadRun.cc.
Get the current event index for a certain waveform index.
waveform_index |
Definition at line 2637 of file ReadRun.cc.
Returns index of a certain event number (if data files are read in parallel threads)
eventnr | Event number as stored in the data. |
Definition at line 2597 of file ReadRun.cc.
int * ReadRun::GetIntWindow | ( | TH1F * | his, |
float | windowlow, | ||
float | windowhi, | ||
float | start, | ||
float | end, | ||
int | channel = 0 |
||
) |
Determine indices for integration window for peaks.
Default usage: Find maximum in range ("start", "end") and return bin numbers for [0] the max, [1] t_max - "windowlow", and [2] t_max + "windowhi".
If ("start" < 0 || "end" < 0) doesn't return max and integration window is fixed relative to the maximum of the sum of all waveforms:
t(max(sum_spectrum[channel])) +/- "windowhi"/"windowlow"
If ("windowlow" == "start" && "windowhi" == "end") doesn't return max and sets fixed integration window from "start" until "end" for all channels.
his | Histogram to integrate. |
windowlow | Integration time left to the maximum of the peak. |
windowhi | Integration time right to the maximum of the peak. |
start | Range for finding maximum. |
end | Range for finding maximum. |
channel | Channel index in case the integration should be around the maximum of the sum of all waveforms |
Definition at line 1534 of file ReadRun.cc.
float ReadRun::GetPeakIntegral | ( | TH1F * | his, |
float | windowlow, | ||
float | windowhi, | ||
float | start, | ||
float | end, | ||
int | channel_index = 0 |
||
) |
Calculate the integral around a peak with several options explained in GetIntWindow().
Calculated over an integer number of bins.
If start = end = 0 will return the amplitude of the peak.
If start < 0 || end < 0 will return the integral over the fixed integration window around the maximum of the sum spectrum for each channel.
If windowlow == start && windowhi == end will return the integral over the fixed integration window for all channels.
his | Histogram with peak. |
windowlow | Integration time left to the maximum of the peak. |
windowhi | Integration time right to the maximum of the peak. |
start | Range for finding maximum. |
end | Range for finding maximum. |
channel_index | Channel index in case the integration should be around the maximum of the sum of all waveforms. |
Definition at line 1588 of file ReadRun.cc.
void ReadRun::GetTimingCFD | ( | float | cf_r = .3 , |
float | start_at_t = 100 , |
||
float | end_at_t = 140 , |
||
double | sigma = 0. , |
||
bool | find_CF_from_start = true , |
||
int | smooth_method = 2 , |
||
bool | use_spline = false |
||
) |
Determine the timing of the maximum peak with constant fraction discrimination.
Determines timing in the time interval ["start_at_t", "end_at_t"] with CFD for fraction of maximum "cf_r".
Stores timing information for all channels and all events in ReadRun::timing_results.
Per event results will be visualized in PrintChargeSpectrumWF().
Cumulative per channel results can be visualized with Print_GetTimingCFD().
Results can be used for time difference cuts with SkipEventsTimeDiffCut().
cf_r | Fraction of maximum for CFD. If set > 1 it will be used as a fixed threshold in mV, so it will no longer use CFD. |
start_at_t | Time in ns to start searching. |
end_at_t | Time in ns to end searching. |
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns for gauss kernel and convolution. This will bias the results! Do not use (or use very carefully, only for noisy data)! Set to 0 if you do not want to use smoothing. |
find_CF_from_start | If true will start search from "start_at_t" to find the first arriving photon (default setting). If false search backwards from the time of the maximum. |
smooth_method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
use_spline | If false will use linear interpolation between the two bins closest to cf_r. If true will use a 5th order spline and bisection method for interpolation. Performs a bit better in most cases compared to only linear interpolation. |
Definition at line 1188 of file ReadRun.cc.
Helper that returns the waveform histogram for a certain waveform number number.
wf_nr | Waveform number |
Definition at line 2547 of file ReadRun.cc.
Helper that returns the waveform histogram for a certain channel number and a certain event number.
channelnr | Channel number index (not the actual channel number) |
eventnr | Event number |
color | Choose color of histogram |
Definition at line 2557 of file ReadRun.cc.
Get array of x axis (time) for standard wavecatcher settings.
shift | Offset |
Definition at line 2569 of file ReadRun.cc.
Get array of y values for a certain waveform.
waveform_index | Waveform index |
Definition at line 2580 of file ReadRun.cc.
Get array of y values for a certain waveform.
channelnr | Channel number index (not the actual channel number) |
eventnr | Event number |
Definition at line 2589 of file ReadRun.cc.
TH1F * ReadRun::His_GetTimingCFD | ( | int | channel_index, |
float | rangestart, | ||
float | rangeend, | ||
int | nbins = -999 |
||
) |
Plot results of GetTimingCFD()
See Print_GetTimingCFD() for parameters.
Definition at line 2277 of file ReadRun.cc.
TH1F * ReadRun::His_GetTimingCFD_diff | ( | vector< int > | channels1, |
vector< int > | channels2, | ||
float | rangestart, | ||
float | rangeend, | ||
int | nbins = -999 |
||
) |
Plot timing difference between the mean timings of two channel ranges.
See Print_GetTimingCFD_diff() for parameters.
Definition at line 2350 of file ReadRun.cc.
void ReadRun::IntegralFilter | ( | vector< float > | thresholds, |
vector< bool > | highlow, | ||
float | windowlow, | ||
float | windowhi, | ||
float | start = 50 , |
||
float | end = 250 , |
||
bool | use_AND_condition = false , |
||
bool | verbose = false |
||
) |
Skip events with threshold on integral.
Compare with SkipEventsPerChannel()
Needs to be called before the charge spectrum etc functions in order to have an effect on them.
Baseline correction should be called before this function.
thresholds | Vector should contain a threshold for each active channel saved in the data, in ascending order (ch0, ch1 ...). Negative thresholds mean events below threshold will be cut. A threshold of 0 means the channel will not be evaluated. If only one value is given this value will be used for all active channels. |
highlow | Vector should contain a bool for each active channel. True means events with integrals above threshold will be cut, false means below threshold. If only one value is given this value will be used for all active channels. |
windowlow | Integration time left to the maximum of the peak. |
windowhi | Integration time right to the maximum of the peak. |
start | Range for finding maximum. |
end | Range for finding maximum. |
use_AND_condition | If set true it will overrule previously applied cuts and un-skip events that pass integral criterium. |
verbose | Set true for extra verbosity. |
Definition at line 1443 of file ReadRun.cc.
|
static |
Simple linear interpolation for x.
Will return the mean of x1 and x2 if y1=y2.
ym | Y value for evaluation |
x1 | X1 |
x2 | X2 |
y1 | Y1 |
y2 | Y2 |
Definition at line 2658 of file ReadRun.cc.
Finds maximum amplitude for a given channel in time window ["from", "to"] and creates 3d map of waveforms ordered by maxima.
Use PrintMaxDist() to plot all channels. Use only for small datasets as it will contain all of the data
Definition at line 2227 of file ReadRun.cc.
int ReadRun::Nevents_good | ( | ) |
Number of good events that are not skipped.
Definition at line 1510 of file ReadRun.cc.
Check if a channel index should be plotted according to ReadRun::plot_active_channels.
i | Channel index. |
Definition at line 2643 of file ReadRun.cc.
Plot averages only of the good, corrected waveforms for each channel.
Similar to PlotChannelSums(), but will average all non-skipped waveforms.
Can be used to inspect average waveforms after baseline correction etc. has been applied. To do so, call function after calling correction and event filter functions.
normalize | If true will normalize the maximum to 1. |
Definition at line 454 of file ReadRun.cc.
void ReadRun::PlotChannelSums | ( | bool | smooth = false , |
bool | normalize = false , |
||
double | shift = 0. , |
||
double | sigma = 0. , |
||
int | smooth_method = 2 |
||
) |
Plot sums of all raw waveforms for each channel.
To plot the average waveforms after baseline correction etc. use PlotChannelAverages().
smooth | If true it will apply smoothing to plots. Do not use without very good reason as it biases the results. |
normalize | If true will normalize the maximum to 1. |
shift | Shift histogram by "shift" ns |
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns for gauss kernel and convolution. |
smooth_method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
Definition at line 396 of file ReadRun.cc.
void ReadRun::PlotWFHeatmaps | ( | float | ymin = -20 , |
float | ymax = 200 , |
||
int | n_bins_y = 880 , |
||
string | z_opt = "" , |
||
float | z_max = 0 , |
||
EColorPalette | palette = kGistEarth |
||
) |
Plot stacks of all non-skipped waveforms for all active channels.
Classical SiPM dark count/calibration plot in the style of a phosphor oscilloscope screen.
Helpful to see the prevalence of certain signal/baseline shapes etc.
Take care not to plot too many channels at once to maintain visibility and performance (-> ReadRun::plot_active_channels).
ymin | Min. y range |
ymax | Max. y range |
n_bins_y | Number of bins along y |
z_opt | "log": Set z logarithmic. "COLZ0": Do not plot bins with zero entries. |
z_max | Max. z range. Set to zero to use auto range (default). |
palette | Root color palette (see https://root.cern.ch/doc/master/classTColor.html). |
Definition at line 556 of file ReadRun.cc.
void ReadRun::Print_GetTimingCFD | ( | float | rangestart = 100 , |
float | rangeend = 140 , |
||
int | do_fit = 0 , |
||
int | nbins = -999 , |
||
string | fitoption = "S" , |
||
bool | set_errors = true |
||
) |
Plot results of GetTimingCFD()
rangestart | Start of x range for plot in ns. |
rangeend | End of x range for plot in ns. |
do_fit | If 1: fits a gaussian. Else do not fit. Fit results per channel are stored in ReadRun::timing_fit_results. |
nbins | Number of bins for histogram. Will use 320 MHz sampling rate for binning if nbins = -999. |
fitoption | ROOT fit option, default is "S". See Fit(): https://root.cern/doc/master/classTH1.html |
set_errors | Assign errors to the bins. Will assign errors of 1 to empty bins and \( \sqrt(N) \) if they are not empty. Can improve the chi^2 fit. |
Definition at line 2300 of file ReadRun.cc.
void ReadRun::Print_GetTimingCFD_diff | ( | vector< int > | channels1, |
vector< int > | channels2, | ||
float | rangestart = 100 , |
||
float | rangeend = 140 , |
||
int | do_fit = 0 , |
||
int | nbins = -999 , |
||
float | fitrangestart = -999 , |
||
float | fitrangeend = -999 , |
||
string | fitoption = "RS" , |
||
bool | set_errors = true |
||
) |
Plot timing difference between the mean timings of two channel ranges.
Plots the difference between the peak times between the mean times of two ranges of channels for each event.
It calculates \( \Delta t = <t_{second,i}> - <t_{first,i}> \) .
The vectors of channels to compare are added with curly brackets:
mymeas.Print_GetTimingCFD_diff({ 26, 14 }, { 19 }, 0, 20, 2, 200);
would plot \( \Delta t = t_{ch19} - (t_{ch26} + t_{ch14})/2 \) from 0 ns to 20 ns with 200 bins (100 ps bin width). Another example is given in the plot below.
channels1 | Vector of first channel numbers (wavecatcher channel numbers). |
channels2 | Vector of second channel numbers to compare. |
rangestart | Start of x range for plot in ns. |
rangeend | End of x range for plot in ns. |
do_fit | If 1: Fit a gaussian. If 2: Fit a gaussian-exponential convolution (Fitf_exp_gauss) to account for different arrival times of photons due to different possible light paths in the scintillator/light guide and/or delay due to self-absorption and reemission of photons in the scintillator. To be used for long light paths in the scintillator. See https://doi.org/10.1016/S0029-554X(79)90170-8 . This option only works for sufficient asymmetry \(\tau > \sigma/2\). Otherwise, the exponential decay time becomes too small to be fitted. If the asymmetry is too small (skewness<0.15) option 1 will be used by default. If 3: Fits the sum of two gaussians where the second gauss serves as a rough background estimate. Background means events that should have been filtered out. Else: Do not fit. |
nbins | Number of bins for histogram. |
fitrangestart | Start of fitting range. |
fitrangeend | End of fitting range. |
fitoption | ROOT fitting option. Default is "RS" (chi^2). You can try to use the likelihood method with "LRS" if the data is very clean. Outliers will influence the results for the likelihood method so it is advisable to limit the fit range to exclude outliers for "LRS". |
set_errors | Assign errors to the bins. Will assign errors of 1 to empty bins and \( \sqrt(N) \) if they are not empty. Can improve the chi^2 fit. |
Definition at line 2438 of file ReadRun.cc.
void ReadRun::PrintBaselineCorrectionResults | ( | float | rangestart = -5 , |
float | rangeend = 5 , |
||
int | nbins = 200 |
||
) |
Print histogram of the baseline correction values for all channels.
Currently only optimized for the correction values themselves.
rangestart | Plot x range start. |
rangeend | Plot x range end. |
nbins | Number of bins in range. |
Definition at line 1138 of file ReadRun.cc.
void ReadRun::PrintChargeSpectrum | ( | float | windowlow, |
float | windowhi, | ||
float | start = 0 , |
||
float | end = 300 , |
||
float | rangestart = -50 , |
||
float | rangeend = 600 , |
||
int | nbins = 750 , |
||
float | fitrangestart = 0. , |
||
float | fitrangeend = 0. , |
||
int | max_channel_nr_to_fit = 99 , |
||
int | which_fitf = 0 , |
||
bool | use_log_y = false |
||
) |
Plots the "charge" spectrums of all channels.
Integrate all pulses in range ("start", "end") from t_max - "windowlow" to t_max + "windowhi" for a given channel and return the charge histogram with x range ("rangestart", "rangeend") and the number of bins "nbins".
It is not really charge, but either amplitude (mV) or integral (mV x ns). See ChargeSpectrum() and GetIntWindow().
Can be normalised to the number of photoelectrons by defining the calibration values in PrintChargeSpectrum_cal.
windowlow | Integrate from "windowlow" ns from max... |
windowhi | ...to "windowhi" ns from max. |
start | Find max from "start" in ns... |
end | ...to "end" in ns. |
rangestart | Plot x range start |
rangeend | Plot x range end |
nbins | Number of bins of histogram |
fitrangestart | Fit range start |
fitrangeend | Fit range end |
max_channel_nr_to_fit | Fit only channels with index < "max_channel_nr_to_fit". Set to -1 to skip fitting. |
which_fitf | Choose fit function: 0 - do not fit 1 - Fitf_langaus: landau gauss convolution for large number of photons 2 - Fitf_biased: if pedestal is biased because of peak finder algorithm 3 - Fitf_full: SiPM fit function with exponential delayed after pulsing 4 - Fitf_PMT_ideal: ideal PMT fit function 5 - Fitf_PMT: PMT fit function 6 - Fitf_PMT_pedestal: PMT fit function with biased pedestal 7 - Fitf_plus_DC: default SiPM fit function + dark count spectrum (for lots of false triggers) else - Fitf: default SiPM fit function |
use_log_y | Set all y axes to log scale (for dark count spectra) |
Definition at line 1861 of file ReadRun.cc.
void ReadRun::PrintChargeSpectrumWF | ( | float | windowlow, |
float | windowhi, | ||
float | start = 0 , |
||
float | end = 300 , |
||
int | eventnr = 1 , |
||
float | ymin = 0. , |
||
float | ymax = 0. , |
||
float | xmin = 0. , |
||
float | xmax = 0. |
||
) |
Plot waveforms of all channels for a given event number and add the determined integration windows to the plot.
See GetIntWindow() for explanation of parameters.
Will also add CFD timing if GetTimingCFD() was called before.
image html PrintChargeSpectrumWF.png "Waveforms in all channels for a single event. Code in example."
windowlow | Integrate from "windowlow" ns from max... |
windowhi | ...to "windowhi" ns from max. |
start | Find max from "start" in ns... |
end | ...to "end" in ns. |
eventnr | Event number |
ymin | Y axis minimum |
ymax | Y axis maximum |
xmin | X axis maximum |
xmax | X axis maximum |
Definition at line 1613 of file ReadRun.cc.
void ReadRun::PrintDCR | ( | float | windowlow = 15 , |
float | windowhi = 85 , |
||
float | rangestart = 0 , |
||
float | rangeend = 300 , |
||
double | threshold = 3 |
||
) |
Calculate (SiPM) dark count rate.
See PrintChargeSpectrum() for parameters.
threshold | 1.5 photoelectron threshold |
Definition at line 2103 of file ReadRun.cc.
Finds maximum amplitude for a given channel in time window ["from", "to"] and creates 3d map of waveforms ordered by maxima.
Prints MaxDist() for all channels. Use only for small datasets as it will contain all of the data
from | From |
to | To |
Definition at line 2254 of file ReadRun.cc.
void ReadRun::PrintSkippedEvents | ( | ) |
Prints a list of all skipped events into the terminal for diagnostics.
Definition at line 1491 of file ReadRun.cc.
void ReadRun::PrintTimeDist | ( | float | from = 0 , |
float | to = 300 , |
||
float | rangestart = 0 , |
||
float | rangeend = 300 , |
||
int | nbins = 100 , |
||
int | which = 0 , |
||
float | cf_r = .3 |
||
) |
Time distribution of maximum, CFD, or 10% - 90% rise time in a certain time window.
Find peak time for a given channel in time window ["from", "to"] and return the peak time histogram with x range ["rangestart", "rangeend"] and the number of bins "nbins".
Plots TimeDist() for all channels.
For CFD it is advised to use GetTimingCFD() with Print_GetTimingCFD() instead of this function.
from | Start of time interval in ns |
to | End of time interval in ns |
rangestart | Start of x range of histogram |
rangeend | End of x range of histogram |
nbins | Number of bins of histogram |
which | Options: 0 - Gives time of maximum. 1 - Gives constant fraction discrimination with fraction "cf_r" of maximum, searching backwards from the maximum until "from". else - gives the 10% - 90% rise time. |
cf_r | Fraction of max for CFD. |
Definition at line 2191 of file ReadRun.cc.
void ReadRun::PrintWFProjection | ( | float | from = 0 , |
float | to = 320 , |
||
float | rangestart = -50 , |
||
float | rangeend = 50 , |
||
int | nbins = 200 |
||
) |
Plots waveform projection histograms of all channels.
Useful to check baseline correction. Will show if the baseline correction works as intended (gaussian shape) or if the standard deviation of the baseline is too large.
An asymmetry in the distribution might point to many dark counts in the window or a bad choice of parameters for the baseline correction. In that case the baseline correction should be revisited.
from | Do projection in time window (from... |
to | ...to) in ns. This window should reflect the search window used for baseline correction. |
rangestart | Plot x range start in mV. |
rangeend | Plot x range end in mV. |
nbins | Number of bins in range. |
Definition at line 1079 of file ReadRun.cc.
void ReadRun::ReadFile | ( | string | path, |
bool | change_polarity = false , |
||
int | change_sign_from_to_ch_num = 9 , |
||
string | out_file_name = "out.root" , |
||
bool | debug = false |
||
) |
Routine to read files created by the wavecatcher.
Reads the data and can already do simple data manipulation during reading:
TClonesArray rundata
. Reader modified from WaveCatcher binary -> root converter by manu chauv.nosp@m.eau@.nosp@m.cenbg.nosp@m..in2.nosp@m.p3.fr
path | Path to the data. All files in this folder containing .bin in the file name will be read in. |
change_polarity | Set true to change polarity (sign) of certain channels (see change_sign_from_to_ch_num below). You can also define a list of channels where the polarity should be switched with switch_polarity_for_channels. |
change_sign_from_to_ch_num | All channels \( \geq \) change_sign_from_to_ch_num will be inverted if change_polarity is true . If negative number all channels \( \leq \) abs(change_sign_from_to_ch_num) will be inverted if change_polarity is true . |
out_file_name | Name of the .root file which stores the results, e. g. results.root . |
debug | Set true to increase the verbosity. |
Definition at line 66 of file ReadRun.cc.
void ReadRun::SaveChargeLists | ( | float | windowlow = 20 , |
float | windowhi = 80 , |
||
float | start = 0 , |
||
float | end = 300 , |
||
bool | negative_vals = 1 |
||
) |
Saves TGraphs to root file with the individual "charge"/amplitude for all events and all channels.
Event with a skip_event flag will be removed. Call before filtering or call UnskipAll() before to get all events.
See GetIntWindow().
windowlow | Integrate from "windowlow" ns from max... |
windowhi | ...to "windowhi" ns from max. |
start | Find max from "start" in ns... |
end | ...to "end" in ns. |
negative_vals | If true will save negative values. If false will set negative values to 0. |
Definition at line 1717 of file ReadRun.cc.
void ReadRun::ShiftAllToAverageCF | ( | ) |
This function shifts all waveforms to the average signal starting times for each channel.
The signal starting times are determined with constant fraction discrimination. Before calling this function, please call GetTimingCFD() with suitable parameters for your data.
Additionally, PrintChargeSpectrumWF() should be called before calling this function since the timing reference (blue line) won't be shifted.
Definition at line 661 of file ReadRun.cc.
void ReadRun::SkipEventsPerChannel | ( | vector< float > | thresholds, |
float | rangestart = 0 , |
||
float | rangeend = 0 , |
||
bool | verbose = false |
||
) |
Skip events above/below individual thresholds per channel.
Needs to be called before the charge spectrum etc functions.
Baseline correction should be called before this function.
thresholds | Vector should contain a threshold for each active channel saved in the data, in ascending order (ch0, ch1 ...). Negative thresholds mean events below threshold will be cut. If only one value is given this value will be used for all active channels. |
rangestart | Range start in ns |
rangeend | Range end in ns |
verbose | Set true for extra verbosity. |
Definition at line 1393 of file ReadRun.cc.
void ReadRun::SkipEventsTimeDiffCut | ( | int | first_channel_abs, |
int | second_channel_abs, | ||
double | time_diff_min, | ||
double | time_diff_max, | ||
bool | verbose = false |
||
) |
Skip events where the time difference between two channels is outside of specified range.
Skip events where the time difference between channel "first_channel" and channel "second_channel" is less than "time_diff_min" or more than "time_diff_max"
Needs to be called before the charge spectrum etc functions.
Baseline correction should be called before this function.
first_channel_abs | First channel. |
second_channel_abs | Second channel. |
time_diff_min | Skip events for \( \Delta t<t_{diff,min} \) |
time_diff_max | Skip events for \( \Delta t>t_{diff,max} \) |
verbose | Set true for extra verbosity. |
Definition at line 1285 of file ReadRun.cc.
Smoothing all waveforms which are not skipped (for testing, careful when using for analysis!)
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns. |
method | 0: Use running average (box kernel smoothing). Simple, very fast. 2: Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
Definition at line 599 of file ReadRun.cc.
Smoothing all waveforms which are not skipped (for testing, careful when using for analysis!)
sigma | Number of bins before and after central bin for running average OR gauss sigma in ns. |
method | "Box": Use running average (box kernel smoothing). Simple, very fast. "Gaus": Use 3 sigma gaussian kernel smoothing. Preferred method, fast. |
Definition at line 620 of file ReadRun.cc.
TH1F * ReadRun::TimeDist | ( | int | channel_index, |
float | from = 0 , |
||
float | to = 300 , |
||
float | rangestart = 0 , |
||
float | rangeend = 300 , |
||
int | nbins = 100 , |
||
int | which = 0 , |
||
float | cf_r = .3 |
||
) |
Time distribution of maximum, CFD, or 10% - 90% rise time in a certain time window.
See PrintTimeDist() for parameters.
Definition at line 2127 of file ReadRun.cc.
void ReadRun::UnskipAll | ( | ) |
Sets skip_event flag to false for all events, removing any previous cuts.
Definition at line 1504 of file ReadRun.cc.
TH2F * ReadRun::WFHeatmapChannel | ( | int | channel_index, |
float | ymin = -20 , |
||
float | ymax = 200 , |
||
int | n_bins_y = 880 |
||
) |
2D histogram of all non-skipped waveforms for one channel
See PlotWFHeatmaps()
channel_index | Index of the channel |
ymin | Min. y range |
ymax | Max. y range |
n_bins_y | Number of bins along y |
Definition at line 524 of file ReadRun.cc.
TH1F * ReadRun::WFProjectionChannel | ( | int | channel_index, |
int | from_n = 0 , |
||
int | to_n = 1024 , |
||
float | rangestart = -50 , |
||
float | rangeend = 50 , |
||
int | nbins = 200 |
||
) |
Waveform projections for one channel.
See PrintWFProjection() for parameters.
Definition at line 1052 of file ReadRun.cc.
float** ReadRun::amplValuessum |
Stores baseline correction results for CorrectBaseline() and related functions.
int ReadRun::binNumber = 1024 |
float ReadRun::DAQ_factor = 250. / 4096. |
DAQ conversion factor for wavecatcher output to mV.
From https://owncloud.lal.in2p3.fr/public.php?service=files&t=56e4a2c53a991cb08f73d03f1ce58ba2
string ReadRun::data_path |
Can be used to discard the original event numbering of the data.
Set to true if you want to read several runs at once. The events will be numbered in the order they are read in. The original event numbers of the different runs will be lost. CAUTION: All .bin files of the different runs need to contain the same number of channels.
int ReadRun::end_read_at_channel = -1 |
vector<TFitResultPtr> ReadRun::fit_results |
Stores the fit results of PrintChargeSpectrum() for all channels and all function calls in ascending order.
int ReadRun::MaxNoOfBinFilesToRead |
int* ReadRun::maxSumBin |
Stores bin numbers where the sum of waveforms have their maximum.
Can be used for fixed integration window relative to maximum of the sum of all waveforms per channel (ReadRun::amplValuessum)
Stores the mean integral/lightyield from PrintChargeSpectrum() for all channels.
int ReadRun::MinNoOfBinFilesToRead |
int ReadRun::nChannelsWC = 64 |
int ReadRun::nevents |
Number of triggered events in data.
int ReadRun::nwf |
Stores the numbers of the active channels which should be plotted.
You can select the channels you want with plot_active_channels.push_back(channel_to_plot); to add them to the list.
If undefined all channels will be plotted.
Calibration values to normalize charge spectrum to number of photoelectrons Chennels must be ordered as in plot_active_channels.
The first entry must be the gain and the second the position of the pedestal.
Starting values of the fit parameters for PrintChargeSpectrum()
TClonesArray* ReadRun::rundata |
Shift waveforms with CFD so that all events start at the same time Call after initializing class and before calling ReadFile().
Set the constant fraction, the bin to shift the signal to, and the search window with tWF_CF, tWF_CF_bin, and tWF_CF_lo and tWF_CF_hi, respectively.
Stores the event numbers which should be skipped in the analysis.
To identify events to be filtered use functions IntegralFilter(), SkipEventsPerChannel(), and SkipEventsTimeDiffCut().
float ReadRun::SP = .3125 |
int ReadRun::start_read_at_channel = -1 |
Do analysis only for limited range of channels to reduce memory usage.
For large datasets with many channels and many events
Only read and analyze channels from ReadRun::start_read_at_channel to ReadRun::end_read_at_channel.
The recorded channel with the lowest wavecatcher channel number is 0 (e.g. recorded channels 3 and 4, so start would be 0 and end 1).
If set to -1 (default) all channels will be read in one go.
Else channels from "start_read_at_channel" to "end_read_at_channel" will be read.
If "end_read_at_channel" is not defined will only read channel specified in "start_read_at_channel".
Stores the channel number where the polarity should be inverted. Example use to switch polarity for channel 0 and channel 14: mymeas.switch_polarity_for_channels = {0, 14};
. Needs to be called before ReadFile().
float ReadRun::tCutEndg |
End of time window for baseline correction when using ReadRun::Using_BaselineCorrection_in_file_loop.
float ReadRun::tCutg |
Start of time window for baseline correction when using ReadRun::Using_BaselineCorrection_in_file_loop.
vector<TFitResultPtr> ReadRun::timing_fit_results |
Stores the fit results of Print_GetTimingCFD() for all channels.
Matrix to store timing of peaks from GetTimingCFD()
First index is the index of the waveform.
Second index is:
0: CFD bin number 1: CFD time 2: Y-value of the maximum 3: Bin number of the maximum 4: Constant fraction (maximum * cf_r) 5: Start of search window 6: End of search window
float ReadRun::tWF_CF = 0.3 |
Constant fraction of maximum (between ~0.1 and 1) for ReadRun::Shift_WFs_in_file_loop.
int ReadRun::tWF_CF_bin = 375 |
Time bin all events will be shifted to for ReadRun::Shift_WFs_in_file_loop Needs to be 300<"tWF_CF_bin"<500 ("tWF_CF_bin"=375 means all peaks will be shifted to 375*.3125 ns=117.1875 ns)
int ReadRun::tWF_CF_hi = 500 |
End of range of bins where the signal is expected for ReadRun::Shift_WFs_in_file_loop.
int ReadRun::tWF_CF_lo = 320 |
Start of range of bins where the signal is expected for ReadRun::Shift_WFs_in_file_loop.
Set true for baseline correction during data reading. Needs to be called before ReadFile().