10#include "FairRootManager.h"
38 int ndigis = digis.size();
41 ss.precision(ndigis + precision);
50 static const T ZERO = 0;
51 return (
x > ZERO) ? 1 : ((
x < ZERO) ? -1 : 0);
60 T*
GetOrFatal(
const std::string& objName,
const std::string& description =
"")
62 FairRootManager* ioman = FairRootManager::Instance();
63 if (ioman ==
nullptr) { LOG(fatal) << description <<
" No FairRootManager!"; }
64 T* obj =
static_cast<T*
>(ioman->GetObject(objName.c_str()));
65 if (obj ==
nullptr) { LOG(fatal) << description <<
" No " << objName <<
" object!"; }
76 void SaveCanvasAsImage(TCanvas* c,
const std::string& dir,
const std::string& option =
"eps;png;gif");
78 const std::string& option);
80 std::string
FindAndReplace(
const std::string& name,
const std::string& oldSubstr,
const std::string& newSubstr);
82 std::vector<std::string>
Split(
const std::string& name,
char delimiter);
92 TH1D*
DivideH1(TH1* h1, TH1* h2,
const std::string& histName =
"",
double scale = 100.,
93 const std::string& titleYaxis =
"Efficiency [%]");
104 TH2D*
DivideH2(TH2* h1, TH2* h2,
const std::string& histName =
"",
double scale = 100.,
105 const std::string& titleZaxis =
"Efficiency [%]");
Access to a MC data branch for time-based analysis.
TH1D * DivideH1(TH1 *h1, TH1 *h2, const string &histName, double scale, const string &titleYaxis)
T * GetOrFatal(const std::string &objName, const std::string &description="")
void SaveCanvasAsImage(TCanvas *c, const string &dir, const string &option)
string FindAndReplace(const string &name, const string &oldSubstr, const string &newSubstr)
vector< string > Split(const string &name, char delimiter)
std::string ToString(const T &value)
TH2D * DivideH2(TH2 *h1, TH2 *h2, const string &histName, double scale, const string &titleZaxis)
CbmMCDataArray * InitOrFatalMc(const std::string &objName, const std::string &description)
void SaveCanvasAsImageImpl(const string &imageType, TCanvas *c, const string &dir, const string &option)
std::string NumberToString(const T &value, int precision=1)