4 #include "TDirectory.h" 18 : _file(dtca._file), _runnumber(dtca._runnumber), _module(dtca._module), _path(dtca._path), _prefix(dtca._prefix) {}
43 TObject*
obj =
nullptr;
48 if (
ok && gDirectory) {
59 if (!strstr(
obj->GetTitle(),
"run")) {
62 obj->SetTitle(htitle);
73 std::vector<unsigned int>
runlist;
74 char searchstring[100];
75 char decodestring[100];
76 sprintf(searchstring,
"%s_", what);
77 sprintf(decodestring,
"%s_%%u", what);
82 if (
ok && gDirectory) {
83 TList*
keys = gDirectory->GetListOfKeys();
86 while ((
key = (TKey*)it.Next())) {
88 TClass
cl(
key->GetClassName());
89 if (
cl.InheritsFrom(
"TDirectory") && strstr(
key->GetName(), searchstring) !=
nullptr) {
91 sscanf(
key->GetName(), decodestring, &
run);
102 TH1F* den = (TH1F*)
denom.getObject(
name);
104 TH1F*
ratio =
nullptr;
106 if (den !=
nullptr &&
num !=
nullptr) {
110 denreb = (TH1F*)den->Rebin(rebin,
"denrebinned");
111 numreb = (TH1F*)
num->Rebin(rebin,
"numrebinned");
114 ratio =
new TH1F(*numreb);
115 ratio->SetDirectory(
nullptr);
118 ratio->Divide(numreb, denreb, 1, 1,
"B");
const std::string & getPrefix() const
void setRunNumber(const char *run)
const std::string & getModule() const
TH1F * getBinomialRatio(const CommonAnalyzer &denom, const char *name, const int rebin=-1) const
TNamed * getObjectWithSuffix(const char *name, const char *suffix="") const
const std::string & getRunNumber() const
TObject * getObject(const char *name) const
void setModule(const char *mod)
const std::string & getPath() const
CommonAnalyzer & operator=(const CommonAnalyzer &dtca)
void setPath(const char *path)
CommonAnalyzer(TFile *file, const char *run, const char *mod, const char *path="", const char *prefix="")
const std::vector< unsigned int > getRunList() const
void setFile(TFile *file)
void setPrefix(const char *prefix)
T mod(const T &a, const T &b)
const std::vector< unsigned int > getFillList() const
const std::vector< unsigned int > getList(const char *what) const