Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
Configurable<bool> useCentralityinPrediction{"useCentralityinPrediction", false, "if true, use centrality instead of multiplisity"};
Configurable<bool> doMirroringInDelataEta{"doMirroringInDelataEta", false, "if true, fill only positive delta eta and mirror the negative side in post processing, Adjust the delta axis!"};
Configurable<bool> fillCorrelationHistWithMass{"fillCorrelationHistWithMass", false, "if true, fill correlation histograms with particle mass"};
Configurable<bool> doMassSpectrumCheck{"doMassSpectrumCheck", false, "if true, add and fill invariant-mass spectrum"};
} masterConfigurations;

// master analysis switches
Expand Down Expand Up @@ -380,6 +381,19 @@
static constexpr int IndexLambda = 1;
static constexpr int IndexAntiLambda = 2;

template <int Index, typename TV0>
static float getV0InvariantMass(TV0 const& v0)
{
static_assert(Index >= IndexK0 && Index <= IndexAntiLambda);
if constexpr (Index == IndexK0) {
return v0.mK0Short();
} else if constexpr (Index == IndexLambda) {
return v0.mLambda();
} else {
return v0.mAntiLambda();
}
}

uint16_t doCorrelation;
int mRunNumber;
int mRunNumberZorro;
Expand Down Expand Up @@ -949,19 +963,7 @@
}
if (assocCandidate.compatible(Index, trackSelection.dEdxCompatibility) && (!masterConfigurations.doMCassociation || assocCandidate.mcTrue(Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary()) && !mixing && (masterConfigurations.fillCorrelationHistWithMass || (-massWindowConfigurations.maxPeakNSigma < assocCandidate.invMassNSigma(Index) && assocCandidate.invMassNSigma(Index) < +massWindowConfigurations.maxPeakNSigma))) {
if (masterConfigurations.fillCorrelationHistWithMass) {
float massAssoc = 0.f;
switch (i) {
case 0:
massAssoc = assoc.mK0Short();
break;
case 1:
massAssoc = assoc.mLambda();
break;
case 2:
massAssoc = assoc.mAntiLambda();
break;
}
binFillThn[1] = massAssoc;
binFillThn[1] = getV0InvariantMass<Index>(assoc);
}
fillCorrelationHistogram(histos.get<THn>(HIST("sameEvent/Signal/") + HIST(V0names[Index])), binFillThn, etaWeight, efficiency * efficiencyTrigg, totalEffUncert, purityTrigg, purityTriggErr);
if (std::abs(deltaphi) < checks.towardDeltaEtaRange && doITSClustersQA) {
Expand Down Expand Up @@ -1036,9 +1038,9 @@
int binnumb = binMult * nBinsVtxZ + binVtxZ;
int hastirgorassoc = masterConfigurations.collisionHasTriggOrAssoc;
if ((hastirgorassoc == 1 && currentCollision.trigParticles.empty()) ||
(hastirgorassoc == 2 && currentCollision.assocParticles.empty()) ||

Check failure on line 1041 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
(hastirgorassoc == 3 && currentCollision.trigParticles.empty() && currentCollision.assocParticles.empty()) ||

Check failure on line 1042 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
(hastirgorassoc == 4 && (currentCollision.trigParticles.empty() || currentCollision.assocParticles.empty())))

Check failure on line 1043 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
for (const auto& collision : validCollisions[binnumb]) {
BinningTypePP colBinning{{axesConfigurations.axisVtxZ, axesConfigurations.axisMult}, true};
Expand Down Expand Up @@ -1074,7 +1076,7 @@
if (Index == assoc.type && assoc.region == 1) {
fillCorrelationHistogram(histos.get<THn>(HIST("mixedEvent/Signal/") + HIST(V0names[Index])), binFillThn, 1, efficiencyTrigg * efficiencyAssoc, totalEffUncert, 1., 0.);
}
if (Index == assoc.type && assoc.region == 2) {

Check failure on line 1079 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
fillCorrelationHistogram(histos.get<THn>(HIST("mixedEvent/RightBg/") + HIST(V0names[Index])), binFillThn, 1, efficiencyTrigg * efficiencyAssoc, totalEffUncert, 1., 0.);
}
});
Expand Down Expand Up @@ -1349,9 +1351,9 @@
int binnumb = binMult * nBinsVtxZ + binVtxZ;
int hastirgorassoc = masterConfigurations.collisionHasTriggOrAssoc;
if ((hastirgorassoc == 1 && currentCollision.trigParticles.empty()) ||
(hastirgorassoc == 2 && currentCollision.assocParticles.empty()) ||

Check failure on line 1354 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
(hastirgorassoc == 3 && currentCollision.trigParticles.empty() && currentCollision.assocParticles.empty()) ||

Check failure on line 1355 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
(hastirgorassoc == 4 && (currentCollision.trigParticles.empty() || currentCollision.assocParticles.empty())))

Check failure on line 1356 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
for (const auto& collision : validCollisions[binnumb]) {
BinningTypePP colBinning{{axesConfigurations.axisVtxZ, axesConfigurations.axisMult}, true};
Expand Down Expand Up @@ -1382,7 +1384,7 @@
if (Index == assoc.type && assoc.region == 1) {
fillCorrelationHistogram(histos.get<THn>(HIST("mixedEvent/Signal/") + HIST(Cascadenames[Index])), binFillThn, 1, efficiencyTrigg * efficiencyAssoc, totalEffUncert, 1., 0.);
}
if (Index == assoc.type && assoc.region == 2) {

Check failure on line 1387 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
fillCorrelationHistogram(histos.get<THn>(HIST("mixedEvent/RightBg/") + HIST(Cascadenames[Index])), binFillThn, 1, efficiencyTrigg * efficiencyAssoc, totalEffUncert, 1., 0.);
}
});
Expand Down Expand Up @@ -1907,7 +1909,15 @@
histos.addClone("sameEvent/Signal/", "sameEvent/LeftBg/");
histos.addClone("sameEvent/Signal/", "sameEvent/RightBg/");
}

