44 , fGlobalTracks(nullptr)
46 , fStsTrackMatches(nullptr)
48 , fRichRingMatches(nullptr)
52 , STS_and_RICH_refmomentum()
53 , STS_and_RICH_MCtrack()
56 , ConversionPoints2D(nullptr)
57 , ConversionPoints3D(nullptr)
58 , fHistoList_reco_STS_gg()
59 , fHistoList_reco_STS_and_RICH_gg()
60 , fHistoList_reco_STS_gee()
61 , fHistoList_reco_STS_and_RICH_gee()
62 , fHistoList_reco_STS_eeee()
63 , fHistoList_reco_STS_and_RICH_eeee()
64 , STS_InvMass_eeee_mc(nullptr)
65 , STS_InvMass_eeee_refitted(nullptr)
66 , STSRICH_InvMass_eeee_mc(nullptr)
67 , STSRICH_InvMass_eeee_refitted(nullptr)
68 , STS_InvMass_gee_mc(nullptr)
69 , STS_InvMass_gee_refitted(nullptr)
70 , STS_InvMass_realg_gee_reffited(nullptr)
71 , STS_InvMass_img_gee_refitted(nullptr)
72 , STS_OpeningAngle_realg_gee_mc(nullptr)
73 , STS_OpeningAngle_realg_gee_reffited(nullptr)
74 , STS_OpeningAngle_img_gee_mc(nullptr)
75 , STS_OpeningAngle_img_gee_reffited(nullptr)
76 , STSRICH_InvMass_gee_mc(nullptr)
77 , STSRICH_InvMass_gee_refitted(nullptr)
78 , STSRICH_InvMass_realg_gee_reffited(nullptr)
79 , STSRICH_InvMass_img_gee_refitted(nullptr)
80 , STSRICH_OpeningAngle_realg_gee_mc(nullptr)
81 , STSRICH_OpeningAngle_realg_gee_reffited(nullptr)
82 , STSRICH_OpeningAngle_img_gee_mc(nullptr)
83 , STSRICH_OpeningAngle_img_gee_reffited(nullptr)
84 , STS_InvMass_gg_mc(nullptr)
85 , STS_InvMass_gg_reffited(nullptr)
86 , STS_InvMass_realg_gg_mc(nullptr)
87 , STS_InvMass_realg_gg_reffited(nullptr)
88 , STS_OpeningAngle_realg_gg_mc(nullptr)
89 , STS_OpeningAngle_realg_gg_reffited(nullptr)
90 , STS_OpeningAngle_between_gg_mc(nullptr)
91 , STS_OpeningAngle_between_gg_reffited(nullptr)
92 , STSRICH_InvMass_gg_mc(nullptr)
93 , STSRICH_InvMass_gg_reffited(nullptr)
94 , STSRICH_InvMass_realg_gg_mc(nullptr)
95 , STSRICH_InvMass_realg_gg_reffited(nullptr)
96 , STSRICH_OpeningAngle_realg_gg_mc(nullptr)
97 , STSRICH_OpeningAngle_realg_gg_reffited(nullptr)
98 , STSRICH_OpeningAngle_between_gg_mc(nullptr)
99 , STSRICH_OpeningAngle_between_gg_reffited(nullptr)
230 vector<Int_t> Id, vector<TH1*> gg, vector<TH1*> gee,
233 Int_t fDecayedParticlePdg = 111;
235 if (MC.size() < 4)
return;
237 for (
size_t i = 0; i < MC.size(); i++) {
238 for (
size_t j = i + 1; j < MC.size(); j++) {
239 for (
size_t k = j + 1; k < MC.size(); k++) {
240 for (
size_t l = k + 1; l < MC.size(); l++) {
242 if (MC.at(i)->GetPdgCode() + MC.at(j)->GetPdgCode() + MC.at(k)->GetPdgCode() + MC.at(l)->GetPdgCode() != 0)
245 int motherId1 = MC.at(i)->GetMotherId();
246 int motherId2 = MC.at(j)->GetMotherId();
247 int motherId3 = MC.at(k)->GetMotherId();
248 int motherId4 = MC.at(l)->GetMotherId();
250 int STSmcId1 = Id.at(i);
251 int STSmcId2 = Id.at(j);
252 int STSmcId3 = Id.at(k);
253 int STSmcId4 = Id.at(l);
254 if (STSmcId1 == STSmcId2 || STSmcId1 == STSmcId3 || STSmcId1 == STSmcId4 || STSmcId2 == STSmcId3
255 || STSmcId2 == STSmcId4 || STSmcId3 == STSmcId4)
259 if (motherId1 == motherId2 && motherId1 == motherId3 && motherId1 == motherId4) {
260 if (motherId1 != -1) {
262 if (
nullptr == mother1)
continue;
264 if (mcMotherPdg1 == fDecayedParticlePdg) {
266 Double_t InvMass_reco =
268 cout <<
"Decay pi0 -> e+e-e+e- detected!\t\t mc mass: " << InvMass_true
269 <<
" \t reco mass: " << InvMass_reco << endl;
270 cout <<
"motherIds: " << motherId1 <<
"/" << motherId2 <<
"/" << motherId3 <<
"/" << motherId4
271 <<
"\t motherpdg: " << mcMotherPdg1 <<
"\t mctrack mass: " << mother1->
GetMass() << endl;
272 cout <<
"pdgs: " << MC.at(i)->GetPdgCode() <<
"/" << MC.at(j)->GetPdgCode() <<
"/"
273 << MC.at(k)->GetPdgCode() <<
"/" << MC.at(l)->GetPdgCode() << endl;
274 eeee[0]->Fill(InvMass_true);
275 eeee[1]->Fill(InvMass_reco);
282 if ((motherId1 == motherId2 && motherId3 == motherId4) || (motherId1 == motherId3 && motherId2 == motherId4)
283 || (motherId1 == motherId4 && motherId2 == motherId3)) {
285 int grandmotherId1 = -1;
286 int grandmotherId2 = -1;
287 int grandmotherId3 = -1;
288 int grandmotherId4 = -1;
290 int mcMotherPdg1 = -1;
291 int mcMotherPdg2 = -1;
292 int mcMotherPdg3 = -1;
294 int mcGrandmotherPdg1 = -1;
301 if (motherId1 == -1 || motherId2 == -1 || motherId3 == -1 || motherId4 == -1)
continue;
303 if (
nullptr != mother1) mcMotherPdg1 = mother1->
GetPdgCode();
305 if (grandmotherId1 != -1) {
307 if (
nullptr != grandmother1) mcGrandmotherPdg1 = grandmother1->
GetPdgCode();
310 if (
nullptr != mother2) mcMotherPdg2 = mother2->
GetPdgCode();
313 if (
nullptr != mother3) mcMotherPdg3 = mother3->
GetPdgCode();
319 if (motherId1 == motherId2 && motherId3 == motherId4) {
323 if ((grandmotherId1 == motherId3 && mcMotherPdg3 == fDecayedParticlePdg)
324 || (motherId1 == grandmotherId3 && mcMotherPdg1 == fDecayedParticlePdg)) {
326 Double_t InvMass_reco =
328 cout <<
"Decay pi0 -> gamma(e+e-) e+e- detected!\t\t mc mass: " << InvMass_true
329 <<
"\t, reco mass: " << InvMass_reco << endl;
330 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/" << motherId3 <<
"/" << motherId4 << endl;
331 cout <<
"pdgs " << MC.at(i)->GetPdgCode() <<
"/" << MC.at(j)->GetPdgCode() <<
"/"
332 << MC.at(k)->GetPdgCode() <<
"/" << MC.at(l)->GetPdgCode() << endl;
334 gee[0]->Fill(InvMass_true);
335 gee[1]->Fill(InvMass_reco);
338 MC.at(i)->GetStartVertex(start1);
340 MC.at(j)->GetStartVertex(start2);
342 MC.at(k)->GetStartVertex(start3);
344 MC.at(l)->GetStartVertex(start4);
345 cout <<
"start: " << start1.Z() <<
"/" << start2.Z() <<
"/" << start3.Z() <<
"/" << start4.Z() << endl;
347 if (mcGrandmotherPdg1
348 == fDecayedParticlePdg) {
351 gee[2]->Fill(InvMass_realg);
352 gee[3]->Fill(InvMass_img);
355 Double_t OpeningAngle_realg_refitted =
357 gee[4]->Fill(OpeningAngle_realg_mc);
358 gee[5]->Fill(OpeningAngle_realg_refitted);
361 Double_t OpeningAngle_img_refitted =
363 gee[6]->Fill(OpeningAngle_img_mc);
364 gee[7]->Fill(OpeningAngle_img_refitted);
367 == fDecayedParticlePdg) {
370 gee[2]->Fill(InvMass_realg);
371 gee[3]->Fill(InvMass_img);
374 Double_t OpeningAngle_realg_refitted =
376 gee[4]->Fill(OpeningAngle_realg_mc);
377 gee[5]->Fill(OpeningAngle_realg_refitted);
380 Double_t OpeningAngle_img_refitted =
382 gee[6]->Fill(OpeningAngle_img_mc);
383 gee[7]->Fill(OpeningAngle_img_refitted);
388 if (motherId1 == motherId3 && motherId2 == motherId4) {
392 if ((grandmotherId1 == motherId2 && mcMotherPdg2 == fDecayedParticlePdg)
393 || (motherId1 == grandmotherId2 && mcMotherPdg1 == fDecayedParticlePdg)) {
395 Double_t InvMass_reco =
397 cout <<
"Decay pi0 -> gamma(e+e-) e+e- detected!\t\t mc mass: " << InvMass_true
398 <<
"\t, reco mass: " << InvMass_reco << endl;
399 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/" << motherId3 <<
"/" << motherId4 << endl;
400 cout <<
"pdgs " << MC.at(i)->GetPdgCode() <<
"/" << MC.at(j)->GetPdgCode() <<
"/"
401 << MC.at(k)->GetPdgCode() <<
"/" << MC.at(l)->GetPdgCode() << endl;
403 gee[0]->Fill(InvMass_true);
404 gee[1]->Fill(InvMass_reco);
407 MC.at(i)->GetStartVertex(start1);
409 MC.at(j)->GetStartVertex(start2);
411 MC.at(k)->GetStartVertex(start3);
413 MC.at(l)->GetStartVertex(start4);
414 cout <<
"start: " << start1.Z() <<
"/" << start2.Z() <<
"/" << start3.Z() <<
"/" << start4.Z() << endl;
416 if (mcGrandmotherPdg1
417 == fDecayedParticlePdg) {
420 gee[2]->Fill(InvMass_realg);
421 gee[3]->Fill(InvMass_img);
424 Double_t OpeningAngle_realg_refitted =
426 gee[4]->Fill(OpeningAngle_realg_mc);
427 gee[5]->Fill(OpeningAngle_realg_refitted);
430 Double_t OpeningAngle_img_refitted =
432 gee[6]->Fill(OpeningAngle_img_mc);
433 gee[7]->Fill(OpeningAngle_img_refitted);
436 == fDecayedParticlePdg) {
439 gee[2]->Fill(InvMass_realg);
440 gee[3]->Fill(InvMass_img);
443 Double_t OpeningAngle_realg_refitted =
445 gee[4]->Fill(OpeningAngle_realg_mc);
446 gee[5]->Fill(OpeningAngle_realg_refitted);
449 Double_t OpeningAngle_img_refitted =
451 gee[6]->Fill(OpeningAngle_img_mc);
452 gee[7]->Fill(OpeningAngle_img_refitted);
457 if (motherId1 == motherId4 && motherId2 == motherId3) {
461 if ((grandmotherId1 == motherId2 && mcMotherPdg2 == fDecayedParticlePdg)
462 || (motherId1 == grandmotherId2 && mcMotherPdg1 == fDecayedParticlePdg)) {
464 Double_t InvMass_reco =
466 cout <<
"Decay pi0 -> gamma(e+e-) e+e- detected!\t\t mc mass: " << InvMass_true
467 <<
"\t, reco mass: " << InvMass_reco << endl;
468 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/" << motherId3 <<
"/" << motherId4 << endl;
469 cout <<
"pdgs " << MC.at(i)->GetPdgCode() <<
"/" << MC.at(j)->GetPdgCode() <<
"/"
470 << MC.at(k)->GetPdgCode() <<
"/" << MC.at(l)->GetPdgCode() << endl;
472 gee[0]->Fill(InvMass_true);
473 gee[1]->Fill(InvMass_reco);
476 MC.at(i)->GetStartVertex(start1);
478 MC.at(j)->GetStartVertex(start2);
480 MC.at(k)->GetStartVertex(start3);
482 MC.at(l)->GetStartVertex(start4);
483 cout <<
"start: " << start1.Z() <<
"/" << start2.Z() <<
"/" << start3.Z() <<
"/" << start4.Z() << endl;
485 if (mcGrandmotherPdg1
486 == fDecayedParticlePdg) {
489 gee[2]->Fill(InvMass_realg);
490 gee[3]->Fill(InvMass_img);
493 Double_t OpeningAngle_realg_refitted =
495 gee[4]->Fill(OpeningAngle_realg_mc);
496 gee[5]->Fill(OpeningAngle_realg_refitted);
499 Double_t OpeningAngle_img_refitted =
501 gee[6]->Fill(OpeningAngle_img_mc);
502 gee[7]->Fill(OpeningAngle_img_refitted);
505 == fDecayedParticlePdg) {
508 gee[2]->Fill(InvMass_realg);
509 gee[3]->Fill(InvMass_img);
512 Double_t OpeningAngle_realg_refitted =
514 gee[4]->Fill(OpeningAngle_realg_mc);
515 gee[5]->Fill(OpeningAngle_realg_refitted);
518 Double_t OpeningAngle_img_refitted =
520 gee[6]->Fill(OpeningAngle_img_mc);
521 gee[7]->Fill(OpeningAngle_img_refitted);
528 if (grandmotherId1 == grandmotherId2 && grandmotherId1 == grandmotherId3
529 && grandmotherId1 == grandmotherId4) {
530 if (mcGrandmotherPdg1 != fDecayedParticlePdg)
continue;
532 Double_t InvMass_reco =
534 cout <<
"Decay pi0 -> gamma gamma -> e+e- e+e- detected!\t\t mc "
536 << InvMass_true <<
"\t, reco mass: " << InvMass_reco << endl;
537 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/" << motherId3 <<
"/" << motherId4 << endl;
538 cout <<
"grandmotherid: " << grandmotherId1 <<
"/" << grandmotherId2 <<
"/" << grandmotherId3 <<
"/"
539 << grandmotherId4 << endl;
540 cout <<
"pdgs " << MC.at(i)->GetPdgCode() <<
"/" << MC.at(j)->GetPdgCode() <<
"/"
541 << MC.at(k)->GetPdgCode() <<
"/" << MC.at(l)->GetPdgCode() << endl;
543 gg[0]->Fill(InvMass_true);
544 gg[1]->Fill(InvMass_reco);
546 cout <<
"\t \t mc true info: " << endl;
547 cout <<
"particle 1: \t" << MC.at(i)->GetPdgCode() <<
";\t pt = " << MC.at(i)->GetPt()
548 <<
";\t X = " << MC.at(i)->GetStartX() <<
";\t Y = " << MC.at(i)->GetStartY()
549 <<
";\t Z = " << MC.at(i)->GetStartZ() <<
";\t E = " << MC.at(i)->GetEnergy() << endl;
550 cout <<
"particle 2: \t" << MC.at(j)->GetPdgCode() <<
";\t pt = " << MC.at(j)->GetPt()
551 <<
";\t X = " << MC.at(j)->GetStartX() <<
";\t Y = " << MC.at(j)->GetStartY()
552 <<
";\t Z = " << MC.at(j)->GetStartZ() <<
";\t E = " << MC.at(j)->GetEnergy() << endl;
553 cout <<
"particle 3: \t" << MC.at(k)->GetPdgCode() <<
";\t pt = " << MC.at(k)->GetPt()
554 <<
";\t X = " << MC.at(k)->GetStartX() <<
";\t Y = " << MC.at(k)->GetStartY()
555 <<
";\t Z = " << MC.at(k)->GetStartZ() <<
";\t E = " << MC.at(k)->GetEnergy() << endl;
556 cout <<
"particle 4: \t" << MC.at(l)->GetPdgCode() <<
";\t pt = " << MC.at(l)->GetPt()
557 <<
";\t X = " << MC.at(l)->GetStartX() <<
";\t Y = " << MC.at(l)->GetStartY()
558 <<
";\t Z = " << MC.at(l)->GetStartZ() <<
";\t E = " << MC.at(l)->GetEnergy() << endl;
560 Double_t OpeningAngle1_mc = 0;
561 Double_t OpeningAngle2_mc = 0;
562 Double_t OpeningAngle1_refitted = 0;
563 Double_t OpeningAngle2_refitted = 0;
564 Double_t InvMass_realg1_mc = 0;
565 Double_t InvMass_realg2_mc = 0;
566 Double_t InvMass_realg1_refitted = 0;
567 Double_t InvMass_realg2_refitted = 0;
569 if (motherId1 == motherId2) {
572 gg[4]->Fill(OpeningAngle1_mc);
573 gg[4]->Fill(OpeningAngle2_mc);
576 gg[5]->Fill(OpeningAngle1_refitted);
577 gg[5]->Fill(OpeningAngle2_refitted);
581 gg[2]->Fill(InvMass_realg1_mc);
582 gg[2]->Fill(InvMass_realg2_mc);
585 gg[3]->Fill(InvMass_realg1_refitted);
586 gg[3]->Fill(InvMass_realg2_refitted);
588 if (motherId1 == motherId3) {
591 gg[4]->Fill(OpeningAngle1_mc);
592 gg[4]->Fill(OpeningAngle2_mc);
595 gg[5]->Fill(OpeningAngle1_refitted);
596 gg[5]->Fill(OpeningAngle2_refitted);
600 gg[2]->Fill(InvMass_realg1_mc);
601 gg[2]->Fill(InvMass_realg2_mc);
604 gg[3]->Fill(InvMass_realg1_refitted);
605 gg[3]->Fill(InvMass_realg2_refitted);
607 if (motherId1 == motherId4) {
610 gg[4]->Fill(OpeningAngle1_mc);
611 gg[4]->Fill(OpeningAngle2_mc);
614 gg[5]->Fill(OpeningAngle1_refitted);
615 gg[5]->Fill(OpeningAngle2_refitted);
619 gg[2]->Fill(InvMass_realg1_mc);
620 gg[2]->Fill(InvMass_realg2_mc);
623 gg[3]->Fill(InvMass_realg1_refitted);
624 gg[3]->Fill(InvMass_realg2_refitted);
626 Double_t openingAngleBetweenGammas =
628 gg[6]->Fill(openingAngleBetweenGammas);
629 Double_t openingAngleBetweenGammasReco =
631 gg[7]->Fill(openingAngleBetweenGammasReco);