wavecatcher-analysis
|
Functions specific for the cosmics box, a liquid scintillator prototype read out with a SiPM array coupled to a wavelength-shifting optical module WOM. More...
#include <CosmicsBox.h>
Public Member Functions | |
CosmicsBox (int no_of_bin_files_to_read) | |
Initializer will call initializer of ReadRun class. | |
void | Print_Phi_ew (vector< int >, vector< float >, vector< int >, float=1, float=1, float=100, float=140, int=400, bool=true, bool=false) |
Angular distribution of passing particles in the cosmics setup. | |
![]() | |
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. | |
Additional Inherited Members | |
![]() | |
static pair< float, bool > | LinearInterpolation (float, float, float, float, float) |
Simple linear interpolation for x. | |
![]() | |
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(). | |
![]() | |
void | checkData () const |
Primitive check to see if data has been loaded. | |
Functions specific for the cosmics box, a liquid scintillator prototype read out with a SiPM array coupled to a wavelength-shifting optical module WOM.
Definition at line 7 of file CosmicsBox.h.
|
inline |
Initializer will call initializer of ReadRun class.
no_of_bin_files_to_read |
Definition at line 11 of file CosmicsBox.h.
void CosmicsBox::Print_Phi_ew | ( | vector< int > | phi_chx, |
vector< float > | ly_C0, | ||
vector< int > | SiPMchannels, | ||
float | windowmin = 1 , |
||
float | windowmax = 1 , |
||
float | maxfrom = 100 , |
||
float | maxto = 140 , |
||
int | nbins = 400 , |
||
bool | corr = true , |
||
bool | periodic = false |
||
) |
Angular distribution of passing particles in the cosmics setup.
Plots distribution of the event-dependent angle phi_ew in a histogram.
The angle is calculated using vectorial addition and the lightyield of each channel in each event.
For more info, see master thesis of Alexander Vagts.
Currently uses the uncorrected formulas.
phi_chx | Vector of the associated angles of each channel. Order is important. Angle of the first channel first. E.g. if channel 0 is used, the first angle would be from channel 0 |
ly_C0 | Vector of the lightyield of all channels at C0 position for the correction. Order must be the same as in phi_chx |
SiPMchannels | all SiPM channels which should be included in analysis, e.g. {0, 2, 4, 6} |
windowmin | left edge of integration window for lightyield |
windowmax | right edge of integration window for lightyield |
maxfrom | searches for peak from this to |
maxto | this |
nbins | Number of bins in histogram |
corr | selection bool for corrected or uncorrected spectra If true - corrected spectra If false - uncorrected spectra |
periodic | If true, will print all phi_ew shifted by +/- 360 deg (so normal phi_ew distri * 3) and fit a periodic gauss |
Definition at line 25 of file CosmicsBox.cc.