39 bool dbgLevel =
false;
41 if (dbgLevel) std::cout <<
"--> HLTMETAveragePhivsEtaMaps: <Quantity(eta,phi)> = Quantity(eta,phi)/N(eta,phi) " << std::endl;
44 TIter next_run(
f->GetListOfKeys());
46 while ((key_run =
dynamic_cast<TKey*
> (next_run())) != 0) {
47 if (!key_run->IsFolder())
continue;
48 run_dir = key_run->GetName();
49 if (!run_dir.Contains(
"run")) {
54 std::string run_dir2 = run_dir.Data();
65 TString hlt_top = run_dir +
"/HLT";
66 TString met_efdir =
"/EFMissingET_Fex";
68 std::vector<TString> met_fexs, hist_numr;
71 met_fexs.push_back(
"/METMon");
77 TString theHistDir = hlt_top + *
it;
78 TDirectory*
dir =
f->GetDirectory(theHistDir);
80 std::cerr <<
"--> HLTMETAveragePhivsEtaMaps: directory " << theHistDir <<
" not found" << std::endl;
84 theHistDir += met_efdir;
85 dir =
f->GetDirectory(theHistDir);
87 std::cerr <<
"--> HLTMETAveragePhivsEtaMaps: directory " << theHistDir <<
" not found" << std::endl;
94 hist_numr.push_back(
"/compEt_lin_");
95 hist_numr.push_back(
"/compSumEt_lin_");
96 hist_numr.push_back(
"/compSumE_lin_");
99 TString hist_denr =
"/compN_";
102 TString hist_suffix =
"EtaPhi_";
105 unsigned int comp_num = 25;
110 for (
unsigned int icomp = 0; icomp < comp_num; icomp++) {
111 TH2F* hnum(0), *hden(0);
114 TString thePath = hlt_top + (*itFex) + met_efdir;
115 TString numHist = (*itNum) + hist_suffix + TString(Form(
"%02u", icomp));
116 TString denHist = hist_denr + hist_suffix + TString(Form(
"%02u", icomp));
117 TString numPath = thePath + numHist;
118 TString denPath = thePath + denHist;
121 if (!
f->Get(numPath)) {
122 if (dbgLevel) std::cerr <<
"--> HLTMETAveragePhivsEtaMaps: no histogram " << numPath << std::endl;
125 if (!
f->Get(denPath)) {
126 if (dbgLevel) std::cerr <<
"--> HLTMETAveragePhivsEtaMaps: no histogram " << denPath << std::endl;
131 hnum = (
TH2F*) (
f->Get(numPath));
132 hden = (
TH2F*) (
f->Get(denPath));
135 TDirectory*
dir =
f->GetDirectory(thePath);
145 hnum->Divide(hnum, hden);
148 TString
title = hnum->GetTitle();
149 title.ReplaceAll(
": ",
": #LT");
150 title.ReplaceAll(
"(#eta",
"#GT(#eta");
151 hnum->SetTitle(
title);
167 hnum->Write(
"", TObject::kOverwrite);