ra4_draw  4bd0201e3d922d42bd545d4b045ed44db33454a4
Functions
utilities.cpp File Reference
#include "core/utilities.hpp"
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <cmath>
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include <unistd.h>
#include <glob.h>
#include <libgen.h>
#include "TMath.h"
#include "TCanvas.h"
#include "TVector2.h"
#include "TH1D.h"
#include "RooStats/RooStatsUtils.h"

Go to the source code of this file.

Functions

set< string > Glob (const string &pattern)
 
string Basename (const string &filename)
 
bool Contains (const string &str, const string &pat)
 
bool StartsWith (const string &str, const string &pat)
 
void ReplaceAll (string &str, const string &orig, const string &rep)
 
string CopyReplaceAll (string str, const string &orig, const string &rep)
 
string execute (const string &cmd)
 
string CodeToPlainText (string code)
 
string CodeToRootTex (string code)
 
string CodeToLatex (string code)
 
vector< string > Tokenize (const string &input, const string &tokens)
 
string MakeDir (string prefix)
 
void AdjustDensityForBinWidth (TH1D &h)
 
void Normalize (TH1D &h, double normalization, bool norm_per_avg_width)
 
void MergeOverflow (TH1D &h, bool merge_underflow, bool merge_overflow)
 
string FixedDigits (double x, int n_digits)
 
string FullTitle (const TH1 &h)
 
TString HoursMinSec (float fseconds)
 
TString AddCommas (double num)
 
TString RoundNumber (double num, int decimals, double denom)
 
double gsl_ran_gamma (const double a, const double b, TRandom3 &rand)
 
double intGaus (double mean, double sigma, double minX, double maxX)
 
float deltaR (float eta1, float phi1, float eta2, float phi2)
 
double Significance (double Nobs, double Nbkg, double Eup_bkg, double Edown_bkg)
 
double calcKappa (vector< vector< float > > &entries, vector< vector< float > > &weights, vector< float > &powers, float &mSigma, float &pSigma, bool do_data, bool verbose, double syst, bool do_plot, int nrep)
 

Function Documentation

TString AddCommas ( double  num)

Definition at line 351 of file utilities.cpp.

Referenced by PlotMaker::GetYields(), and ToLongString().

void AdjustDensityForBinWidth ( TH1D &  h)

Definition at line 273 of file utilities.cpp.

Referenced by ApplyPermutation(), and Hist1D::ScaleHistos().

string Basename ( const string &  filename)

Definition at line 38 of file utilities.cpp.

Referenced by PlotMaker::GetYield().

double calcKappa ( vector< vector< float > > &  entries,
vector< vector< float > > &  weights,
vector< float > &  powers,
float &  mSigma,
float &  pSigma,
bool  do_data,
bool  verbose,
double  syst,
bool  do_plot,
int  nrep 
)
string CodeToLatex ( string  code)

Definition at line 242 of file utilities.cpp.

References CodeToRootTex(), and ReplaceAll().

Referenced by main(), and printTable().

string CodeToPlainText ( string  code)
string CodeToRootTex ( string  code)

Definition at line 116 of file utilities.cpp.

References ReplaceAll().

Referenced by CodeToLatex(), plotKappa(), plotRatio(), Table::PrintPie(), and Hist1D::Title().

bool Contains ( const string &  str,
const string &  pat 
)

Definition at line 44 of file utilities.cpp.

Referenced by anonymous_namespace{hist1d.cpp}::DrawAll(), main(), and Table::PrintPie().

string CopyReplaceAll ( string  str,
const string &  orig,
const string &  rep 
)

Definition at line 60 of file utilities.cpp.

References ReplaceAll().

float deltaR ( float  eta1,
float  phi1,
float  eta2,
float  phi2 
)

Definition at line 420 of file utilities.cpp.

Referenced by Functions::NISRMatch(), nisrMatch(), and ToLongString().

string execute ( const string &  cmd)

Definition at line 65 of file utilities.cpp.

Referenced by SlideMaker::Close(), and main().

string FixedDigits ( double  x,
int  n_digits 
)

Definition at line 316 of file utilities.cpp.

Referenced by Hist1D::AddEntries(), and ApplyPermutation().

string FullTitle ( const TH1 &  h)

Definition at line 331 of file utilities.cpp.

Referenced by ApplyPermutation(), Expand(), and Clustering::Clusterizer::GetGraph().

set<string> Glob ( const string &  pattern)

Definition at line 27 of file utilities.cpp.

Referenced by Process::Process().

double gsl_ran_gamma ( const double  a,
const double  b,
TRandom3 &  rand 
)

Definition at line 386 of file utilities.cpp.

Referenced by calcKappa(), and ToLongString().

TString HoursMinSec ( float  fseconds)

Definition at line 337 of file utilities.cpp.

Referenced by PlotMaker::GetYields(), main(), and ToLongString().

double intGaus ( double  mean,
double  sigma,
double  minX,
double  maxX 
)

Definition at line 416 of file utilities.cpp.

Referenced by calcKappa(), and ToLongString().

string MakeDir ( string  prefix)

Definition at line 262 of file utilities.cpp.

Referenced by ApplyPermutation().

void MergeOverflow ( TH1D &  h,
bool  merge_underflow,
bool  merge_overflow 
)

Definition at line 300 of file utilities.cpp.

Referenced by ApplyPermutation().

void Normalize ( TH1D &  h,
double  normalization,
bool  norm_per_avg_width 
)

Definition at line 290 of file utilities.cpp.

Referenced by ApplyPermutation(), and Hist1D::NormalizeHistos().

void ReplaceAll ( string &  str,
const string &  orig,
const string &  rep 
)
TString RoundNumber ( double  num,
int  decimals,
double  denom 
)
double Significance ( double  Nobs,
double  Nbkg,
double  Eup_bkg,
double  Edown_bkg 
)

Definition at line 426 of file utilities.cpp.

Referenced by ToLongString(), and Zbi().

bool StartsWith ( const string &  str,
const string &  pat 
)

Definition at line 48 of file utilities.cpp.

vector<string> Tokenize ( const string &  input,
const string &  tokens 
)

Definition at line 248 of file utilities.cpp.

Referenced by ApplyPermutation().