41 TH1::AddDirectory(
false);
43 B2DEBUG(1,
"DQMHistReference: reading references from input root file");
46 if (run_type ==
"") run_type =
"default";
48 B2INFO(
"DQMHistReference: run_type " << run_type);
52 if (refFile->IsZombie()) {
53 B2INFO(
"DQMHistReference: reference file " <<
m_referenceFileName <<
" does not exist. No references will be used!");
61 TIter nextRefDirKey(refFile->GetListOfKeys());
63 while ((refDirKey =
dynamic_cast<TKey*
>(nextRefDirKey()))) {
64 if (refDirKey->IsFolder() &&
string(refDirKey->GetName()) ==
string(
"ref")) {
65 TDirectory* refDir =
static_cast<TDirectory*
>(refDirKey->ReadObj());
66 TIter nextDetDirKey(refDir->GetListOfKeys());
69 while ((detDirKey =
dynamic_cast<TKey*
>(nextDetDirKey()))) {
70 if (!detDirKey->IsFolder())
continue;
71 TDirectory* detDir =
static_cast<TDirectory*
>(detDirKey->ReadObj());
72 TIter nextRunTypeDirKey(detDir->GetListOfKeys());
74 TDirectory* runtypeDir =
nullptr;
76 while ((runtypeDirKey =
dynamic_cast<TKey*
>(nextRunTypeDirKey()))) {
77 if (!runtypeDirKey->IsFolder())
continue;
78 if (
string(runtypeDirKey->GetName()) == run_type) {
79 if (runtypeDir)
delete runtypeDir;
80 runtypeDir =
static_cast<TDirectory*
>(runtypeDirKey->ReadObj());
85 if (
string(runtypeDirKey->GetName()) ==
"default") runtypeDir =
static_cast<TDirectory*
>(runtypeDirKey->ReadObj());
87 string detName = detDir->GetName();
90 B2INFO(
"No run type specific or default references available for " << detName);
92 B2INFO(
"Reading reference histograms for " << detName <<
" from run type folder: " << runtypeDir->GetName());
94 TIter nextHistkey(runtypeDir->GetListOfKeys());
97 while ((histKey =
dynamic_cast<TKey*
>(nextHistkey()))) {
98 if (histKey->IsFolder())
continue;
99 if (gROOT->GetClass(histKey->GetClassName())->InheritsFrom(
"TH1")) {
100 auto h =
dynamic_cast<TH1*
>(histKey->ReadObj());
112 B2INFO(
"DQMHistReference: read references done");
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.