35 #include "TGraphAsymmErrors.h"
47 if (
mf.GetSize() < 1000.) {
61 TIter next_run(
mf.GetListOfKeys());
64 while ((key_run =
dynamic_cast<TKey*
> (next_run())) != 0) {
65 if (!key_run->IsFolder())
continue;
66 TString run_dir = key_run->GetName();
67 if (!run_dir.Contains(
"run"))
continue;
69 std::string run_dir2 = run_dir.Data();
84 TString tgc_dir = run_dir +
"/Muon/MuonRawDataMonitoring/TGC/";
86 TString tgc_global_dir = tgc_dir +
"Global/";
87 TString tgc_sub_dir[2] = {
88 tgc_dir +
"TGCEA/", tgc_dir +
"TGCEC/"
91 for (
int ac = 0; ac < 2; ac++) {
92 TString eff_dir = tgc_sub_dir[ac] +
"Efficiency/";
93 TDirectory*
dir =
mf.GetDirectory(eff_dir);
100 ss <<
"Efficiency" << sac[ac];
101 seff = eff_dir +
ss.str();
103 ss <<
"Efficiency" << sac[ac] <<
"_Numerator";
104 snum = eff_dir +
"NumDenom/" +
ss.str();
106 ss <<
"Efficiency" << sac[ac] <<
"_Denominator";
107 sden = eff_dir +
"NumDenom/" +
ss.str();
116 if (h1eff && h1num && h1den) {
118 h1eff->Divide(h1num, h1den, 1., 1.,
"B");
122 h1eff->Write(
"", TObject::kOverwrite);
128 for (
int ws = 0; ws < 2; ws++) {
130 ss << sws[ws] <<
"Efficiency" << sac[ac];
131 seff = eff_dir +
ss.str();
133 ss << sws[ws] <<
"Efficiency" << sac[ac] <<
"_Numerator";
134 snum = eff_dir +
"NumDenom/" +
ss.str();
136 ss << sws[ws] <<
"Efficiency" << sac[ac] <<
"_Denominator";
137 sden = eff_dir +
"NumDenom/" +
ss.str();
146 if (h1eff && h1num && h1den) {
148 h1eff->Divide(h1num, h1den, 1., 1.,
"B");
152 h1eff->Write(
"", TObject::kOverwrite);
160 std::string sbc[3] = {
161 "_Previous",
"",
"_Next"
163 for (
int bc = 0; bc < 3; bc++) {
165 ss << sws[ws] <<
"Efficiency_Map" << sbc[bc] << sac[ac];
166 seff = eff_dir +
ss.str();
168 ss << sws[ws] <<
"Efficiency_Map" << sbc[bc] << sac[ac] <<
"_Numerator";
169 snum = eff_dir +
"NumDenom/" +
ss.str();
171 ss << sws[ws] <<
"Efficiency_Map" << sac[ac] <<
"_Denominator";
172 sden = eff_dir +
"NumDenom/" +
ss.str();
181 if (h2eff && h2num && h2den) {
183 h2eff->Divide(h2num, h2den, 1., 1.,
"B");
187 h2eff->Write(
"", TObject::kOverwrite);
210 if (
mf.GetSize() < 1000.) {
224 std::stringstream
ss;
230 TIter next_run(
mf.GetListOfKeys());
232 while ((key_run =
dynamic_cast<TKey*
> (next_run())) != 0) {
233 if (!key_run->IsFolder())
continue;
234 TString run_dir = key_run->GetName();
235 if (!run_dir.Contains(
"run"))
continue;
237 std::string run_dir2 = run_dir.Data();
251 TGraphAsymmErrors* geff(0);
254 TString tgc_dir = run_dir +
"/Muon/MuonRawDataMonitoring/TGCLV1/";
256 TString tgc_global_dir = tgc_dir +
"Global/";
257 TString tgc_sub_dir[2] = {
258 tgc_dir +
"TGCEA/", tgc_dir +
"TGCEC/"
261 std::string smuid[2] = {
264 std::string spna[3] = {
268 std::string sbc[3] = {
269 "_Previous",
"",
"_Next"
272 for (
int ac = 0; ac < 2; ac++) {
273 TString eff_dir = tgc_sub_dir[ac] +
"Eff/";
274 TDirectory*
dir =
mf.GetDirectory(eff_dir);
280 for (
int pt = 1;
pt <= 6;
pt++) {
281 for (
int pna = 0; pna < 3; pna++) {
283 for (
int pcn = 0; pcn < 3; pcn++) {
284 std::string tempeff, tempnum, tempden;
287 ss <<
"Trigger_Efficiency" << spna[pna] << sbc[pcn] <<
"_PT" <<
pt << smuid[
muid] << sac[ac];
288 seff = eff_dir +
ss.str();
291 ss <<
"Trigger_Efficiency" << spna[pna] << sbc[pcn] <<
"_PT" <<
pt << smuid[
muid] << sac[ac] <<
293 snum = eff_dir +
"NumDenom/" +
ss.str();
296 ss <<
"Trigger_Efficiency" << spna[pna] <<
"_PT" <<
pt << smuid[
muid] << sac[ac] <<
"_Denominator";
297 sden = eff_dir +
"NumDenom/" +
ss.str();
306 if (h2eff && h2num && h2den) {
308 h2eff->Divide(h2num, h2den, 1., 1.,
"B");
311 dir =
mf.GetDirectory(eff_dir);
313 h2eff->Write(
"", TObject::kOverwrite);
323 ss <<
"Trigger_Turn_On_Curve" << spna[pna] <<
"_PT" <<
pt << smuid[
muid] << sac[ac];
324 seff = eff_dir +
ss.str();
326 seffg = eff_dir +
ss.str();
328 ss <<
"Trigger_Turn_On_Curve" << spna[pna] <<
"_PT" <<
pt << smuid[
muid] << sac[ac] <<
"_Numerator";
329 snum = eff_dir +
"NumDenom/" +
ss.str();
331 ss <<
"Trigger_Turn_On_Curve" << spna[pna] <<
"_PT" <<
pt << smuid[
muid] << sac[ac] <<
"_Denominator";
332 sden = eff_dir +
"NumDenom/" +
ss.str();
343 if (h1eff && h1num && h1den) {
345 h1eff->Divide(h1num, h1den, 1., 1.,
"B");
348 dir =
mf.GetDirectory(eff_dir);
350 h1eff->Write(
"", TObject::kOverwrite);
353 geff->BayesDivide(h1num, h1den);
356 dir =
mf.GetDirectory(eff_dir);
358 geff->Write(
"", TObject::kOverwrite);
370 TString grate_dir = tgc_global_dir +
"Rate/";
371 TString rate_dir = tgc_sub_dir[ac] +
"Rate/";
372 TString rr_dir = tgc_sub_dir[ac] +
"Rate/Ratio/";
373 dir =
mf.GetDirectory(rr_dir);
381 ss <<
"Number_Of_PT" <<
pt <<
"_Triggers_Per_Event_Vs_10BCID" << sac[ac];
382 seff = rr_dir +
ss.str();
384 ss <<
"Number_Of_PT" <<
pt <<
"_Triggers_In_10BCID" << sac[ac];
385 snum = rate_dir +
ss.str();
387 ss <<
"Number_Of_Events_In_10BCID";
388 sden = grate_dir +
ss.str();
397 if (h1eff && h1num && h1den) {
399 h1eff->Divide(h1num, h1den);
403 h1eff->Write(
"", TObject::kOverwrite);
411 ss <<
"Number_Of_PT" <<
pt <<
"_Triggers_Per_Event_Vs_2LB" << sac[ac];
412 seff = rr_dir +
ss.str();
414 ss <<
"Number_Of_PT" <<
pt <<
"_Triggers_In_2LB" << sac[ac];
415 snum = rate_dir +
ss.str();
417 ss <<
"Number_Of_Events_In_2LB";
418 sden = grate_dir +
ss.str();
427 if (h1eff && h1num && h1den) {
429 h1eff->Divide(h1num, h1den);
433 h1eff->Write(
"", TObject::kOverwrite);
442 TString grate_dir = tgc_global_dir +
"Rate/";
443 TString rate_dir = tgc_sub_dir[ac] +
"Rate/";
444 TString rr_dir = tgc_sub_dir[ac] +
"Rate/Ratio/";
448 ss <<
"Number_Of_SL_Triggers_Per_Event_Vs_10BCID" << sac[ac];
449 seff = rr_dir +
ss.str();
451 ss <<
"Number_Of_SL_Triggers_In_10BCID" << sac[ac];
452 snum = rate_dir +
ss.str();
454 ss <<
"Number_Of_Events_In_10BCID";
455 sden = grate_dir +
ss.str();
464 if (h1eff && h1num && h1den) {
466 h1eff->Divide(h1num, h1den);
469 dir =
mf.GetDirectory(rr_dir);
471 h1eff->Write(
"", TObject::kOverwrite);
479 ss <<
"Number_Of_SL_Triggers_Per_Event_Vs_2LB" << sac[ac];
480 seff = rr_dir +
ss.str();
482 ss <<
"Number_Of_SL_Triggers_In_2LB" << sac[ac];
483 snum = rate_dir +
ss.str();
485 ss <<
"Number_Of_Events_In_2LB";
486 sden = grate_dir +
ss.str();
495 if (h1eff && h1num && h1den) {
497 h1eff->Divide(h1num, h1den);
501 h1eff->Write(
"", TObject::kOverwrite);