9#include "TDirectoryFile.h"
17 std::vector<TFile*>& cut_files, TDirectory* directory,
const char* name)
18 : fFrag(std::move(frag)), fObjects(objects), fGates(gates), fCut_files(cut_files), fDirectory(directory)
26 : fFrag(nullptr), fObjects(objects), fGates(gates), fCut_files(cut_files), fDirectory(directory)
34 FillHistogram(
"General", name, bins, low, high, value, weight);
38TH2*
TRuntimeObjects::FillHistogram(
const char* name,
int Xbins,
double Xlow,
double Xhigh,
double Xvalue,
int Ybins,
double Ylow,
double Yhigh,
double Yvalue,
double weight)
40 FillHistogram(
"General", name, Xbins, Xlow, Xhigh, Xvalue, Ybins, Ylow, Yhigh, Yvalue, weight);
52 FillHistogramSym(
"General", name, Xbins, Xlow, Xhigh, Xvalue, Ybins, Ylow, Yhigh, Yvalue);
61 auto*
hist =
static_cast<TH1*
>(dir->FindObject(name));
63 hist =
new TH1D(name, name, bins, low, high);
64 hist->SetDirectory(dir);
68 if(!std::isnan(value)) {
69 hist->Fill(value, weight);
75 double Xvalue,
int Ybins,
double Ylow,
double Yhigh,
double Yvalue,
79 auto*
hist =
static_cast<TH2*
>(dir->FindObject(name));
81 hist =
new TH2D(name, name, Xbins, Xlow, Xhigh, Ybins, Ylow, Yhigh);
82 hist->SetDirectory(dir);
86 if(!std::isnan(Xvalue) && !std::isnan(Yvalue)) {
87 hist->Fill(Xvalue, Yvalue, weight);
93 double Xhigh,
double Xvalue,
double Yvalue)
97 auto* prof =
static_cast<TProfile*
>(dir->FindObject(name));
99 prof =
new TProfile(name, name, Xbins, Xlow, Xhigh);
100 prof->SetDirectory(dir);
104 if(!(std::isnan(Xvalue))) {
105 if(!(std::isnan(Yvalue))) {
106 prof->Fill(Xvalue, Yvalue);
113 double Xhigh,
double Xvalue,
int Ybins,
double Ylow,
double Yhigh,
117 auto*
hist =
static_cast<TH2*
>(dir->FindObject(name));
118 if(
hist ==
nullptr) {
119 hist =
new TH2D(name, name, Xbins, Xlow, Xhigh, Ybins, Ylow, Yhigh);
120 hist->SetDirectory(dir);
123 if(!(std::isnan(Xvalue))) {
124 if(!(std::isnan(Yvalue))) {
125 hist->Fill(Xvalue, Yvalue);
126 hist->Fill(Yvalue, Xvalue);
146 TObject* obj = tfile->Get(name.c_str());
148 auto* cut =
static_cast<TCutG*
>(obj);
164 auto* dir =
static_cast<TDirectory*
>(
GetObjects().FindObject(dirname));
166 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)