wavecatcher-analysis
Loading...
Searching...
No Matches
Helpers Class Reference

#include <Helpers.h>

Static Public Member Functions

static double * gety (TH1F *)
 Get array of y values for a histogram.
 
static double * gety (TH1F *, int, int)
 Get truncated array of y values for a certain waveform.
 
static string ListFiles (const char *, const char *)
 Helper. Creates a list of .bin data files in data folder to be read in.
 
static void PrintProgressBar (int, int)
 Print progress bar for a loop in steps of 10 percent.
 
static int rcolor (unsigned int)
 Translate a random number into a useful root color https://root.cern.ch/doc/master/classTColor.html.
 
static void SetRangeCanvas (TCanvas *&, double, double, double=-999, double=-999)
 Set consistent x-axis and y-axis range for all TH1 histograms on a canvas.
 
static void ShiftTH1F (TH1F *&, int=0)
 Shift a histogram in x.
 
static void SplitCanvas (TCanvas *&, vector< int >, vector< int >)
 Helper to split canvas according to the number of channels to be plotted.
 

Detailed Description

Definition at line 18 of file Helpers.h.

Member Function Documentation

◆ gety() [1/2]

double * Helpers::gety ( TH1F *  his)
static

Get array of y values for a histogram.

Parameters
hisTH1F histogram
Returns
Y values of waveform

Definition at line 125 of file Helpers.cc.

◆ gety() [2/2]

double * Helpers::gety ( TH1F *  his,
int  start_at,
int  end_at 
)
static

Get truncated array of y values for a certain waveform.

Parameters
hisWaveform histogram
start_atTruncate from index
end_atTruncate to index
Returns
Truncated Y values of waveform

Definition at line 138 of file Helpers.cc.

◆ ListFiles()

string Helpers::ListFiles ( const char *  dirname,
const char *  ext 
)
static

Helper. Creates a list of .bin data files in data folder to be read in.

Parameters
dirnameDirectory
extFile extension
Returns
String of line separated file names

Definition at line 7 of file Helpers.cc.

◆ PrintProgressBar()

void Helpers::PrintProgressBar ( int  index,
int  length 
)
static

Print progress bar for a loop in steps of 10 percent.

Parameters
indexCurrent loop index
lengthLength of loop

Definition at line 28 of file Helpers.cc.

◆ rcolor()

int Helpers::rcolor ( unsigned int  i)
static

Translate a random number into a useful root color https://root.cern.ch/doc/master/classTColor.html.

Parameters
iIndex of your plotting loop that is to be translated into a useful ROOT color index
Returns
ROOT color index
Examples
use_functions_wo_measurement.cc.

Definition at line 44 of file Helpers.cc.

◆ SetRangeCanvas()

void Helpers::SetRangeCanvas ( TCanvas *&  c,
double  x_range_min,
double  x_range_max,
double  y_range_min = -999,
double  y_range_max = -999 
)
static

Set consistent x-axis and y-axis range for all TH1 histograms on a canvas.

Will only change the axes where min != max.

Parameters
cCanvas Canvas
x_range_minX-axis minimum
x_range_maxX-axis maximum
y_range_minY-axis minimum
y_range_maxY-axis maximum

Definition at line 59 of file Helpers.cc.

◆ ShiftTH1F()

void Helpers::ShiftTH1F ( TH1F *&  his,
int  shift_bins = 0 
)
static

Shift a histogram in x.

The histogram will be cycled, so bins at the end will be attached at the front and vice versa

Parameters
hisHistogram to be shifted
shift_binsNumber of bins in x to shift by

Definition at line 157 of file Helpers.cc.

◆ SplitCanvas()

void Helpers::SplitCanvas ( TCanvas *&  c,
vector< int >  active_channels,
vector< int >  plot_active_channels 
)
static

Helper to split canvas according to the number of channels to be plotted.

Parameters
cCanvas to be split
active_channelsAll channels available in the data
plot_active_channelsThe channels from the data that should be plotted

Definition at line 97 of file Helpers.cc.


The documentation for this class was generated from the following files: