Skip to content

Commit ddb1263

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

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,65 @@ class FemtoUniverseDetaDphiStar
413413
}
414414
}
415415

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

0 commit comments

Comments
 (0)