18 SP *=
static_cast<float>(ngroup);
20 float norm = 1. /
static_cast<float>(ngroup);
21 cout <<
"\nRebinning the data to a new sampling rate of " << 1. /
SP
22 <<
" GS/s which corresponds to a bin size of " <<
SP <<
" ns and the data now has " <<
binNumber <<
" bins" << endl;
24 for (
int j = 0; j <
nwf; j++) {
29 if (noise_level != 0.) {
30 auto noise =
new TRandom3();
32 for (
int i = 1; i <= his->GetNbinsX(); i++) his->SetBinContent(i, his->GetBinContent(i) + noise->Gaus(0, noise_level));
43 cout <<
"\nForward derivative of all waveforms:" << endl;
44 for (
int j = 0; j <
nwf; j++) {
47 for (
int i = 1; i <= his->GetNbinsX() - 1; i++) his->SetBinContent(i, yvals[i + 1] - yvals[i]);
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 DerivativeAll()
Derivative of all waveforms.
static void PrintProgressBar(int, int)
Print progress bar for a loop in steps of 10 percent.
static double * gety(TH1F *)
Get array of y values for a histogram.
TH1F * Getwf(int)
Helper that returns the waveform histogram for a certain waveform number number.
int nwf
Total number of waveforms read from data: number of active channels x number of events.
int binNumber
Number of bins (always 1024 samples per waveform). Do not change!
float SP
Sampling: ns per bin of data, sampling rate 3.2 GS/s -> 0.3125 ns.