38 static const bool fpdbg =
false;
43 if (fpdbg) std::cout <<
"Start HLTMuon post-processing" << std::endl;
52 if (fpdbg) std::cout <<
"Finish HLTMuon post-processing" << std::endl;
61 std::cerr <<
"HLTMuon PostProcessing: no such histogram!! : " <<
hname << std::endl;
72 if (fpdbg) std::cout <<
" Start to fill HLTMuon Trigger Overlap Matrix" << std::endl;
76 std::cerr <<
"HLTMuonPostProcess(): "
77 <<
"Input file not opened \n";
80 if (
mf.GetSize() < 1000.) {
81 std::cerr <<
"HLTMuonPostProcess(): "
82 <<
"Input file empty \n";
88 TKey* key0 = (TKey*) nextcd0();
89 TDirectory* dir0 =
dynamic_cast<TDirectory*
> (key0->ReadObj());
91 std::cerr <<
"nullptr for dynamic cast in HLTMuonTriggerOverlapMatrix" << std::endl;
97 TIter next_run(
mf.GetListOfKeys());
99 while ((key_run =
dynamic_cast<TKey*
> (next_run())) != 0) {
100 if (!key_run->IsFolder())
continue;
101 run_dir = key_run->GetName();
102 if (!run_dir.Contains(
"run")) {
107 if (!run_dir.Contains(
"run")) {
108 std::cerr <<
"HLTMuon: unable to find run directory ..." << std::endl;
115 std::cout <<
"HLTMuon: run directory is " << run_dir << std::endl;
118 std::string run_dir2 = run_dir.Data();
124 TString muon_dir =
"/" + run_dir +
"/HLT/MuonMon/";
126 TString cm_dir = muon_dir +
"Common/";
128 TString sol = cm_dir +
"Trigger_Overlap";
129 TString solpt = cm_dir +
"Trigger_Overlap_Including_Passthrough";
130 TString solf = cm_dir +
"Trigger_Overlap_Fraction";
131 TString solfpt = cm_dir +
"Trigger_Overlap_Fraction_Including_Passthrough";
139 TDirectory*
dir =
mf.GetDirectory(cm_dir);
143 std::cerr <<
"HLTMuonTriggerOverlapMatrix: directory " << cm_dir <<
" not found" << std::endl;
152 std::cerr <<
"HLTMuon PostProcessing: no such histogram!! " << sol << std::endl;
156 mf.get(solpt, holpt);
159 std::cerr <<
"HLTMuon PostProcessing: no such histogram!! " << solpt << std::endl;
166 std::cerr <<
"HLTMuon PostProcessing: no such histogram!! " << solf << std::endl;
170 mf.get(solfpt, holfpt);
173 std::cerr <<
"HLTMuon PostProcessing: no such histogram!! " << solfpt << std::endl;
178 if (hol && holpt && holf && holfpt) {
182 for (
int i = 0;
i < hol->GetXaxis()->GetNbins();
i++) {
186 for (
int j = 0; j < hol->GetXaxis()->GetNbins(); j++) {
194 frac = offdiag / diag;
195 efrac = sqrt(
frac * (1. -
frac) / diag);
199 Float_t efracpt = 0.;
202 fracpt = offdiagpt / diagpt;
203 efracpt = sqrt(fracpt * (1. - fracpt) / diagpt);
207 holf->SetBinError(
i + 1, j + 1, efrac);
210 holfpt->SetBinError(
i + 1, j + 1, efracpt);
215 holf->Write(
"", TObject::kOverwrite);
216 holfpt->Write(
"", TObject::kOverwrite);