16 #include "TClonesArray.h"
17 #include "TDirectory.h"
25 #include <boost/assign/list_of.hpp>
30 using boost::assign::list_of;
45 , fRunAfterPtCut(kTRUE)
46 , fRunAfterIdCut(kTRUE) {}
51 cout <<
"-I- Run" << endl;
61 TFile* file =
new TFile(
fOutputFile.c_str(),
"RECREATE");
71 "fh_se_bg_minv_reco;M_{ee} [GeV/c^{2}];particles/event",
76 "fh_se_bg_minv_chi2prim",
77 "fh_se_bg_minv_chi2prim;M_{ee} [GeV/c^{2}];particles/event",
82 "fh_se_bg_minv_elid;M_{ee} [GeV/c^{2}];particles/event",
87 "fh_se_bg_minv_ptcut;M_{ee} [GeV/c^{2}];particles/event",
93 "fh_se_event_number",
"fh_se_event_number;a.u.;Number of events", 1, 0, 1.);
96 "fh_se_bg_participants_minv_gg",
97 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
102 "fh_se_bg_participants_minv_gp",
103 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
108 "fh_se_bg_participants_minv_go",
109 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
114 "fh_se_bg_participants_minv_pg",
115 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
120 "fh_se_bg_participants_minv_pp",
121 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
126 "fh_se_bg_participants_minv_po",
127 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
132 "fh_se_bg_participants_minv_og",
133 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
138 "fh_se_bg_participants_minv_op",
139 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
144 "fh_se_bg_participants_minv_oo",
145 "fh_se_bg_participants_minv_gg;M_{ee} [GeV/c^{2}];particles/event",
150 fHM->
Create1<TH1D>(
"fh_SE_PdgCode_of Others_BG",
151 "fh_SE_PdgCode_of Others_BG;PDGCode;Tracks per Event",
157 "fh_se_bg_mismatch_minv_ptCut",
158 "fh_se_bg_mismatch_minv_ptCut;M_{ee} [GeV/c^{2}];particles/event",
163 "fh_se_bg_truematch_minv_ptCut",
164 "fh_se_bg_truematch_minv_ptCut;M_{ee} [GeV/c^{2}];particles/event",
169 "fh_se_bg_truematch_el_minv_ptCut",
170 "fh_se_bg_truematch_el_minv_ptCut;M_{ee} [GeV/c^{2}];particles/event",
175 "fh_se_bg_truematch_notel_minv_ptCut",
176 "fh_se_bg_truematch_notel_minv_ptCut;M_{ee} [GeV/c^{2}];particles/event",
182 "fh_se_bg_minv_diff_ptcuts_0",
183 "fh_se_bg_minv_diff_ptcuts_0;M_{ee} [GeV/c^{2}];particles/event",
188 "fh_se_bg_minv_diff_ptcuts_1",
189 "fh_se_bg_minv_diff_ptcuts_1;M_{ee} [GeV/c^{2}];particles/event",
194 "fh_se_bg_minv_diff_ptcuts_2",
195 "fh_se_bg_minv_diff_ptcuts_2;M_{ee} [GeV/c^{2}];particles/event",
200 "fh_se_bg_minv_diff_ptcuts_3",
201 "fh_se_bg_minv_diff_ptcuts_3;M_{ee} [GeV/c^{2}];particles/event",
206 "fh_se_bg_minv_diff_ptcuts_4",
207 "fh_se_bg_minv_diff_ptcuts_4;M_{ee} [GeV/c^{2}];particles/event",
212 "fh_se_bg_minv_diff_ptcuts_5",
213 "fh_se_bg_minv_diff_ptcuts_5;M_{ee} [GeV/c^{2}];particles/event",
218 "fh_se_bg_minv_diff_ptcuts_6",
219 "fh_se_bg_minv_diff_ptcuts_6;M_{ee} [GeV/c^{2}];particles/event",
224 "fh_se_bg_minv_diff_ptcuts_7",
225 "fh_se_bg_minv_diff_ptcuts_7;M_{ee} [GeV/c^{2}];particles/event",
235 cout <<
"-I- ReadCandidates" << endl;
236 cout <<
"-I- fFileNames.size:" <<
fFileNames.size() << endl;
237 for (UInt_t iFile = 0; iFile <
fFileNames.size(); iFile++) {
238 cout <<
"-I- Reading file No " << iFile <<
" path:" <<
fFileNames[iFile]
240 TFile*
f =
new TFile(
fFileNames[iFile].c_str(),
"R");
241 TTree* t = (TTree*)
f->Get(
"cbmsim");
242 TFolder* fd = (TFolder*)
f->Get(
"cbmout");
243 if (fd == NULL)
continue;
244 TClonesArray* candidates =
245 (TClonesArray*) fd->FindObjectAny(
"JpsiCandidates");
246 t->SetBranchAddress(candidates->GetName(), &candidates);
247 Int_t nofEvents = t->GetEntriesFast();
248 cout <<
"-I- Number of events in file: " << nofEvents << endl;
249 for (Int_t iEv = 0; iEv < nofEvents; iEv++) {
250 fHM->
H1(
"fh_se_event_number")->Fill(0.5);
252 Int_t nofCandidates = candidates->GetEntriesFast();
254 for (Int_t iCand = 0; iCand < nofCandidates; iCand++) {
283 cout <<
"-I- number of events:" <<
fHM->
H1(
"fh_se_event_number")->GetEntries()
288 cout <<
"-I- DoSuperEvent" << endl;
292 for (Int_t iM = 0; iM < nofMinus; iM++) {
293 if (iM % 1000 == 0) cout << 100. * iM / nofMinus <<
"% done" << endl;
295 for (Int_t iP = 0; iP < nofPlus; iP++) {
313 fHM->
H1(
"fh_se_bg_minv_reco")->Fill(pRec.
fMinv);
314 if (isChi2Primary)
fHM->
H1(
"fh_se_bg_minv_chi2prim")->Fill(pRec.
fMinv);
315 if (isChi2Primary && isEl)
316 fHM->
H1(
"fh_se_bg_minv_elid")->Fill(pRec.
fMinv);
317 if (isChi2Primary && isEl && isPtCut) {
318 fHM->
H1(
"fh_se_bg_minv_ptcut")->Fill(pRec.
fMinv);
322 fHM->
H1(
"fh_se_bg_participants_minv_gg")
325 fHM->
H1(
"fh_se_bg_participants_minv_gp")
328 fHM->
H1(
"fh_se_bg_participants_minv_go")
330 fHM->
H1(
"fh_SE_PdgCode_of Others_BG")
331 ->Fill((
double) candP->
fMcPdg - 0.5);
335 fHM->
H1(
"fh_se_bg_participants_minv_gp")
338 fHM->
H1(
"fh_se_bg_participants_minv_pp")
341 fHM->
H1(
"fh_se_bg_participants_minv_po")
343 fHM->
H1(
"fh_SE_PdgCode_of Others_BG")
344 ->Fill((
double) candP->
fMcPdg - 0.5);
347 fHM->
H1(
"fh_SE_PdgCode_of Others_BG")
348 ->Fill((
double) candM->
fMcPdg - 0.5);
350 fHM->
H1(
"fh_se_bg_participants_minv_go")
353 fHM->
H1(
"fh_se_bg_participants_minv_po")
356 fHM->
H1(
"fh_se_bg_participants_minv_oo")
358 fHM->
H1(
"fh_SE_PdgCode_of Others_BG")
359 ->Fill((
double) candP->
fMcPdg - 0.5);
364 if (isBG && isMismatch)
365 fHM->
H1(
"fh_se_bg_mismatch_minv_ptCut")->Fill(pRec.
fMinv);
366 if (isBG && !isMismatch) {
367 fHM->
H1(
"fh_se_bg_truematch_minv_ptCut")->Fill(pRec.
fMinv);
369 fHM->
H1(
"fh_se_bg_truematch_el_minv_ptCut")->Fill(pRec.
fMinv);
371 fHM->
H1(
"fh_se_bg_truematch_notel_minv_ptCut")->Fill(pRec.
fMinv);
375 if (isChi2Primary && isEl && pRec.
fPt < 0.4) {
376 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_0")->Fill(pRec.
fMinv);
378 if (isChi2Primary && isEl && pRec.
fPt >= 0.4 && pRec.
fPt < 0.8) {
379 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_1")->Fill(pRec.
fMinv);
381 if (isChi2Primary && isEl && pRec.
fPt >= 0.8 && pRec.
fPt < 1.2) {
382 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_2")->Fill(pRec.
fMinv);
384 if (isChi2Primary && isEl && pRec.
fPt >= 1.2 && pRec.
fPt < 1.6) {
385 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_3")->Fill(pRec.
fMinv);
387 if (isChi2Primary && isEl && pRec.
fPt >= 1.6 && pRec.
fPt < 2.0) {
388 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_4")->Fill(pRec.
fMinv);
390 if (isChi2Primary && isEl && pRec.
fPt >= 2.0 && pRec.
fPt < 2.4) {
391 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_5")->Fill(pRec.
fMinv);
393 if (isChi2Primary && isEl && pRec.
fPt >= 2.4 && pRec.
fPt < 3.0) {
394 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_6")->Fill(pRec.
fMinv);
396 if (isChi2Primary && isEl && pRec.
fPt >= 3.0 && pRec.
fPt < 6.0) {
397 fHM->
H1(
"fh_se_bg_minv_diff_ptcuts_7")->Fill(pRec.
fMinv);
404 TCanvas* c =
new TCanvas(
"jpsi_se_bg_minv",
"jpsi_se_bg_minv", 1200, 1200);
423 fHM->
H1(
"fh_se_bg_minv_ptcut")->SetMinimum(1e-11);