1- // Copyright 2019-2025 CERN and copyright holders of ALICE O2.
1+ // Copyright 2019-2022 CERN and copyright holders of ALICE O2.
22// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33// All rights not expressly granted are reserved.
44//
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12- // / \file FemtoDreamDetaDphiStar .h
12+ // / \file femtoDreamDetaDphiStar .h
1313// / \brief FemtoDreamDetaDphiStar - Checks particles for the close pair rejection.
1414// / \author Laura Serksnyte, TU München, laura.serksnyte@tum.de
1515
@@ -154,6 +154,25 @@ class FemtoDreamDetaDphiStar
154154 }
155155 }
156156 }
157+ if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kReso ) {
158+
159+ for (int i = 0 ; i < 4 ; i++) {
160+ std::string dirName = static_cast <std::string>(dirNames[4 ]);
161+ histdetadpi[i][0 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[0 ][i]) + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
162+ histdetadpi[i][1 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[1 ][i]) + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
163+ histdetadpi[i][2 ] = mHistogramRegistry ->add <TH2>((dirName + " at_PV_" + std::to_string (i) + " _before" + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
164+ histdetadpi[i][3 ] = mHistogramRegistry ->add <TH2>((dirName + " at_PV_" + std::to_string (i) + " _after" + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
165+ if (plotForEveryRadii) {
166+ for (int j = 0 ; j < 9 ; j++) {
167+ histdetadpiRadii[i][j] = mHistogramRegistryQA ->add <TH2>((dirName + static_cast <std::string>(histNamesRadii[i][j]) + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
168+ }
169+ }
170+ if (fillQA) {
171+ histdetadpi_eta[i] = mHistogramRegistry ->add <THnSparse>((dirName + " dEtadPhi_Eta_" + std::to_string (i) + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}; #eta_{1}; #eta_{2}" , kTHnSparseF , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }, {100 , -0.8 , 0.8 }, {100 , -0.8 , 0.8 }});
172+ histdetadpi_phi[i] = mHistogramRegistry ->add <THnSparse>((dirName + " dEtadPhi_Phi_" + std::to_string (i) + static_cast <std::string>(histNameSEorME[meORse])).c_str (), " ; #Delta #eta; #Delta #phi^{*}; #phi_{1}; #phi_{2}" , kTHnSparseF , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }, {100 , 0 , 6.28 }, {100 , 0 , 6.28 }});
173+ }
174+ }
175+ }
157176 }
158177 // / Check if pair is close or not
159178 template <typename Part1, typename Part2, typename Parts>
@@ -191,7 +210,7 @@ class FemtoDreamDetaDphiStar
191210 }
192211 if (sameCharge) {
193212 if (atWhichRadiiToSelect == 1 ) {
194- if (pow (dphiAvg, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
213+ if (std:: pow (dphiAvg, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
195214 return true ;
196215 } else {
197216 if (Q3 == 999 ) {
@@ -204,7 +223,7 @@ class FemtoDreamDetaDphiStar
204223 return false ;
205224 }
206225 } else if (atWhichRadiiToSelect == 0 ) {
207- if (pow (dphi_AT_PV, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
226+ if (std:: pow (dphi_AT_PV, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
208227 return true ;
209228 } else {
210229 if (Q3 == 999 ) {
@@ -217,7 +236,7 @@ class FemtoDreamDetaDphiStar
217236 return false ;
218237 }
219238 } else if (atWhichRadiiToSelect == 2 ) {
220- if (pow (dphi_AT_SpecificRadii, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
239+ if (std:: pow (dphi_AT_SpecificRadii, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
221240 return true ;
222241 } else {
223242 if (Q3 == 999 ) {
@@ -236,6 +255,88 @@ class FemtoDreamDetaDphiStar
236255 return false ;
237256 }
238257
258+ } else if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kReso ) {
259+ // / V0-Reso combination
260+ // check if provided particles are in agreement with the class instantiation
261+ if (part1.partType () != o2::aod::femtodreamparticle::ParticleType::kV0 || (part2.partType () != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTOF_NegdaughTOF &&
262+ part2.partType () != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTOF_NegdaughTPC &&
263+ part2.partType () != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTPC_NegdaughTOF &&
264+ part2.partType () != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTPC_NegdaughTPC )) {
265+ LOG (fatal) << " FemtoDreamDetaDphiStar: passed arguments don't agree with FemtoDreamDetaDphiStar instantiation! Please provide kV0, kResoPosdaughTOF_NegdaughTOF, kResoPosdaughTOF_NegdaughTPC, kResoPosdaughTPC_NegdaughTOF, kResoPosdaughTPC_NegdaughTPC candidates." ;
266+ return false ;
267+ }
268+
269+ bool pass = false ;
270+ int nhist = 0 ;
271+ for (int i = 0 ; i < 2 ; i++) {
272+ int indexOfDaughterPart1, indexOfDaughterPart2;
273+ for (int j = 0 ; j < 2 ; j++) {
274+ if (isMixedEventLambda) {
275+ indexOfDaughterPart1 = part1.globalIndex () - 2 + i;
276+ indexOfDaughterPart2 = part2.globalIndex () - 2 + j;
277+ } else {
278+ indexOfDaughterPart1 = part1.index () - 2 + i;
279+ indexOfDaughterPart2 = part2.index () - 2 + j;
280+ }
281+
282+ auto daughterPart1 = particles.begin () + indexOfDaughterPart1;
283+ auto daughterPart2 = particles.begin () + indexOfDaughterPart2;
284+ auto deta = daughterPart1.eta () - daughterPart2.eta ();
285+ auto dphi_AT_PV = daughterPart1.phi () - daughterPart2.phi ();
286+ auto dphi_AT_SpecificRadii = PhiAtSpecificRadiiTPC (daughterPart1, radiiTPC) - PhiAtSpecificRadiiTPC (daughterPart2, radiiTPC);
287+ bool sameCharge = false ;
288+ auto dphiAvg = AveragePhiStar (*daughterPart1, *daughterPart2, nhist, &sameCharge);
289+ if (Q3 == 999 ) {
290+ histdetadpi[nhist][0 ]->Fill (deta, dphiAvg);
291+ histdetadpi[nhist][2 ]->Fill (deta, dphi_AT_PV);
292+ if (fillQA) {
293+ histdetadpi_eta[nhist]->Fill (deta, dphiAvg, daughterPart1.eta (), daughterPart2.eta ());
294+ histdetadpi_phi[nhist]->Fill (deta, dphiAvg, daughterPart1.phi (), daughterPart2.phi ());
295+ }
296+ }
297+ if (sameCharge) {
298+ if (atWhichRadiiToSelect == 1 ) {
299+ if (std::pow (dphiAvg, 2 ) / std::pow (deltaPhiMax, 2 ) + std::pow (deta, 2 ) / std::pow (deltaEtaMax, 2 ) < 1 .) {
300+ pass = true ;
301+ } else {
302+ if (Q3 == 999 ) {
303+ histdetadpi[nhist][1 ]->Fill (deta, dphiAvg);
304+ histdetadpi[nhist][3 ]->Fill (deta, dphi_AT_PV);
305+ } else if (Q3 < upperQ3LimitForPlotting) {
306+ histdetadpi[nhist][1 ]->Fill (deta, dphiAvg);
307+ histdetadpi[nhist][3 ]->Fill (deta, dphi_AT_PV);
308+ }
309+ }
310+ } else if (atWhichRadiiToSelect == 0 ) {
311+ if (std::pow (dphi_AT_PV, 2 ) / std::pow (deltaPhiMax, 2 ) + std::pow (deta, 2 ) / std::pow (deltaEtaMax, 2 ) < 1 .) {
312+ pass = true ;
313+ } else {
314+ if (Q3 == 999 ) {
315+ histdetadpi[nhist][1 ]->Fill (deta, dphiAvg);
316+ histdetadpi[nhist][3 ]->Fill (deta, dphi_AT_PV);
317+ } else if (Q3 < upperQ3LimitForPlotting) {
318+ histdetadpi[nhist][1 ]->Fill (deta, dphiAvg);
319+ histdetadpi[nhist][3 ]->Fill (deta, dphi_AT_PV);
320+ }
321+ }
322+ } else if (atWhichRadiiToSelect == 2 ) {
323+ if (std::pow (dphi_AT_SpecificRadii, 2 ) / std::pow (deltaPhiMax, 2 ) + std::pow (deta, 2 ) / std::pow (deltaEtaMax, 2 ) < 1 .) {
324+ pass = true ;
325+ } else {
326+ if (Q3 == 999 ) {
327+ histdetadpi[nhist][1 ]->Fill (deta, dphiAvg);
328+ histdetadpi[nhist][3 ]->Fill (deta, dphi_AT_PV);
329+ } else if (Q3 < upperQ3LimitForPlotting) {
330+ histdetadpi[nhist][1 ]->Fill (deta, dphiAvg);
331+ histdetadpi[nhist][3 ]->Fill (deta, dphi_AT_PV);
332+ }
333+ }
334+ }
335+ }
336+ nhist += 1 ;
337+ }
338+ }
339+ return pass;
239340 } else if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kV0 ) {
240341 // / Track-V0 combination
241342 // check if provided particles are in agreement with the class instantiation
@@ -275,7 +376,7 @@ class FemtoDreamDetaDphiStar
275376 }
276377 if (sameCharge) {
277378 if (atWhichRadiiToSelect == 1 ) {
278- if (pow (dphiAvg, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
379+ if (std:: pow (dphiAvg, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
279380 pass = true ;
280381 } else {
281382 if (Q3 == 999 ) {
@@ -287,7 +388,7 @@ class FemtoDreamDetaDphiStar
287388 }
288389 }
289390 } else if (atWhichRadiiToSelect == 0 ) {
290- if (pow (dphi_AT_PV, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
391+ if (std:: pow (dphi_AT_PV, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
291392 pass = true ;
292393 } else {
293394 if (Q3 == 999 ) {
@@ -299,7 +400,7 @@ class FemtoDreamDetaDphiStar
299400 }
300401 }
301402 } else if (atWhichRadiiToSelect == 2 ) {
302- if (pow (dphi_AT_SpecificRadii, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
403+ if (std:: pow (dphi_AT_SpecificRadii, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
303404 pass = true ;
304405 } else {
305406 if (Q3 == 999 ) {
@@ -352,7 +453,7 @@ class FemtoDreamDetaDphiStar
352453 }
353454 if (sameCharge) {
354455 if (atWhichRadiiToSelect == 1 ) {
355- if (pow (dphiAvg, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
456+ if (std:: pow (dphiAvg, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
356457 pass = true ;
357458 } else {
358459 if (Q3 == 999 ) {
@@ -364,7 +465,7 @@ class FemtoDreamDetaDphiStar
364465 }
365466 }
366467 } else if (atWhichRadiiToSelect == 0 ) {
367- if (pow (dphi_AT_PV, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
468+ if (std:: pow (dphi_AT_PV, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
368469 pass = true ;
369470 } else {
370471 if (Q3 == 999 ) {
@@ -376,7 +477,7 @@ class FemtoDreamDetaDphiStar
376477 }
377478 }
378479 } else if (atWhichRadiiToSelect == 2 ) {
379- if (pow (dphi_AT_SpecificRadii, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
480+ if (std:: pow (dphi_AT_SpecificRadii, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
380481 pass = true ;
381482 } else {
382483 if (Q3 == 999 ) {
@@ -455,7 +556,7 @@ class FemtoDreamDetaDphiStar
455556 }
456557
457558 if (atWhichRadiiToSelect == 1 ) {
458- if (pow (dphiAvg, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
559+ if (std:: pow (dphiAvg, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
459560 pass = true ;
460561 } else {
461562 if (Q3 == 999 ) {
@@ -467,7 +568,7 @@ class FemtoDreamDetaDphiStar
467568 }
468569 }
469570 } else if (atWhichRadiiToSelect == 0 ) {
470- if (pow (dphi_AT_PV, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
571+ if (std:: pow (dphi_AT_PV, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
471572 pass = true ;
472573 } else {
473574 if (Q3 == 999 ) {
@@ -479,7 +580,7 @@ class FemtoDreamDetaDphiStar
479580 }
480581 }
481582 } else if (atWhichRadiiToSelect == 2 ) {
482- if (pow (dphi_AT_SpecificRadii, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
583+ if (std:: pow (dphi_AT_SpecificRadii, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
483584 pass = true ;
484585 } else {
485586 if (Q3 == 999 ) {
@@ -534,7 +635,7 @@ class FemtoDreamDetaDphiStar
534635 }
535636 if (sameCharge) {
536637 if (atWhichRadiiToSelect == 1 ) {
537- if (pow (dphiAvg, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
638+ if (std:: pow (dphiAvg, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
538639 pass = true ;
539640 } else {
540641 if (Q3 == 999 ) {
@@ -547,7 +648,7 @@ class FemtoDreamDetaDphiStar
547648 }
548649
549650 } else if (atWhichRadiiToSelect == 0 ) {
550- if (pow (dphi_AT_PV, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
651+ if (std:: pow (dphi_AT_PV, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
551652 pass = true ;
552653 } else {
553654 if (Q3 == 999 ) {
@@ -559,7 +660,7 @@ class FemtoDreamDetaDphiStar
559660 }
560661 }
561662 } else if (atWhichRadiiToSelect == 2 ) {
562- if (pow (dphi_AT_SpecificRadii, 2 ) / pow (deltaPhiMax, 2 ) + pow (deta, 2 ) / pow (deltaEtaMax, 2 ) < 1 .) {
663+ if (std:: pow (dphi_AT_SpecificRadii, 2 ) / std:: pow (deltaPhiMax, 2 ) + std:: pow (deta, 2 ) / std:: pow (deltaEtaMax, 2 ) < 1 .) {
563664 pass = true ;
564665 } else {
565666 if (Q3 == 999 ) {
@@ -583,7 +684,7 @@ class FemtoDreamDetaDphiStar
583684 private:
584685 HistogramRegistry* mHistogramRegistry = nullptr ; // /< For main output
585686 HistogramRegistry* mHistogramRegistryQA = nullptr ; // /< For QA output
586- static constexpr std::string_view dirNames[4 ] = {" kTrack_kTrack/" , " kTrack_kV0/" , " kTrack_kCharmHadron/" , " kTrack_kCascade/" };
687+ static constexpr std::string_view dirNames[5 ] = {" kTrack_kTrack/" , " kTrack_kV0/" , " kTrack_kCharmHadron/" , " kTrack_kCascade/ " , " kV0_kReso /" };
587688
588689 static constexpr std::string_view histNameSEorME[3 ] = {" _SEandME" , " _SE" , " _ME" };
589690
0 commit comments