if (TESTBIT(doCorrelation, 0) && doprocessSameEventHV0s && masterConfigurations.doMassSpectrumCheck) {
histos.add("hK0ShortPtVsMass", "", kTH2F, {axesConfigurations.axisPtQA, axesConfigurations.axisK0ShortMass});
}
if (TESTBIT(doCorrelation, 1) && doprocessSameEventHV0s && masterConfigurations.doMassSpectrumCheck) {
histos.add("hLambdaPtVsMass", "", kTH2F, {axesConfigurations.axisPtQA, axesConfigurations.axisLambdaMass});
}
if (TESTBIT(doCorrelation, 2) && doprocessSameEventHV0s && masterConfigurations.doMassSpectrumCheck) {
histos.add("hAntiLambdaPtVsMass", "", kTH2F, {axesConfigurations.axisPtQA, axesConfigurations.axisLambdaMass});
}
LOGF(info, "Init THnFs done");
// mixed-event correlation functions
if ((doprocessMixedEventHV0sInBuffer || doprocessMixedEventHCascadesInBuffer || doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions || doprocessMixedEventHHadrons) && masterConfigurations.doFullCorrelationStudy) {
Expand Down Expand Up @@ -2369,6 +2379,9 @@
if (v0.compatible(Index, trackSelection.dEdxCompatibility) && (!masterConfigurations.doMCassociation || v0.mcTrue(Index)) && (!doAssocPhysicalPrimary || v0.mcPhysicalPrimary()) && (!efficiencyFlags.applyEfficiencyCorrection || efficiency != 0)) {
if ((TESTBIT(doCorrelation, Index)) && (masterConfigurations.doPPAnalysis || (TESTBIT(selMap, Index) && TESTBIT(selMap, Index + 3)))) {
histos.fill(HIST("h3d") + HIST(V0names[Index]) + HIST("Spectrum"), v0Data.pt(), cent, v0.invMassNSigma(Index), weight);
if (masterConfigurations.doMassSpectrumCheck) {
histos.fill(HIST("h") + HIST(V0names[Index]) + HIST("PtVsMass"), v0Data.pt(), getV0InvariantMass<Index>(v0Data));
}
if (std::abs(v0Data.rapidity(Index)) < ySel) {
histos.fill(HIST("h3d") + HIST(V0names[Index]) + HIST("SpectrumY"), v0Data.pt(), cent, v0.invMassNSigma(Index), weight);
}
Expand Down
Loading