#include <TROOT.h>
void timing_example_rebin()
{
string path("examples/exampledata/timingdata/");
mymeas.
ReadFile(path,
true, 0,
"examples/timing_example_rebin_results.root");
int combine_n_bins = 4;
cout <<
"\nnew bins: " << mymeas.
binNumber << endl;
float intwindowminus = 15.;
float intwindowplus = 85.;
float findmaxfrom = 95.;
float findmaxto = 140.;
float rangestart = -100;
float rangeend = 2500;
int number_of_bins = 100;
mymeas.
PrintChargeSpectrum(intwindowminus, intwindowplus, findmaxfrom, findmaxto, rangestart, rangeend, number_of_bins, rangestart, rangeend);
mymeas.
ChargeCorrelation(intwindowminus, intwindowplus, findmaxfrom, findmaxto, rangestart, rangeend, 100, 2, 3,
true);
mymeas.
ChargeCorrelation(intwindowminus, intwindowplus, findmaxfrom, findmaxto, rangestart, rangeend, 100, 2, 14,
true);
mymeas.
ChargeCorrelation(intwindowminus, intwindowplus, findmaxfrom, findmaxto, rangestart, rangeend, 100, 2, 26,
true);
mymeas.
IntegralFilter({ 100, 100, 200, 200 }, {
false,
false,
false,
false }, intwindowminus, intwindowplus, findmaxfrom, findmaxto);
mymeas.
PrintChargeSpectrum(intwindowminus, intwindowplus, findmaxfrom, findmaxto, rangestart, rangeend, number_of_bins, rangestart, rangeend);
double ymin = -10;
double ymax = 120;
int how_many = 50;
for (
int i = 1; i < mymeas.
nevents; i +=
static_cast<unsigned int>(mymeas.
nevents / how_many)) {
}
}
gROOT->SetBatch(kFALSE);
}
Class containing experimental functions.
void RebinAll(int=2, float=0, unsigned long=0)
Rebin the data to test bandwidth effects. Will combine an integer number of bins into a new,...
void Print_GetTimingCFD(float=100, float=140, int=0, int=-999, string="S", bool=true)
Plot results of GetTimingCFD()
void ChargeCorrelation(float, float, float, float, float, float, int, int, int, bool=false)
Plot correlation of integrals/amplitudes between two channels.
void CorrectBaselineMin(vector< float >, double=0, int=2)
Baseline correction using minimum sum ( mean) in range for correction.
int nevents
Number of triggered events in data.
vector< bool > skip_event
Stores the event numbers which should be skipped in the analysis.
virtual void ReadFile(string, bool=false, int=9, string="out.root", bool=false, long long=-1)
Routine to read files created by the wavecatcher.
void PlotChannelAverages(bool=false)
Plot averages only of the good, corrected waveforms for each channel.
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...
void GetTimingCFD(float=.3, float=100, float=140, double=0., bool=true, int=2, bool=false, bool=false)
Determine the timing of the maximum peak with constant fraction discrimination.
void IntegralFilter(vector< float >, vector< bool >, float, float, float=50, float=250, bool=false, bool=false)
Skip events with threshold on integral.
void SmoothAll(double, int)
Smoothing all waveforms which are not skipped (for testing, careful when using for analysis!...
int binNumber
Number of bins (usually 1024 samples per waveform).
void SkipEventsTimeDiffCut(int, int, double, double, bool=false)
Skip events where the time difference between two channels is outside of specified range.
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 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.