Skip to content

Commit 87a0260

Browse files
authored
[PWGLF] Improve variable selection in mixed event (#11522)
1 parent 18fa5fc commit 87a0260

File tree

1 file changed

+87
-48
lines changed

1 file changed

+87
-48
lines changed

PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx

Lines changed: 87 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ struct LfTaskLambdaSpinCorr {
6161
Configurable<bool> cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"};
6262
} rctCut;
6363
// mixing
64-
Configurable<int> cosCalculation{"cosCalculation", 1, "cos calculation"};
65-
Configurable<int> mixingCombination{"mixingCombination", 1, "mixing Combination"};
64+
Configurable<int> cosCalculation{"cosCalculation", 0, "cos calculation"};
65+
Configurable<int> mixingCombination{"mixingCombination", 0, "mixing Combination"};
6666
Configurable<bool> mixingEvSel{"mixingEvSel", false, "mixingEvSel"};
6767
Configurable<int> cfgCutOccupancy{"cfgCutOccupancy", 2000, "Occupancy cut"};
6868
ConfigurableAxis axisVertex{"axisVertex", {5, -10, 10}, "vertex axis for bin"};
@@ -128,7 +128,8 @@ struct LfTaskLambdaSpinCorr {
128128
AxisSpec thnAxisInvMasspair{iMNbinspair, lbinIMpair, hbinIMpair, "#it{M} (GeV/#it{c}^{2})"};
129129
histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}});
130130
histos.add("hPtDiff", "hPtDiff", kTH1F, {{1000, 0, 100.0}});
131-
histos.add("hRDiff", "hRDiff", kTH1F, {{640, 0, 16.0}});
131+
histos.add("hPhiDiff", "hPhiDiff", kTH1F, {{800, -8.0, 8.0}});
132+
histos.add("hRDiff", "hRDiff", kTH1F, {{640, -16.0, 16.0}});
132133
histos.add("hv0Mult", "hv0Mult", kTH1F, {{10001, -0.5, 10000.5}});
133134
histos.add("hCentrality", "Centrality distribution", kTH1F, {{configcentAxis}});
134135
histos.add("hSparseLambdaLambda", "hSparseLambdaLambda", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true);
@@ -244,8 +245,8 @@ struct LfTaskLambdaSpinCorr {
244245
const ROOT::Math::PxPyPzMVector& Lambdadummy,
245246
const ROOT::Math::PxPyPzMVector& AntiLambdadummy)
246247
{
247-
const double minMass = 1.0;
248-
const double maxMass = 2.0;
248+
const double minMass = 1.09;
249+
const double maxMass = 1.14;
249250
return (lambdaTag && aLambdaTag &&
250251
(Lambdadummy.M() > minMass && Lambdadummy.M() < maxMass) &&
251252
(AntiLambdadummy.M() > minMass && AntiLambdadummy.M() < maxMass));
@@ -293,8 +294,8 @@ struct LfTaskLambdaSpinCorr {
293294
double cosTheta2 = proton2LambdaRF.Vect().Unit().Dot(quantizationAxis);
294295
cosThetaDiff = cosTheta1 * cosTheta2;
295296
}
296-
297-
double deltaR = TMath::Sqrt(TMath::Power(particle1.Eta() - particle2.Eta(), 2.0) + TMath::Power(particle1.Phi() - particle2.Phi(), 2.0));
297+
double deltaPhi = RecoDecay::constrainAngle(particle1.Phi() - particle2.Phi(), 0.0);
298+
double deltaR = TMath::Sqrt(TMath::Power(particle1.Eta() - particle2.Eta(), 2.0) + TMath::Power(deltaPhi, 2.0));
298299
if (datatype == 0) {
299300
if (tag1 && tag3) {
300301
histos.fill(HIST("hSparseLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
@@ -411,7 +412,7 @@ struct LfTaskLambdaSpinCorr {
411412

412413
return {lambdaTag, aLambdaTag, true}; // Valid candidate
413414
}
414-
415+
ROOT::Math::PxPyPzMVector lambda0, antiLambda0, proton0, pion0, antiProton0, antiPion0;
415416
ROOT::Math::PxPyPzMVector lambda, antiLambda, proton, pion, antiProton, antiPion;
416417
ROOT::Math::PxPyPzMVector lambda2, antiLambda2, proton2, pion2, antiProton2, antiPion2;
417418
ROOT::Math::PxPyPzMVector lambdamc, antiLambdamc, protonmc, pionmc, antiProtonmc, antiPionmc;
@@ -478,7 +479,12 @@ struct LfTaskLambdaSpinCorr {
478479
pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassPionCharged);
479480
antiLambda = antiProton + pion;
480481
}
481-
482+
if (lambdaTag && (lambda.M() < lbinIM || lambda.M() > hbinIM)) {
483+
continue;
484+
}
485+
if (aLambdaTag && (antiLambda.M() < lbinIM || antiLambda.M() > hbinIM)) {
486+
continue;
487+
}
482488
auto postrack1 = v0.template posTrack_as<AllTrackCandidates>();
483489
auto negtrack1 = v0.template negTrack_as<AllTrackCandidates>();
484490

@@ -504,6 +510,12 @@ struct LfTaskLambdaSpinCorr {
504510
pion2 = ROOT::Math::PxPyPzMVector(v02.pxpos(), v02.pypos(), v02.pzpos(), o2::constants::physics::MassPionCharged);
505511
antiLambda2 = antiProton2 + pion2;
506512
}
513+
if (lambdaTag2 && (lambda2.M() < lbinIM || lambda2.M() > hbinIM)) {
514+
continue;
515+
}
516+
if (aLambdaTag2 && (antiLambda2.M() < lbinIM || antiLambda2.M() > hbinIM)) {
517+
continue;
518+
}
507519
auto postrack2 = v02.template posTrack_as<AllTrackCandidates>();
508520
auto negtrack2 = v02.template negTrack_as<AllTrackCandidates>();
509521
if (postrack1.globalIndex() == postrack2.globalIndex() || negtrack1.globalIndex() == negtrack2.globalIndex()) {
@@ -630,8 +642,42 @@ struct LfTaskLambdaSpinCorr {
630642
if (postrack1.globalIndex() == postrack2.globalIndex() || negtrack1.globalIndex() == negtrack2.globalIndex()) {
631643
continue;
632644
}
633-
auto samePairSumPt = t1.pt() + t2.pt();
634-
auto samePairR = TMath::Sqrt(TMath::Power(t1.phi() - t2.phi(), 2.0) + TMath::Power(t1.eta() - t2.eta(), 2.0));
645+
// auto samePairSumPt = t1.pt() + t2.pt();
646+
double deltaPhiSame = RecoDecay::constrainAngle(t1.phi() - t2.phi(), 0.0);
647+
auto samePairR = TMath::Sqrt(TMath::Power(deltaPhiSame, 2.0) + TMath::Power(t1.eta() - t2.eta(), 2.0));
648+
649+
if (lambdaTag1) {
650+
proton0 = ROOT::Math::PxPyPzMVector(t1.pxpos(), t1.pypos(), t1.pzpos(), o2::constants::physics::MassProton);
651+
antiPion0 = ROOT::Math::PxPyPzMVector(t1.pxneg(), t1.pyneg(), t1.pzneg(), o2::constants::physics::MassPionCharged);
652+
lambda0 = proton0 + antiPion0;
653+
}
654+
if (aLambdaTag1) {
655+
antiProton0 = ROOT::Math::PxPyPzMVector(t1.pxneg(), t1.pyneg(), t1.pzneg(), o2::constants::physics::MassProton);
656+
pion0 = ROOT::Math::PxPyPzMVector(t1.pxpos(), t1.pypos(), t1.pzpos(), o2::constants::physics::MassPionCharged);
657+
antiLambda0 = antiProton0 + pion0;
658+
}
659+
if (lambdaTag1 && (lambda0.M() < lbinIM || lambda0.M() > hbinIM)) {
660+
continue;
661+
}
662+
if (aLambdaTag1 && (antiLambda0.M() < lbinIM || antiLambda0.M() > hbinIM)) {
663+
continue;
664+
}
665+
if (lambdaTag2) {
666+
proton = ROOT::Math::PxPyPzMVector(t2.pxpos(), t2.pypos(), t2.pzpos(), o2::constants::physics::MassProton);
667+
antiPion = ROOT::Math::PxPyPzMVector(t2.pxneg(), t2.pyneg(), t2.pzneg(), o2::constants::physics::MassPionCharged);
668+
lambda = proton + antiPion;
669+
}
670+
if (aLambdaTag2) {
671+
antiProton = ROOT::Math::PxPyPzMVector(t2.pxneg(), t2.pyneg(), t2.pzneg(), o2::constants::physics::MassProton);
672+
pion = ROOT::Math::PxPyPzMVector(t2.pxpos(), t2.pypos(), t2.pzpos(), o2::constants::physics::MassPionCharged);
673+
antiLambda = antiProton + pion;
674+
}
675+
if (lambdaTag2 && (lambda.M() < lbinIM || lambda.M() > hbinIM)) {
676+
continue;
677+
}
678+
if (aLambdaTag2 && (antiLambda.M() < lbinIM || antiLambda.M() > hbinIM)) {
679+
continue;
680+
}
635681
for (const auto& t3 : groupV03) {
636682
// if (pairStatus[t3.index()][t2.index()]) {
637683
// LOGF(info, "repeat match found v0 id: (%d, %d)", t3.index(), t2.index());
@@ -653,55 +699,49 @@ struct LfTaskLambdaSpinCorr {
653699
if (lambdaTag1 != lambdaTag3 || aLambdaTag1 != aLambdaTag3) {
654700
continue;
655701
}
656-
// if (std::abs(t1.pt() - t3.pt()) > ptMix) {
657-
// continue;
658-
// }
659-
// if (std::abs(t1.eta() - t3.eta()) > etaMix) {
660-
// continue;
661-
// }
662-
// if (std::abs(t1.phi() - t3.phi()) > phiMix) {
663-
// continue;
664-
// }
665-
auto mixPairSumPt = t3.pt() + t2.pt();
666-
auto mixPairR = TMath::Sqrt(TMath::Power(t3.phi() - t2.phi(), 2.0) + TMath::Power(t3.eta() - t2.eta(), 2.0));
667-
histos.fill(HIST("hPtDiff"), TMath::Abs(mixPairSumPt - samePairSumPt));
668-
histos.fill(HIST("hRDiff"), TMath::Abs(mixPairR - samePairR));
669-
if (mixingCombination == 0 && std::abs(t1.pt() - t3.pt()) > ptMix) {
670-
continue;
702+
703+
if (lambdaTag3) {
704+
proton2 = ROOT::Math::PxPyPzMVector(t3.pxpos(), t3.pypos(), t3.pzpos(), o2::constants::physics::MassProton);
705+
antiPion2 = ROOT::Math::PxPyPzMVector(t3.pxneg(), t3.pyneg(), t3.pzneg(), o2::constants::physics::MassPionCharged);
706+
lambda2 = proton2 + antiPion2;
707+
}
708+
if (aLambdaTag3) {
709+
antiProton2 = ROOT::Math::PxPyPzMVector(t3.pxneg(), t3.pyneg(), t3.pzneg(), o2::constants::physics::MassProton);
710+
pion2 = ROOT::Math::PxPyPzMVector(t3.pxpos(), t3.pypos(), t3.pzpos(), o2::constants::physics::MassPionCharged);
711+
antiLambda2 = antiProton2 + pion2;
671712
}
672-
if (mixingCombination == 0 && std::abs(t1.eta() - t3.eta()) > etaMix) {
713+
if (lambdaTag3 && (lambda2.M() < lbinIM || lambda2.M() > hbinIM)) {
673714
continue;
674715
}
675-
if (mixingCombination == 0 && std::abs(t1.phi() - t3.phi()) > phiMix) {
716+
if (aLambdaTag3 && (antiLambda2.M() < lbinIM || antiLambda2.M() > hbinIM)) {
676717
continue;
677718
}
719+
double deltaPhiMix = RecoDecay::constrainAngle(t3.phi() - t2.phi(), 0.0);
720+
auto mixPairR = TMath::Sqrt(TMath::Power(deltaPhiMix, 2.0) + TMath::Power(t3.eta() - t2.eta(), 2.0));
721+
auto etaDiff = t1.eta() - t3.eta();
722+
auto phiDiff = RecoDecay::constrainAngle(t1.phi() - t3.phi(), 0.0);
678723

679-
if (mixingCombination == 1 && std::abs(mixPairSumPt - samePairSumPt) > ptMix) {
724+
histos.fill(HIST("hPtDiff"), t1.pt() - t3.pt());
725+
histos.fill(HIST("hPhiDiff"), phiDiff);
726+
histos.fill(HIST("hRDiff"), etaDiff);
727+
728+
if (mixingCombination == 0 && std::abs(t1.pt() - t3.pt()) > ptMix) {
680729
continue;
681730
}
682-
if (mixingCombination == 1 && std::abs(mixPairR - samePairR) > etaMix) {
731+
if (mixingCombination == 0 && t1.eta() * t3.eta() > 0 && std::abs(etaDiff) > etaMix) {
683732
continue;
684733
}
685-
if (lambdaTag2) {
686-
proton = ROOT::Math::PxPyPzMVector(t2.pxpos(), t2.pypos(), t2.pzpos(), o2::constants::physics::MassProton);
687-
antiPion = ROOT::Math::PxPyPzMVector(t2.pxneg(), t2.pyneg(), t2.pzneg(), o2::constants::physics::MassPionCharged);
688-
lambda = proton + antiPion;
689-
}
690-
if (aLambdaTag2) {
691-
antiProton = ROOT::Math::PxPyPzMVector(t2.pxneg(), t2.pyneg(), t2.pzneg(), o2::constants::physics::MassProton);
692-
pion = ROOT::Math::PxPyPzMVector(t2.pxpos(), t2.pypos(), t2.pzpos(), o2::constants::physics::MassPionCharged);
693-
antiLambda = antiProton + pion;
734+
if (mixingCombination == 0 && phiDiff > phiMix) {
735+
continue;
694736
}
695-
if (lambdaTag3) {
696-
proton2 = ROOT::Math::PxPyPzMVector(t3.pxpos(), t3.pypos(), t3.pzpos(), o2::constants::physics::MassProton);
697-
antiPion2 = ROOT::Math::PxPyPzMVector(t3.pxneg(), t3.pyneg(), t3.pzneg(), o2::constants::physics::MassPionCharged);
698-
lambda2 = proton2 + antiPion2;
737+
738+
if (mixingCombination == 1 && std::abs(t1.pt() - t3.pt()) > ptMix) {
739+
continue;
699740
}
700-
if (aLambdaTag3) {
701-
antiProton2 = ROOT::Math::PxPyPzMVector(t3.pxneg(), t3.pyneg(), t3.pzneg(), o2::constants::physics::MassProton);
702-
pion2 = ROOT::Math::PxPyPzMVector(t3.pxpos(), t3.pypos(), t3.pzpos(), o2::constants::physics::MassPionCharged);
703-
antiLambda2 = antiProton2 + pion2;
741+
if (mixingCombination == 1 && std::abs(mixPairR - samePairR) > etaMix) {
742+
continue;
704743
}
744+
705745
if (lambdaTag2 && lambdaTag3) {
706746
fillHistograms(1, 0, 1, 0, lambda, lambda2, proton, proton2, centrality, 2);
707747
} else if (aLambdaTag2 && aLambdaTag3) {
@@ -714,7 +754,6 @@ struct LfTaskLambdaSpinCorr {
714754
continue;
715755
}
716756
pairfound = true;
717-
// pairStatus[t3.index()][t2.index()] = true;
718757
pairStatus[t3.index()][t2.index()] = true;
719758
// LOGF(info, "v0 id: (%d, %d)", t3.index(), t2.index());
720759
if (pairfound) {

0 commit comments

Comments
 (0)