4 #include "TDirectory.h"
15 _file(file), _runnumber(run), _module(mod), _path(path), _prefix(prefix) { }
18 _file(dtca._file), _runnumber(dtca._runnumber), _module(dtca._module), _path(dtca._path),
19 _prefix(dtca._prefix){ }
50 bool ok =
_file->cd(fullpath.c_str());
51 if(ok && gDirectory) {
52 obj = gDirectory->Get(name);
64 if(!strstr(obj->GetTitle(),
"run")) {
67 obj->SetTitle(htitle);
76 std::vector<unsigned int>
runlist;
80 bool ok =
_file->cd(fullpath.c_str());
81 if(ok && gDirectory) {
82 TList*
keys = gDirectory->GetListOfKeys();
85 while((key=(TKey*)it.Next())) {
87 TClass
cl(key->GetClassName());
88 if (
cl.InheritsFrom(
"TDirectory") && strstr(key->GetName(),
"run_") != 0 ) {
90 sscanf(key->GetName(),
"run_%u",&
run);
91 runlist.push_back(run);
104 TH1F* den = (TH1F*)denom.
getObject(name);
108 if(den!=0 && num!=0) {
113 denreb = (TH1F*)den->Rebin(rebin,
"denrebinned");
114 numreb = (TH1F*)num->Rebin(rebin,
"numrebinned");
117 ratio =
new TH1F(*numreb);
118 ratio->SetDirectory(0);
121 ratio->Divide(numreb,denreb,1,1,
"B");
TH1F * getBinomialRatio(const CommonAnalyzer &denom, const char *name, const int rebin=-1) const
const std::string & getRunNumber() const
TNamed * getObjectWithSuffix(const char *name, const char *suffix="") const
void setRunNumber(const char *run)
TObject * getObject(const char *name) const
const std::string & getPath() const
void setModule(const char *mod)
const std::string & getPrefix() 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
const std::string & getModule() const
void setFile(TFile *file)
void setPrefix(const char *prefix)
T mod(const T &a, const T &b)