27 if (
debugLevel > 1) std::cout <<
"--> HLTCaloAveragePtPhiEtaMaps: <Quantity(eta,phi)> = Quantity(eta,phi)/N(eta,phi) " << std::endl;
30 TIter next_run(
f->GetListOfKeys());
32 while ((key_run =
dynamic_cast<TKey*
> (next_run())) != 0) {
33 if (!key_run->IsFolder())
continue;
34 run_dir = key_run->GetName();
35 if (!run_dir.Contains(
"run")) {
39 std::string run_dir2 = run_dir.Data();
50 TString hlt_top = run_dir +
"/HLT";
52 std::vector<TString> calo_fold;
53 std::vector<std::pair<TString, TString> > hist_numr;
56 calo_fold.push_back(
"/CaloMon");
57 calo_fold.push_back(
"/CaloMonL2");
61 TString theHistDir = hlt_top + *
it;
62 TDirectory*
dir =
f->GetDirectory(theHistDir);
64 if (
debugLevel > 0) std::cerr <<
"--> HLTCaloAveragePtPhiEtaMaps: directory " << theHistDir <<
" not found" << std::endl;
70 hist_numr.push_back(std::make_pair<TString, TString>(
"/EnergyAccetaphiLAr",
"/HitAccetaphiLAr"));
71 hist_numr.push_back(std::make_pair<TString, TString>(
"/EnergyAccetaphiTile",
"/HitAccetaphiTile"));
76 for (std::vector<std::pair<TString, TString> >::
iterator itNum = hist_numr.begin(); itNum != hist_numr.end(); ++itNum) {
77 TH2F* hnum(0), *hden(0);
80 TString thePath = hlt_top + (*itFex);
81 TString numPath = thePath + (*itNum).first;
82 TString denPath = thePath + (*itNum).second;
85 hnum = (
TH2F*) (
f->Get(numPath));
86 hden = (
TH2F*) (
f->Get(denPath));
89 if (
debugLevel > 0) std::cerr <<
"--> HLTCaloAveragePtPhiEtaMaps: no histogram " << numPath << std::endl;
93 if (
debugLevel > 0) std::cerr <<
"--> HLTCaloAveragePtPhiEtaMaps: no histogram " << denPath << std::endl;
99 TDirectory*
dir =
f->GetDirectory(thePath);
106 hnum->Divide(hnum, hden);
109 TString
title = hnum->GetTitle();
110 hnum->SetTitle(
"Average Transverse Energy per eta/phi bin");
113 hnum->Write(
"", TObject::kOverwrite);