11#include "TDirectoryFile.h"
22 std::vector<TFile*>& cut_files, TDirectory* directory,
const char* name)
23 : fFrag(std::move(frag)), fObjects(objects), fGates(gates), fCut_files(cut_files), fDirectory(directory)
31 : fFrag(nullptr), fObjects(objects), fGates(gates), fCut_files(cut_files), fDirectory(directory)
39 FillHistogram(
"General", name, bins, low, high, value, weight);
43TH2*
TRuntimeObjects::FillHistogram(
const char* name,
int Xbins,
double Xlow,
double Xhigh,
double Xvalue,
int Ybins,
double Ylow,
double Yhigh,
double Yvalue,
double weight)
45 FillHistogram(
"General", name, Xbins, Xlow, Xhigh, Xvalue, Ybins, Ylow, Yhigh, Yvalue, weight);
57 FillHistogramSym(
"General", name, Xbins, Xlow, Xhigh, Xvalue, Ybins, Ylow, Yhigh, Yvalue);
66 auto*
hist =
static_cast<TH1*
>(dir->FindObject(name));
68 hist =
new TH1D(name, name, bins, low, high);
69 hist->SetDirectory(dir);
73 if(!std::isnan(value)) {
74 hist->Fill(value, weight);
80 double Xvalue,
int Ybins,
double Ylow,
double Yhigh,
double Yvalue,
84 auto*
hist =
static_cast<TH2*
>(dir->FindObject(name));
86 hist =
new TH2D(name, name, Xbins, Xlow, Xhigh, Ybins, Ylow, Yhigh);
87 hist->SetDirectory(dir);
91 if(!std::isnan(Xvalue) && !std::isnan(Yvalue)) {
92 hist->Fill(Xvalue, Yvalue, weight);
98 double Xhigh,
double Xvalue,
double Yvalue)
102 auto* prof =
static_cast<TProfile*
>(dir->FindObject(name));
103 if(prof ==
nullptr) {
104 prof =
new TProfile(name, name, Xbins, Xlow, Xhigh);
105 prof->SetDirectory(dir);
109 if(!(std::isnan(Xvalue))) {
110 if(!(std::isnan(Yvalue))) {
111 prof->Fill(Xvalue, Yvalue);
118 double Xhigh,
double Xvalue,
int Ybins,
double Ylow,
double Yhigh,
122 auto*
hist =
static_cast<TH2*
>(dir->FindObject(name));
123 if(
hist ==
nullptr) {
124 hist =
new TH2D(name, name, Xbins, Xlow, Xhigh, Ybins, Ylow, Yhigh);
125 hist->SetDirectory(dir);
128 if(!(std::isnan(Xvalue))) {
129 if(!(std::isnan(Yvalue))) {
130 hist->Fill(Xvalue, Yvalue);
131 hist->Fill(Yvalue, Xvalue);
151 TObject* obj = tfile->Get(name.c_str());
153 auto* cut =
static_cast<TCutG*
>(obj);
169 auto* dir =
static_cast<TDirectory*
>(
GetObjects().FindObject(dirname));
171 dir =
new TDirectory(dirname, dirname);
static double Value(const std::string &)
std::vector< TFile * > & fCut_files
TCutG * GetCut(const std::string &name)
TDirectory * FindDirectory(const char *)
TRuntimeObjects(std::shared_ptr< const TFragment > frag, TList *objects, TList *gates, std::vector< TFile * > &cut_files, TDirectory *directory=nullptr, const char *name="default")
Constructor.
double GetVariable(const char *name) const
static std::map< std::string, TRuntimeObjects * > fRuntimeMap
TH1 * FillHistogram(const char *name, int bins, double low, double high, double value, double weight=1)
TProfile * FillProfileHist(const char *name, int Xbins, double Xlow, double Xhigh, double Xvalue, double Yvalue)
TH2 * FillHistogramSym(const char *name, int Xbins, double Xlow, double Xhigh, double Xvalue, int Ybins, double Ylow, double Yhigh, double Yvalue)