Skip to content

Commit 73d9faf

Browse files
prchakraalibuild
andauthored
[PWGCF] FemtoUniverse: Adding function to calculate fraction of bad TPC cluster points for closed-pairs (#12108)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 2cf896f commit 73d9faf

File tree

2 files changed

+86
-27
lines changed

2 files changed

+86
-27
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h

Lines changed: 61 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,64 @@ class FemtoUniverseDetaDphiStar
412410
}
413411
}
414412

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

559615
/// Calculate average phi
560616
template <typename T1, typename T2>
561-
float averagePhiStarFrac(const T1& part1, const T2& part2)
617+
float averagePhiStarFrac(const T1& part1, const T2& part2, float maxdist)
562618
{
563619
std::vector<float> tmpVec1;
564620
std::vector<float> tmpVec2;
@@ -579,7 +635,7 @@ class FemtoUniverseDetaDphiStar
579635
}
580636
dphi = TVector2::Phi_mpi_pi(dphi);
581637
distance = 2 * TMath::Sin(TMath::Abs(dphi) * 0.5) * TmpRadiiTPC[i];
582-
if (distance < 10.0) {
638+
if (distance < maxdist) {
583639
badpoints++;
584640
}
585641
}

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
183183
Configurable<bool> cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if cfgProcessMultBins is set false, this will not be processed regardless this Configurable state)"};
184184
Configurable<bool> cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and Mult bins"};
185185
Configurable<bool> ConfIsFillAngqLCMS{"ConfIsFillAngqLCMS", true, "Fill qLCMS vs dEta vs dPhi"};
186+
Configurable<float> confCPRDistMax{"confCPRDistMax", 0.0, "Max. radial seperation between two closed-pairs"};
187+
Configurable<float> confCPRFracMax{"confCPRFracMax", 0.0, "Max. allowed fraction bad to all TPC points of radial seperation between two closed-pairs"};
188+
Configurable<bool> confCPRDphiAvgOrDist{"confCPRDphiAvgOrDist", true, "Close Pair Rejection by radial or angular seperation"};
186189

187190
FemtoUniverseSHContainer<femto_universe_sh_container::EventType::same, femto_universe_sh_container::Observable::kstar> sameEventCont;
188191
FemtoUniverseSHContainer<femto_universe_sh_container::EventType::mixed, femto_universe_sh_container::Observable::kstar> mixedEventCont;
@@ -482,7 +485,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
482485
}
483486

484487
if (ConfIsCPR.value) {
485-
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
488+
if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) {
486489
continue;
487490
}
488491
}
@@ -506,7 +509,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
506509
}
507510

508511
if (ConfIsCPR.value) {
509-
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
512+
if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) {
510513
continue;
511514
}
512515
}
@@ -649,8 +652,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
649652
/// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels)
650653
/// \param magFieldTesla magnetic field of the collision
651654
/// \param multCol multiplicity of the collision
652-
template <bool isMC, typename PartitionType, typename PartType>
653-
void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType)
655+
template <bool isMC, typename PartitionType>
656+
void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, float magFieldTesla, int multCol, int ContType)
654657
{
655658

656659
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
@@ -664,7 +667,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
664667
}
665668

666669
if (ConfIsCPR.value) {
667-
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) {
670+
if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::mixed, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) {
668671
continue;
669672
}
670673
}
@@ -724,9 +727,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
724727

725728
/// process function for to call doMixedEvent with Data
726729
/// @param cols subscribe to the collisions table (Data)
727-
/// @param parts subscribe to the femtoUniverseParticleTable
730+
/// @param subscribe to the femtoUniverseParticleTable
728731
void processMixedEventCent(FilteredFDCollisions const& cols,
729-
FilteredFemtoFullParticles const& parts)
732+
FilteredFemtoFullParticles const&)
730733
{
731734
randgen = new TRandom2(0);
732735

@@ -745,17 +748,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
745748
if (cfgProcessPM) {
746749
auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
747750
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
748-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1);
751+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1);
749752
}
750753
if (cfgProcessPP) {
751754
auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
752755
auto groupPartsTwo = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
753-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2);
756+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2);
754757
}
755758
if (cfgProcessMM) {
756759
auto groupPartsOne = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
757760
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
758-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3);
761+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3);
759762
}
760763
}
761764
delete randgen;
@@ -766,7 +769,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
766769
/// @param cols subscribe to the collisions table (Data)
767770
/// @param parts subscribe to the femtoUniverseParticleTable
768771
void processMixedEventNtr(FilteredFDCollisions const& cols,
769-
FilteredFemtoFullParticles const& parts)
772+
FilteredFemtoFullParticles const&)
770773
{
771774
randgen = new TRandom2(0);
772775

@@ -785,17 +788,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
785788
if (cfgProcessPM) {
786789
auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
787790
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
788-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1);
791+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1);
789792
}
790793
if (cfgProcessPP) {
791794
auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
792795
auto groupPartsTwo = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
793-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2);
796+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2);
794797
}
795798
if (cfgProcessMM) {
796799
auto groupPartsOne = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
797800
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
798-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3);
801+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3);
799802
}
800803
}
801804
delete randgen;
@@ -827,7 +830,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
827830
/// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth
828831
/// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table
829832
void processMixedEventMCCent(o2::aod::FdCollisions const& cols,
830-
soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels> const& parts,
833+
soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels> const&,
831834
o2::aod::FdMCParticles const&)
832835
{
833836
randgen = new TRandom2(0);
@@ -849,17 +852,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
849852
if (cfgProcessPM) {
850853
auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
851854
auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
852-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1);
855+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1);
853856
}
854857
if (cfgProcessPP) {
855858
auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
856859
auto groupPartsTwo = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
857-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2);
860+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2);
858861
}
859862
if (cfgProcessMM) {
860863
auto groupPartsOne = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
861864
auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
862-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3);
865+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3);
863866
}
864867
}
865868
delete randgen;
@@ -871,7 +874,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
871874
/// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth
872875
/// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table
873876
void processMixedEventMCNtr(o2::aod::FdCollisions const& cols,
874-
soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels> const& parts,
877+
soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels> const&,
875878
o2::aod::FdMCParticles const&)
876879
{
877880
randgen = new TRandom2(0);
@@ -893,17 +896,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
893896
if (cfgProcessPM) {
894897
auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
895898
auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
896-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1);
899+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1);
897900
}
898901
if (cfgProcessPP) {
899902
auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
900903
auto groupPartsTwo = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
901-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2);
904+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2);
902905
}
903906
if (cfgProcessMM) {
904907
auto groupPartsOne = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
905908
auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
906-
doMixedEvent<false>(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3);
909+
doMixedEvent<false>(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3);
907910
}
908911
}
909912
delete randgen;

0 commit comments

Comments
 (0)