Skip to content

Commit 69464ff

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 0788b52 + 6284574 commit 69464ff

File tree

16 files changed

+1982
-941
lines changed

16 files changed

+1982
-941
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class FemtoUniverseDetaDphiStar
111111
}
112112
}
113113
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kCascade && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
114-
/// Xi-Xi and Omega-Omega combination
114+
/// Cascade-Cascade combination
115115
for (int k = 0; k < 7; k++) {
116116
std::string dirName = static_cast<std::string>(DirNames[5]);
117117
histdetadpisame[k][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
@@ -126,7 +126,7 @@ class FemtoUniverseDetaDphiStar
126126
}
127127
}
128128
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
129-
/// Track-Xi and Track-Omega combination
129+
/// Track-Cascade combination
130130
for (int k = 0; k < 3; k++) {
131131
std::string dirName = static_cast<std::string>(DirNames[6]);
132132
histdetadpisame[k][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
@@ -140,6 +140,21 @@ class FemtoUniverseDetaDphiStar
140140
}
141141
}
142142
}
143+
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
144+
/// V0-Cascade combination
145+
for (int k = 0; k < 3; k++) {
146+
std::string dirName = static_cast<std::string>(DirNames[7]);
147+
histdetadpisame[k][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
148+
histdetadpisame[k][1] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
149+
histdetadpimixed[k][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
150+
histdetadpimixed[k][1] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
151+
if (plotForEveryRadii) {
152+
for (int l = 0; l < 9; l++) {
153+
histdetadpiRadii[k][l] = mHistogramRegistryQA->add<TH2>((dirName + static_cast<std::string>(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
154+
}
155+
}
156+
}
157+
}
143158
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) {
144159
for (int i = 0; i < 2; i++) {
145160
std::string dirName = static_cast<std::string>(DirNames[3]);
@@ -219,7 +234,6 @@ class FemtoUniverseDetaDphiStar
219234
bool pass = false;
220235
for (int i = 0; i < 2; i++) {
221236
auto indexOfDaughter = (ChosenEventType == femto_universe_container::EventType::mixed ? part2.globalIndex() : part2.index()) - 2 + i;
222-
// auto indexOfDaughter = part2.globalIndex() - 2 + i;
223237
auto daughter = particles.begin() + indexOfDaughter;
224238
auto deta = part1.eta() - daughter.eta();
225239
auto dphiAvg = averagePhiStar(part1, *daughter, i);
@@ -284,7 +298,7 @@ class FemtoUniverseDetaDphiStar
284298
return pass;
285299

286300
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kCascade && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
287-
/// Xi-Xi and Omega-Omega combination
301+
/// Cascade-Cascade combination
288302
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade) {
289303
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kCascade,kCascade candidates.";
290304
return false;
@@ -324,7 +338,7 @@ class FemtoUniverseDetaDphiStar
324338
return pass;
325339

326340
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
327-
/// Track-Xi and Track-Omega combination
341+
/// Track-Cascade combination
328342
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade) {
329343
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kTrack,kCascade candidates.";
330344
return false;
@@ -360,6 +374,46 @@ class FemtoUniverseDetaDphiStar
360374
}
361375
return pass;
362376

377+
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
378+
/// V0-Cascade combination
379+
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade) {
380+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kV0,kCascade candidates.";
381+
return false;
382+
}
383+
384+
bool pass = false;
385+
static constexpr int V0CascChildTable[][2] = {{-1, -1}, {-1, -2}, {-1, -3}, {-2, -1}, {-2, -2}, {-2, -3}};
386+
for (int i = 0; i < 3; i++) {
387+
auto indexOfDaughterV0 = (ChosenEventType == femto_universe_container::EventType::mixed ? part1.globalIndex() : part1.index()) + V0CascChildTable[i][0];
388+
auto indexOfDaughterCasc = (ChosenEventType == femto_universe_container::EventType::mixed ? part2.globalIndex() : part2.index()) + V0CascChildTable[i][1];
389+
auto daughterV0 = particles.begin() + indexOfDaughterV0;
390+
auto daughterCasc = particles.begin() + indexOfDaughterCasc;
391+
if (isSameSignCPR && (daughterV0.mAntiLambda() != daughterCasc.mAntiLambda())) // mAntiLambda() is used here as sign getter
392+
continue;
393+
auto deta = daughterV0.eta() - daughterCasc.eta();
394+
auto dphiAvg = averagePhiStar(*daughterV0, *daughterCasc, i);
395+
if (ChosenEventType == femto_universe_container::EventType::same) {
396+
histdetadpisame[i][0]->Fill(deta, dphiAvg);
397+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
398+
histdetadpimixed[i][0]->Fill(deta, dphiAvg);
399+
} else {
400+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
401+
}
402+
403+
if ((dphiAvg > cutDeltaPhiStarMin) && (dphiAvg < cutDeltaPhiStarMax) && (deta > cutDeltaEtaMin) && (deta < cutDeltaEtaMax)) {
404+
pass = true;
405+
} else {
406+
if (ChosenEventType == femto_universe_container::EventType::same) {
407+
histdetadpisame[i][1]->Fill(deta, dphiAvg);
408+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
409+
histdetadpimixed[i][1]->Fill(deta, dphiAvg);
410+
} else {
411+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
412+
}
413+
}
414+
}
415+
return pass;
416+
363417
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) {
364418
/// Track-D0 combination
365419
// check if provided particles are in agreement with the class instantiation
@@ -586,7 +640,7 @@ class FemtoUniverseDetaDphiStar
586640
private:
587641
HistogramRegistry* mHistogramRegistry = nullptr; ///< For main output
588642
HistogramRegistry* mHistogramRegistryQA = nullptr; ///< For QA output
589-
static constexpr std::string_view DirNames[7] = {"kTrack_kTrack/", "kTrack_kV0/", "kV0_kV0/", "kTrack_kPhi/", "kTrack_kD0/", "kCascade_kCascade/", "kTrack_kCascade/"};
643+
static constexpr std::string_view DirNames[8] = {"kTrack_kTrack/", "kTrack_kV0/", "kV0_kV0/", "kTrack_kPhi/", "kTrack_kD0/", "kCascade_kCascade/", "kTrack_kCascade/", "kV0_kCascade/"};
590644

591645
static constexpr std::string_view HistNamesSame[2][8] = {{"detadphidetadphi0BeforeSame_0", "detadphidetadphi0BeforeSame_1", "detadphidetadphi0BeforeSame_2",
592646
"detadphidetadphi0BeforeSame_3", "detadphidetadphi0BeforeSame_4", "detadphidetadphi0BeforeSame_5",

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
#include <TPDGCode.h>
3434

35+
#include <memory>
3536
#include <set>
37+
#include <string>
3638
#include <vector>
3739

3840
using namespace o2;
@@ -104,6 +106,9 @@ struct femtoUniversePairTaskTrackCascadeExtended {
104106
ConfigurableAxis confTrkTempFitVarBins{"confTrkTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"};
105107
Configurable<int> confNEventsMix{"confNEventsMix", 5, "Number of events for mixing"};
106108

109+
// Efficiency
110+
Configurable<std::string> confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"};
111+
107112
Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut);
108113
using FilteredFDCollisions = soa::Filtered<o2::aod::FdCollisions>;
109114
using FilteredFDCollision = FilteredFDCollisions::iterator;
@@ -152,6 +157,10 @@ struct femtoUniversePairTaskTrackCascadeExtended {
152157

153158
std::set<int> cascDuplicates;
154159

160+
std::unique_ptr<TFile> plocalEffFile;
161+
std::unique_ptr<TH1> plocalEffp1;
162+
std::unique_ptr<TH1> plocalEffp2;
163+
155164
// Table to select cascade daughters
156165
// Charges: = +--, +--, +-+, +-+
157166
static constexpr unsigned int CascChildTable[][3] = {{0, 1, 2}, {0, 1, 1}, {1, 0, 2}, {1, 0, 1}};
@@ -314,6 +323,21 @@ struct femtoUniversePairTaskTrackCascadeExtended {
314323
if (doprocessSameEventCasc || doprocessSameEventCascBitmask || doprocessMixedEventCasc || doprocessMixedEventCascBitmask)
315324
pairCloseRejectionCasc.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value);
316325
}
326+
327+
if (!confLocalEfficiency.value.empty()) {
328+
plocalEffFile = std::unique_ptr<TFile>(TFile::Open(confLocalEfficiency.value.c_str(), "read"));
329+
if (!plocalEffFile || plocalEffFile.get()->IsZombie())
330+
LOGF(fatal, "Could not load efficiency histogram from %s", confLocalEfficiency.value.c_str());
331+
if (doprocessSameEvent || doprocessSameEventBitmask || doprocessMixedEvent || doprocessMixedEventBitmask) {
332+
plocalEffp1 = (confChargePart1 > 0) ? std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("PrPlus")) : std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("PrMinus")); // note: works only for protons for now
333+
plocalEffp2 = (confCascType1 == 0 || confCascType1 == 1) ? std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("Cascade")) : std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("AntiCascade"));
334+
LOGF(info, "Loaded efficiency histograms for track-Cascade.");
335+
} else if (doprocessSameEventCasc || doprocessSameEventCascBitmask || doprocessMixedEventCasc || doprocessMixedEventCascBitmask) {
336+
plocalEffp1 = (confCascType1 == 0 || confCascType1 == 1) ? std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("Cascade")) : std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("AntiCascade"));
337+
plocalEffp2 = (confCascType2 == 0 || confCascType2 == 1) ? std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("Cascade")) : std::unique_ptr<TH1>(plocalEffFile.get()->Get<TH1>("AntiCascade"));
338+
LOGF(info, "Loaded efficiency histograms for Cascade-Cascade.");
339+
}
340+
}
317341
}
318342

