wavecatcher-analysis
Loading...
Searching...
No Matches
Helpers.h
Go to the documentation of this file.
1
2#ifndef _Helpers
3#define _Helpers
4
5#include <TSystemDirectory.h>
6#include <TList.h>
7#include <TObjString.h>
8#include <TCanvas.h>
9#include <TH1.h>
10#include <TMath.h>
11
12#include <iostream>
13#include <sstream>
14#include <vector>
15
16using namespace std;
17
18class Helpers {
19public:
20 // find data files
21 static string ListFiles(const char*, const char*);
22
23 // progress bar
24 static void PrintProgressBar(int, int);
25
26 // use in loop, skips some poorly visible root colors (like white on white)
27 static int rcolor(unsigned int);
28
29 // set consistent ranges
30 static void SetRangeCanvas(TCanvas*&, double, double, double = -999, double = -999);
31 // split canvas into pads to display all active channels on one canvas
32 static void SplitCanvas(TCanvas*&, vector<int>, vector<int>);
33
34 // get y values of a histogram
35 static double* gety(TH1F*);
36 // get y values of a histogram for a dedicated x range
37 static double* gety(TH1F*, int, int);
38
39 // shift a TH1F in x
40 static void ShiftTH1F(TH1F*&, int = 0);
41};
42#endif
static void SplitCanvas(TCanvas *&, vector< int >, vector< int >)
Helper to split canvas according to the number of channels to be plotted.
Definition Helpers.cc:97
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.
Definition Helpers.cc:59
static void ShiftTH1F(TH1F *&, int=0)
Shift a histogram in x.
Definition Helpers.cc:157
static int rcolor(unsigned int)
Translate a random number into a useful root color https://root.cern.ch/doc/master/classTColor....
Definition Helpers.cc:44
static void PrintProgressBar(int, int)
Print progress bar for a loop in steps of 10 percent.
Definition Helpers.cc:28
static double * gety(TH1F *)
Get array of y values for a histogram.
Definition Helpers.cc:125
static string ListFiles(const char *, const char *)
Helper. Creates a list of .bin data files in data folder to be read in.
Definition Helpers.cc:7