51 if (
mf.GetSize() < 1000.) {
64 TString smethod[3] = {
65 "SegmTrack",
"MidOnly",
""
68 TIter next_run(
mf.GetListOfKeys());
70 while ((key_run =
dynamic_cast<TKey*
> (next_run())) != 0) {
71 if (!key_run->IsFolder())
continue;
72 TString run_dir = key_run->GetName();
73 if (!run_dir.Contains(
"run"))
continue;
85 TString mdtvstgc_dir = run_dir +
"/Muon/MuonRawDataMonitoring/MDTvsTGC/";
87 TString mdtvstgc_sub_dir[2] = {
88 mdtvstgc_dir +
"TGCEA/", mdtvstgc_dir +
"TGCEC/"
91 if (
mf.cd(mdtvstgc_dir))
mf.cd(mdtvstgc_dir);
97 for (
int ac = 0; ac < 2; ac++) {
98 TString eff_dir = mdtvstgc_sub_dir[ac];
99 TDirectory*
dir =
mf.GetDirectory(eff_dir);
105 for (
int ws = 0; ws < 2; ws++) {
107 bool oktomerge =
true;
109 TList* nummergelist =
new TList();
110 for (
int imethod = 0; imethod < 2; imethod++) {
111 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[imethod] <<
"num_" << sac[ac];
115 mf.get(snum, h2num,
dir);
120 nummergelist->Add(h2num);
122 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[2] <<
"num_" << sac[ac];
126 mf.get(snum, h2num,
dir);
132 TList* denmergelist =
new TList();
133 for (
int imethod = 0; imethod < 2; imethod++) {
134 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[imethod] <<
"denom_" << sac[ac];
138 mf.get(sden, h2den,
dir);
143 denmergelist->Add(h2den);
145 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[2] <<
"denom_" << sac[ac];
149 mf.get(sden, h2den,
dir);
158 h2num->Merge(nummergelist);
159 h2den->Merge(denmergelist);
162 h2num->Write(
"", TObject::kOverwrite);
163 h2den->Write(
"", TObject::kOverwrite);
167 for (
int imethod = 0; imethod < 3; imethod++) {
169 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[imethod] <<
"_" << sac[ac];
172 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[imethod] <<
"num_" << sac[ac];
175 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[imethod] <<
"denom_" << sac[ac];
178 ss << sws[ws] <<
"_EfficiencyAgainstMDT_Map" << smethod[imethod] <<
"error_" << sac[ac];
183 mf.get(seff, h2eff,
dir);
185 mf.get(snum, h2num,
dir);
187 mf.get(sden, h2den,
dir);
189 mf.get(serr, h2err,
dir);
191 if (h2eff && h2num && h2den) {
193 h2eff->Divide(h2num, h2den, 1., 1.,
"B");
196 int nX = h2eff->GetNbinsX();
197 int nY = h2eff->GetNbinsY();
198 int beff, bdenom, berror;
199 float feff, fdenom, ferror;
200 for (
int x = 1;
x <= nX;
x++) {
201 for (
int y = 1;
y <= nY;
y++) {
202 beff = h2eff->GetBin(
x,
y);
203 bdenom = h2den->GetBin(
x,
y);
204 feff = h2eff->GetBinContent(beff);
205 fdenom = h2den->GetBinContent(bdenom);
206 ferror = sqrt(feff * (1 - feff) / fdenom);
209 berror = h2err->GetBin(
x,
y);
210 h2err->SetBinContent(berror, ferror);
212 h2eff->SetBinError(beff, ferror);
221 h2eff->Write(
"", TObject::kOverwrite);
222 if (h2err) h2err->Write(
"", TObject::kOverwrite);
236 h_funcs =
dynamic_cast<TList*
> (
h->GetListOfFunctions()->Clone());
239 TIter iterE(h_funcs);
241 h->GetListOfFunctions()->Add(*iterE);