10 #include "TDirectory.h"
19 #include <boost/assign/list_of.hpp>
23 using boost::assign::list_of;
39 const string& fileSuperEvent,
40 const string& outputDir) {
42 TFile* fileSE =
new TFile(fileSuperEvent.c_str());
46 TFile* fileEbE =
new TFile(fileEventByEvent.c_str());
65 long nofSEEvents =
fHMSuperEvent->
H1(
"fh_se_event_number")->GetEntries();
66 long nofSEEventsSquared = nofSEEvents * nofSEEvents;
67 cout <<
"Number of SE events = " << nofSEEventsSquared << endl;
71 cout <<
"Number of EE events = " << nofEEEvents << endl;
101 "jpsi_fh_SE_PdgCode_of Others_BG",
116 "jpsi_se_fh_se_ee_bg_minv_reco",
"jpsi_fh_se_ee_bg_minv_reco", 900, 900);
121 list_of(
"Event-by-Event")(
"SuperEvent"),
134 "jpsi_fh_se_ee_bg_minv_chi2prim",
141 list_of(
"Event-by-Event")(
"SuperEvent"),
154 "jpsi_se_fh_se_ee_bg_minv_elid",
"jpsi_fh_se_ee_bg_minv_elid", 900, 900);
159 list_of(
"Event-by-Event")(
"SuperEvent"),
172 "jpsi_se_fh_se_ee_bg_minv_ptcut",
"jpsi_fh_se_ee_bg_minv_ptcut", 900, 900);
177 list_of(
"Event-by-Event")(
"SuperEvent"),
190 CreateCanvas(
"jpsi_se_minv_reco",
"jpsi_se_minv_reco", 900, 900);
199 list_of(
"Background SuperEvent")(
"Signal Event-By-Event"),
210 CreateCanvas(
"jpsi_se_minv_chi2prim",
"jpsi_se_minv_chi2prim", 900, 900);
220 list_of(
"Background SuperEvent")(
"Signal Event-By-Event"),
231 CreateCanvas(
"jpsi_se_minv_elid",
"jpsi_se_minv_elid", 900, 900);
240 list_of(
"Background SuperEvent")(
"Signal Event-By-Event"),
251 CreateCanvas(
"jpsi_se_minv_ptcut",
"jpsi_se_minv_ptcut", 900, 900);
261 list_of(
"Background SuperEvent")(
"Signal Event-By-Event"),
272 CreateCanvas(
"jpsi_se_ee_minv_ptcut",
"jpsi_se_ee_minv_ptcut", 900, 900);
280 TH1D* fhBgSignal = (TH1D*) fhBg->Clone();
281 fhBgSignal->Add(fhSignal);
282 fhBgSignal->SetMinimum(1e-9);
283 DrawH1(list_of(fhBg)(fhSignal)(fhBgSignal),
284 list_of(
"Background SuperEvent")(
"Signal Event-By-Event")(
285 "Signal and Background"),
304 TH1D* signalFit_ee = (TH1D*) signal_ee->Clone();
305 signalFit_ee->Fit(
"gaus",
"",
"", 2.9, 3.3);
308 Double_t sigmaSignal =
309 signalFit_ee->GetFunction(
"gaus")->GetParameter(
"Sigma");
310 Double_t meanSignal = signalFit_ee->GetFunction(
"gaus")->GetParameter(
"Mean");
313 int signalMin = signal_ee->FindBin(meanSignal - 2. * sigmaSignal);
314 int signalMax = signal_ee->FindBin(meanSignal + 2. * sigmaSignal);
316 double NOfSignalEntries = 0.;
317 double NOfBgEntries = 0.;
320 for (
int i = signalMin;
i <= signalMax;
i++) {
321 NOfSignalEntries += signal_ee->GetBinContent(
i);
322 NOfBgEntries += bg_se->GetBinContent(
i);
326 if (NOfBgEntries <= 0.) {
329 double sOverBg = NOfSignalEntries / NOfBgEntries;
336 "jpsi_fh_se_SignalOverBg_allAnaSteps",
340 "fh_se_SignalOverBg_allAnaSteps;AnaSteps;S/Bg",
347 double nstep =
i + 0.5;
349 fHMSuperEvent->
H1(
"fh_se_SignalOverBg_allAnaSteps")->Fill(nstep, SOverBg);
355 ->SetLabelSize(0.06);
371 CreateCanvas(
"jpsi_fh_bg_pair_source",
"jpsi_fh_bg_pair_source", 800, 800);
382 list_of(
"whole BG")(
"#gamma + #gamma")(
"#gamma + #pi^{0}")(
383 "#gamma + others")(
"#pi^{0} + #pi^{0}")(
"#pi^{0} + others")(
399 "jpsi_fh_se_bg_Minv_Mismatch_pt",
407 double trueMatchNotEl =
408 fHMSuperEvent->
H1(
"fh_se_bg_truematch_notel_minv_ptCut")->GetEntries();
417 list_of(
"true match ("
419 "true match (e^{#pm}) ("
421 "true match (not e^{#pm}) ("
438 "jpsi_se_ee_minv_diff_ptCuts",
"jpsi_se_ee_minv_diff_ptCuts", 1600, 800);
440 for (
int i = 0;
i < 8;
i++) {
442 TH1D* fhBgDiffPtCuts =
446 TH1D* fhSignalDiffPtCuts =
450 TH1D* fhBgSignalDiffPtCuts = (TH1D*) fhBgDiffPtCuts->Clone();
451 fhBgSignalDiffPtCuts->Add(fhSignalDiffPtCuts);
452 fhBgSignalDiffPtCuts->SetMinimum(1e-9);
457 upperCut = (0.4 * (
i + 1));
458 lowerCut = (upperCut - 0.4);
471 TH1D* signalFit_DiffPt_ee = (TH1D*) fhSignalDiffPtCuts->Clone();
472 signalFit_DiffPt_ee->Fit(
"gaus",
"",
"", 2.9, 3.3);
475 Double_t sigmaSignal =
476 signalFit_DiffPt_ee->GetFunction(
"gaus")->GetParameter(
"Sigma");
477 Double_t meanSignal =
478 signalFit_DiffPt_ee->GetFunction(
"gaus")->GetParameter(
"Mean");
481 int signalMin = signalFit_DiffPt_ee->FindBin(meanSignal - 2. * sigmaSignal);
482 int signalMax = signalFit_DiffPt_ee->FindBin(meanSignal + 2. * sigmaSignal);
484 double NOfSignalEntries = 0.;
485 double NOfBgEntries = 0.;
488 for (
int j = signalMin; j <= signalMax; j++) {
489 NOfSignalEntries += signalFit_DiffPt_ee->GetBinContent(j);
490 NOfBgEntries += fhBgDiffPtCuts->GetBinContent(j);
495 if (NOfBgEntries <= 0.) {
498 SOverBg = NOfSignalEntries / NOfBgEntries;
503 DrawH1(list_of(fhBgDiffPtCuts)(fhSignalDiffPtCuts)(fhBgSignalDiffPtCuts),
504 list_of(
"Background")(
"Signal")(
"Signal and Background"),