Skip to content

Commit d3d978c

Browse files
authored
[PWGLF] Add Mass Spectrum in H-Strangeness (#17090)
1 parent a64d78a commit d3d978c

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ struct HStrangeCorrelation {
128128
Configurable<bool> useCentralityinPrediction{"useCentralityinPrediction", false, "if true, use centrality instead of multiplisity"};
129129
Configurable<bool> doMirroringInDelataEta{"doMirroringInDelataEta", false, "if true, fill only positive delta eta and mirror the negative side in post processing, Adjust the delta axis!"};
130130
Configurable<bool> fillCorrelationHistWithMass{"fillCorrelationHistWithMass", false, "if true, fill correlation histograms with particle mass"};
131+
Configurable<bool> doMassSpectrumCheck{"doMassSpectrumCheck", false, "if true, add and fill invariant-mass spectrum"};
131132
} masterConfigurations;
132133

133134
// master analysis switches
@@ -380,6 +381,19 @@ struct HStrangeCorrelation {
380381
static constexpr int IndexLambda = 1;
381382
static constexpr int IndexAntiLambda = 2;
382383

384+
template <int Index, typename TV0>
385+
static float getV0InvariantMass(TV0 const& v0)
386+
{
387+
static_assert(Index >= IndexK0 && Index <= IndexAntiLambda);
388+
if constexpr (Index == IndexK0) {
389+
return v0.mK0Short();
390+
} else if constexpr (Index == IndexLambda) {
391+
return v0.mLambda();
392+
} else {
393+
return v0.mAntiLambda();
394+
}
395+
}
396+
383397
uint16_t doCorrelation;
384398
int mRunNumber;
385399
int mRunNumberZorro;
@@ -949,19 +963,7 @@ struct HStrangeCorrelation {
949963
}
950964
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))) {
951965
if (masterConfigurations.fillCorrelationHistWithMass) {
952-
float massAssoc = 0.f;
953-
switch (i) {
954-
case 0:
955-
massAssoc = assoc.mK0Short();
956-
break;
957-
case 1:
958-
massAssoc = assoc.mLambda();
959-
break;
960-
case 2:
961-
massAssoc = assoc.mAntiLambda();
962-
break;
963-
}
964-
binFillThn[1] = massAssoc;
966+
binFillThn[1] = getV0InvariantMass<Index>(assoc);
965967
}
966968
fillCorrelationHistogram(histos.get<THn>(HIST("sameEvent/Signal/") + HIST(V0names[Index])), binFillThn, etaWeight, efficiency * efficiencyTrigg, totalEffUncert, purityTrigg, purityTriggErr);
967969
if (std::abs(deltaphi) < checks.towardDeltaEtaRange && doITSClustersQA) {
@@ -1907,7 +1909,15 @@ struct HStrangeCorrelation {
19071909
histos.addClone("sameEvent/Signal/", "sameEvent/LeftBg/");
19081910
histos.addClone("sameEvent/Signal/", "sameEvent/RightBg/");
19091911
}
1910-
1912+
if (TESTBIT(doCorrelation, 0) && doprocessSameEventHV0s && masterConfigurations.doMassSpectrumCheck) {
1913+
histos.add("hK0ShortPtVsMass", "", kTH2F, {axesConfigurations.axisPtQA, axesConfigurations.axisK0ShortMass});
1914+
}
1915+
if (TESTBIT(doCorrelation, 1) && doprocessSameEventHV0s && masterConfigurations.doMassSpectrumCheck) {
1916+
histos.add("hLambdaPtVsMass", "", kTH2F, {axesConfigurations.axisPtQA, axesConfigurations.axisLambdaMass});
1917+
}
1918+
if (TESTBIT(doCorrelation, 2) && doprocessSameEventHV0s && masterConfigurations.doMassSpectrumCheck) {
1919+
histos.add("hAntiLambdaPtVsMass", "", kTH2F, {axesConfigurations.axisPtQA, axesConfigurations.axisLambdaMass});
1920+
}
19111921
LOGF(info, "Init THnFs done");
19121922
// mixed-event correlation functions
19131923
if ((doprocessMixedEventHV0sInBuffer || doprocessMixedEventHCascadesInBuffer || doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions || doprocessMixedEventHHadrons) && masterConfigurations.doFullCorrelationStudy) {
@@ -2369,6 +2379,9 @@ struct HStrangeCorrelation {
23692379
if (v0.compatible(Index, trackSelection.dEdxCompatibility) && (!masterConfigurations.doMCassociation || v0.mcTrue(Index)) && (!doAssocPhysicalPrimary || v0.mcPhysicalPrimary()) && (!efficiencyFlags.applyEfficiencyCorrection || efficiency != 0)) {
23702380
if ((TESTBIT(doCorrelation, Index)) && (masterConfigurations.doPPAnalysis || (TESTBIT(selMap, Index) && TESTBIT(selMap, Index + 3)))) {
23712381
histos.fill(HIST("h3d") + HIST(V0names[Index]) + HIST("Spectrum"), v0Data.pt(), cent, v0.invMassNSigma(Index), weight);
2382+
if (masterConfigurations.doMassSpectrumCheck) {
2383+
histos.fill(HIST("h") + HIST(V0names[Index]) + HIST("PtVsMass"), v0Data.pt(), getV0InvariantMass<Index>(v0Data));
2384+
}
23722385
if (std::abs(v0Data.rapidity(Index)) < ySel) {
23732386
histos.fill(HIST("h3d") + HIST(V0names[Index]) + HIST("SpectrumY"), v0Data.pt(), cent, v0.invMassNSigma(Index), weight);
23742387
}

0 commit comments

Comments
 (0)