Skip to content

Commit e4dd716

Browse files
authored
[PWGLF] Fix bug in calculation of SV radii for hyphe4s (#11770)
1 parent 3737c93 commit e4dd716

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

PWGLF/TableProducer/Nuspex/hyperhelium4sigmaRecoTask.cxx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ struct Hyperhelium4sigmaRecoTask {
374374
hyphe4sCand.primVtx[0] = collision.posX();
375375
hyphe4sCand.primVtx[1] = collision.posY();
376376
hyphe4sCand.primVtx[2] = collision.posZ();
377-
hyphe4sCand.decVtx[0] = kinkCand.xDecVtx();
378-
hyphe4sCand.decVtx[1] = kinkCand.yDecVtx();
379-
hyphe4sCand.decVtx[2] = kinkCand.zDecVtx();
377+
hyphe4sCand.decVtx[0] = kinkCand.xDecVtx() + collision.posX();
378+
hyphe4sCand.decVtx[1] = kinkCand.yDecVtx() + collision.posY();
379+
hyphe4sCand.decVtx[2] = kinkCand.zDecVtx() + collision.posZ();
380380

381381
hyphe4sCand.momMoth[0] = kinkCand.pxMoth();
382382
hyphe4sCand.momMoth[1] = kinkCand.pyMoth();
@@ -531,10 +531,11 @@ struct Hyperhelium4sigmaRecoTask {
531531
if (isTrueSignal) {
532532
auto mcMotherTrack = motherTrack.mcParticle_as<aod::McParticles>();
533533
auto mcDauTrack = dauTrack.mcParticle_as<aod::McParticles>();
534-
float recSVR = std::sqrt(kinkCand.xDecVtx() * kinkCand.xDecVtx() + kinkCand.yDecVtx() * kinkCand.yDecVtx());
535-
registry.fill(HIST("hDiffSVx"), kinkCand.xDecVtx() - mcDauTrack.vx());
536-
registry.fill(HIST("hDiffSVy"), kinkCand.yDecVtx() - mcDauTrack.vy());
537-
registry.fill(HIST("hDiffSVz"), kinkCand.zDecVtx() - mcDauTrack.vz());
534+
float posDecVtx[3] = {kinkCand.xDecVtx() + collision.posX(), kinkCand.yDecVtx() + collision.posY(), kinkCand.zDecVtx() + collision.posZ()};
535+
float recSVR = std::sqrt(posDecVtx[0] * posDecVtx[0] + posDecVtx[1] * posDecVtx[1]);
536+
registry.fill(HIST("hDiffSVx"), posDecVtx[0] - mcDauTrack.vx());
537+
registry.fill(HIST("hDiffSVy"), posDecVtx[1] - mcDauTrack.vy());
538+
registry.fill(HIST("hDiffSVz"), posDecVtx[2] - mcDauTrack.vz());
538539
registry.fill(HIST("h2RecSVRVsTrueSVR"), recSVR, std::hypot(mcDauTrack.vx(), mcDauTrack.vy()));
539540
registry.fill(HIST("h2TrueMotherDiffPtVsRecSVR"), recSVR, mcMotherTrack.pt() - kinkCand.ptMoth());
540541
registry.fill(HIST("h2TrueMotherDiffPzVsRecSVR"), recSVR, mcMotherTrack.pz() - kinkCand.pzMoth());
@@ -557,7 +558,7 @@ struct Hyperhelium4sigmaRecoTask {
557558
initCCDB(bc);
558559
std::array<float, 2> dcaInfo;
559560
auto mcMotherTrackPar = getTrackParFromMC(mcMotherTrack);
560-
o2::base::Propagator::Instance()->propagateToDCABxByBz({kinkCand.xDecVtx(), kinkCand.yDecVtx(), kinkCand.zDecVtx()}, mcMotherTrackPar, 2.f, matCorr, &dcaInfo);
561+
o2::base::Propagator::Instance()->propagateToDCABxByBz({posDecVtx[0], posDecVtx[1], posDecVtx[2]}, mcMotherTrackPar, 2.f, matCorr, &dcaInfo);
561562
registry.fill(HIST("hDCAXYMothToRecSV"), dcaInfo[0]);
562563
registry.fill(HIST("hDCAZMothToRecSV"), dcaInfo[1]);
563564
std::array<float, 3> pMotherAtSV = {-999.f, -999.f, -999.f};
@@ -570,7 +571,7 @@ struct Hyperhelium4sigmaRecoTask {
570571
float pMoth = std::hypot(kinkCand.pxMoth(), kinkCand.pyMoth(), kinkCand.pzMoth());
571572
float pDaug = std::hypot(kinkCand.pxDaug(), kinkCand.pyDaug(), kinkCand.pzDaug());
572573

573-
float mothPDir[3] = {kinkCand.xDecVtx() - collision.posX(), kinkCand.yDecVtx() - collision.posY(), kinkCand.zDecVtx() - collision.posZ()};
574+
float mothPDir[3] = {kinkCand.xDecVtx(), kinkCand.yDecVtx(), kinkCand.zDecVtx()};
574575
float magMothPDirXY = std::hypot(mothPDir[0], mothPDir[1]);
575576
float magMothPDir = std::hypot(mothPDir[0], mothPDir[1], mothPDir[2]);
576577
float spKinkSV = mothPDir[0] * kinkCand.pxDaug() + mothPDir[1] * kinkCand.pyDaug() + mothPDir[2] * kinkCand.pzDaug();
@@ -998,8 +999,10 @@ struct Hyperhelium4sigmaQa {
998999
recoQAHist.fill(HIST("hDauAlphaIsPVContributer"), daughterTrack.isPVContributor() ? 1.5 : 0.5);
9991000

10001001
float itsNSigma = itsResponse.nSigmaITS<o2::track::PID::Alpha>(daughterTrack);
1001-
recoQAHist.fill(HIST("hDauAlphaPVsITSNSigma"), daughterTrack.sign() * daughterTrack.p(), itsNSigma);
1002-
recoQAHist.fill(HIST("hDauAlphaITSCls"), daughterTrack.itsNCls());
1002+
if (daughterTrack.hasITS()) {
1003+
recoQAHist.fill(HIST("hDauAlphaPVsITSNSigma"), daughterTrack.sign() * daughterTrack.p(), itsNSigma);
1004+
recoQAHist.fill(HIST("hDauAlphaITSCls"), daughterTrack.itsNCls());
1005+
}
10031006

10041007
if (motherTrack.has_collision() && daughterTrack.has_collision()) {
10051008
recoQAHist.fill(HIST("hReco2BCandidateCount"), 1.5);

0 commit comments

Comments
 (0)