319343
void processCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const FemtoFullParticles& parts, const aod::FDCascParticles& fdcascs)
@@ -484,7 +508,10 @@ struct femtoUniversePairTaskTrackCascadeExtended {
484508
if ((!confCheckTOFBachelorOnly && ((posChild.pidCut() & (8u << CascChildTable[confCascType1][0])) == 0 || (negChild.pidCut() & (8u << CascChildTable[confCascType1][1])) == 0)) || (bachelor.pidCut() & (8u << CascChildTable[confCascType1][2])) == 0)
485509
continue;
486510
}
487-
sameEventCont.setPair<false>(p1, p2, multCol, confUse3D, 1.0f);
511+
float weight = 1.0f;
512+
if (plocalEffp1)
513+
weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(p1.pt(), p1.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(p2.pt(), p2.eta()));
514+
sameEventCont.setPair<false>(p1, p2, multCol, confUse3D, weight);
488515
}
489516
}
490517

@@ -606,7 +633,10 @@ struct femtoUniversePairTaskTrackCascadeExtended {
606633
return;
607634
}
608635

609-
sameEventCont.setPair<false>(p1, p2, multCol, confUse3D, 1.0f);
636+
float weight = 1.0f;
637+
if (plocalEffp1)
638+
weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(p1.pt(), p1.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(p2.pt(), p2.eta()));
639+
sameEventCont.setPair<false>(p1, p2, multCol, confUse3D, weight);
610640
};
611641
cascDuplicates.clear();
612642
if (confCascType1 == confCascType2) {
@@ -698,7 +728,10 @@ struct femtoUniversePairTaskTrackCascadeExtended {
698728
}
699729
}
700730

701-
mixedEventCont.setPair<false>(p1, p2, multCol, confUse3D, 1.0f);
731+
float weight = 1.0f;
732+
if (plocalEffp1)
733+
weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(p1.pt(), p1.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(p2.pt(), p2.eta()));
734+
mixedEventCont.setPair<false>(p1, p2, multCol, confUse3D, weight);
702735
}
703736
};
704737

@@ -794,7 +827,10 @@ struct femtoUniversePairTaskTrackCascadeExtended {
794827
}
795828
}
796829

797-
mixedEventCont.setPair<false>(p1, p2, multCol, confUse3D, 1.0f);
830+
float weight = 1.0f;
831+
if (plocalEffp1)
832+
weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(p1.pt(), p1.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(p2.pt(), p2.eta()));
833+
mixedEventCont.setPair<false>(p1, p2, multCol, confUse3D, weight);
798834
}
799835
}
800836
}

0 commit comments

Comments
 (0)