32 TFile*
f = TFile::Open(inFilename.c_str(),
"READ");
35 if (
f == 0 || !
f->IsOpen()) {
50 if (
f->GetSize() < 1000.) {
57 TIter next_run(
f->GetListOfKeys());
59 TString minbiasmonDirName;
61 std::vector< std::pair<TString, TString> >* v_targetNames =
new std::vector< std::pair<TString, TString> >(0);
65 while ((key_run =
dynamic_cast<TKey*
>(next_run())) != 0) {
66 TObject* obj_run = key_run->ReadObj();
67 TDirectory* tdir_run =
dynamic_cast<TDirectory*
>(obj_run);
76 std::string runDirName(tdir_run->GetName());
79 if (runDirName.find(
"run") == std::string::npos) {
85 minbiasmonDirName = runDirName +
"/HLT/MinBiasMon";
86 TDirectory* minbiasmonDir(0);
87 if (!(minbiasmonDir =
f->GetDirectory(minbiasmonDirName))) {
98 f = TFile::Open(inFilename.c_str(),
"UPDATE");
100 const TString repPath = TString(
f->GetPath());
103 f->cd(minbiasmonDirName);
106 TH1F* h_triggEfficPass =
dynamic_cast<TH1F*
>(
gDirectory->Get(
"TriggerEfficienciesPassed"));
107 TH1F* h_triggEfficAll =
dynamic_cast<TH1F*
>(
gDirectory->Get(
"TriggerEfficienciesAll"));
108 if (!h_triggEffic or !h_triggEfficPass or !h_triggEfficAll) {
109 std::cerr <<
"Dynamic cast failed in MonitoringFile::HLTMinBiasMonPostProcess\n";
112 delete v_targetNames;
116 h_triggEffic->Divide(h_triggEfficPass, h_triggEfficAll, 1., 1.,
"B");
117 h_triggEffic->GetYaxis()->SetRangeUser(0., 1.2);
118 h_triggEffic->Write(
"", TObject::kOverwrite);
120 for (
uint k = 0;
k < v_targetNames->size();
k++) {
121 v_targetNames->at(
k).first.ReplaceAll(repPath,
"");
123 f->cd(v_targetNames->at(
k).first);
126 TH1F* h_num =
dynamic_cast<TH1F*
>(
gDirectory->Get(v_targetNames->at(
k).second +
"Passed"));
129 if (h_target != 0 && h_num != 0 && h_den != 0) {
130 h_target->Divide(h_num, h_den, 1., 1.,
"B");
131 h_target->GetYaxis()->SetRangeUser(0., 1.2);
132 h_target->Write(
"", TObject::kOverwrite);
135 v_targetNames->clear();
136 delete v_targetNames;
144 TString > >& targetNames)
147 TIter nextkey(
source->GetListOfKeys());
149 while ((
key = (TKey*) nextkey())) {
150 const char* classname =
key->GetClassName();
151 TClass*
cl = gROOT->GetClass(classname);
153 if (
cl->InheritsFrom(TDirectory::Class())) {
154 TString kname =
key->GetName();
160 if (
cl->InheritsFrom(TH1F::Class())) {
161 TString cRatio = TString(
key->GetName());
162 if (cRatio ==
"Efficiency" ||
163 cRatio ==
"Purity" ||
164 cRatio ==
"EfficienciesTrigger" ||
165 cRatio ==
"EfficiencyTracks" ||
167 "TriggerPurities") targetNames.push_back(std::pair<TString, TString>(TString(
gDirectory->GetPath()),
168 TString(
key->GetName())));