Skip to content

Commit d299e44

Browse files
committed
Adding function to calculate fraction of bad TPC cluster points for closed-pairs
1 parent b342dc8 commit d299e44

File tree

1 file changed

+62
-5
lines changed

1 file changed

+62
-5
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ class FemtoUniverseDetaDphiStar
169169
}
170170
auto deta = part1.eta() - part2.eta();
171171
auto dphiAvg = averagePhiStar(part1, part2, 0);
172-
auto dphi = averagePhiStarFrac(part1, part2);
173172
if (ChosenEventType == femto_universe_container::EventType::same) {
174173
histdetadpisame[0][0]->Fill(deta, dphiAvg);
175174
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
@@ -178,8 +177,7 @@ class FemtoUniverseDetaDphiStar
178177
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
179178
}
180179

181-
// if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) {
182-
if (dphi > 0.02) {
180+
if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) {
183181
return true;
184182
} else {
185183
if (ChosenEventType == femto_universe_container::EventType::same) {
@@ -412,6 +410,65 @@ class FemtoUniverseDetaDphiStar
412410
}
413411
}
414412

413+
414+
/// Check if pair is close or not
415+
template <typename Part>
416+
bool isClosePairFrac(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType, bool IsDphiAvgOrDist, float DistMax, float FracMax)
417+
{
418+
magfield = lmagfield;
419+
420+
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) {
421+
/// Track-Track combination
422+
// check if provided particles are in agreement with the class instantiation
423+
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack) {
424+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kTrack,kTrack candidates.";
425+
return false;
426+
}
427+
auto deta = part1.eta() - part2.eta();
428+
auto dphiAvg = averagePhiStar(part1, part2, 0);
429+
auto distfrac = averagePhiStarFrac(part1, part2, DistMax);
430+
if (ChosenEventType == femto_universe_container::EventType::same) {
431+
histdetadpisame[0][0]->Fill(deta, dphiAvg);
432+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
433+
histdetadpimixed[0][0]->Fill(deta, dphiAvg);
434+
} else {
435+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
436+
}
437+
438+
if (IsDphiAvgOrDist) {
439+
if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) {
440+
return true;
441+
} else {
442+
if (ChosenEventType == femto_universe_container::EventType::same) {
443+
histdetadpisame[0][1]->Fill(deta, dphiAvg);
444+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
445+
histdetadpimixed[0][1]->Fill(deta, dphiAvg);
446+
} else {
447+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
448+
}
449+
return false;
450+
}
451+
} else {
452+
if (distfrac > FracMax) {
453+
return true;
454+
} else {
455+
if (ChosenEventType == femto_universe_container::EventType::same) {
456+
histdetadpisame[0][1]->Fill(deta, dphiAvg);
457+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
458+
histdetadpimixed[0][1]->Fill(deta, dphiAvg);
459+
} else {
460+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
461+
}
462+
return false;
463+
}
464+
}
465+
466+
} else {
467+
LOG(fatal) << "FemtoUniversePairCleaner: Combination of objects not defined - quitting!";
468+
return false;
469+
}
470+
}
471+
415472
/// Check if pair is close or not
416473
template <typename Part>
417474
void ClosePairqLCMS(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType, double qlcms) // add typename Parts and variable parts for adding MClabels
@@ -558,7 +615,7 @@ class FemtoUniverseDetaDphiStar
558615

559616
/// Calculate average phi
560617
template <typename T1, typename T2>
561-
float averagePhiStarFrac(const T1& part1, const T2& part2)
618+
float averagePhiStarFrac(const T1& part1, const T2& part2, float maxdist)
562619
{
563620
std::vector<float> tmpVec1;
564621
std::vector<float> tmpVec2;
@@ -579,7 +636,7 @@ class FemtoUniverseDetaDphiStar
579636
}
580637
dphi = TVector2::Phi_mpi_pi(dphi);
581638
distance = 2 * TMath::Sin(TMath::Abs(dphi) * 0.5) * TmpRadiiTPC[i];
582-
if (distance < 10.0) {
639+
if (distance < maxdist) {
583640
badpoints++;
584641
}
585642
}

0 commit comments

Comments
 (0)