Skip to content

Commit 6f56667

Browse files
authored
[PWGHF] XicToXiPiPi: Add chi2topo before applying topological constraints (#8323)
Co-authored-by: Phil Lennart Stahlhut <phil.lennart.stahlhut@cern.ch>
1 parent 62ae12f commit 6f56667

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

PWGHF/DataModel/CandidateReconstructionTables.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,9 @@ DECLARE_SOA_COLUMN(DcaPi0Pi1, dcaPi0Pi1, float);
15201520
DECLARE_SOA_COLUMN(DcaPi0Xi, dcaPi0Xi, float);
15211521
DECLARE_SOA_COLUMN(DcaPi1Xi, dcaPi1Xi, float);
15221522
DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPV, chi2TopoXicPlusToPV, float);
1523+
DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPVBeforeConstraint, chi2TopoXicPlusToPVBeforeConstraint, float);
15231524
DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlus, chi2TopoXiToXicPlus, float);
1525+
DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlusBeforeConstraint, chi2TopoXiToXicPlusBeforeConstraint, float);
15241526
// MC matching result:
15251527
DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level
15261528
DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // generator level
@@ -1591,7 +1593,8 @@ DECLARE_SOA_EXTENDED_TABLE_USER(HfCandXicExt, HfCandXicBase, "HFCANDXICEXT",
15911593
using HfCandXic = HfCandXicExt;
15921594

15931595
DECLARE_SOA_TABLE(HfCandXicKF, "AOD", "HFCANDXICKF",
1594-
cascdata::KFCascadeChi2, cascdata::KFV0Chi2, hf_cand_xic_to_xi_pi_pi::Chi2TopoXicPlusToPV, hf_cand_xic_to_xi_pi_pi::Chi2TopoXiToXicPlus,
1596+
cascdata::KFCascadeChi2, cascdata::KFV0Chi2,
1597+
hf_cand_xic_to_xi_pi_pi::Chi2TopoXicPlusToPVBeforeConstraint, hf_cand_xic_to_xi_pi_pi::Chi2TopoXicPlusToPV, hf_cand_xic_to_xi_pi_pi::Chi2TopoXiToXicPlusBeforeConstraint, hf_cand_xic_to_xi_pi_pi::Chi2TopoXiToXicPlus,
15951598
hf_cand_xic_to_xi_pi_pi::DcaXYPi0Pi1, hf_cand_xic_to_xi_pi_pi::DcaXYPi0Xi, hf_cand_xic_to_xi_pi_pi::DcaXYPi1Xi,
15961599
hf_cand_xic_to_xi_pi_pi::DcaPi0Pi1, hf_cand_xic_to_xi_pi_pi::DcaPi0Xi, hf_cand_xic_to_xi_pi_pi::DcaPi1Xi,
15971600
cascdata::DCACascDaughters);

PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#define HomogeneousField
2121
#endif
2222

23+
#include <string>
24+
#include <utility>
25+
#include <vector>
26+
2327
#include <KFParticleBase.h>
2428
#include <KFParticle.h>
2529
#include <KFPTrack.h>
@@ -309,12 +313,12 @@ struct HfCandidateCreatorXicToXiPiPi {
309313
//---------------------------------fill candidate table rows-------------------------------------------------------------------------------------------
310314
rowCandidateBase(collision.globalIndex(),
311315
primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(),
312-
covMatrixPV[0], covMatrixPV[2], covMatrixPV[5],
316+
std::sqrt(covMatrixPV[0]), std::sqrt(covMatrixPV[2]), std::sqrt(covMatrixPV[5]),
313317
/*3-prong specific columns*/
314318
rowTrackIndexXicPlus.cascadeId(), rowTrackIndexXicPlus.prong0Id(), rowTrackIndexXicPlus.prong1Id(),
315319
casc.bachelorId(), casc.posTrackId(), casc.negTrackId(),
316320
secondaryVertex[0], secondaryVertex[1], secondaryVertex[2],
317-
covMatrixSV[0], covMatrixSV[2], covMatrixSV[5],
321+
std::sqrt(covMatrixSV[0]), std::sqrt(covMatrixSV[2]), std::sqrt(covMatrixSV[5]),
318322
errorDecayLength, errorDecayLengthXY,
319323
chi2SV, massXiPiPi, signXic,
320324
pVecXi[0], pVecXi[1], pVecXi[2],
@@ -416,15 +420,17 @@ struct HfCandidateCreatorXicToXiPiPi {
416420
float chi2GeoXicPlus = kfXicPlus.GetChi2() / kfXicPlus.GetNDF();
417421

418422
// topological constraint of Xic to PV
423+
float chi2topoXicPlusToPVBeforeConstraint = kfXicPlus.GetDeviationFromVertex(KFPV);
419424
KFParticle kfXicPlusToPV = kfXicPlus;
420425
kfXicPlusToPV.SetProductionVertex(KFPV);
421-
float chi2topoXicPlusPV = kfXicPlusToPV.GetChi2() / kfXicPlusToPV.GetNDF();
426+
float chi2topoXicPlusToPV = kfXicPlusToPV.GetChi2() / kfXicPlusToPV.GetNDF();
422427
if (constrainXicPlusToPv) {
423428
kfXicPlus = kfXicPlusToPV;
424429
kfXicPlus.TransportToDecayVertex();
425430
}
426431

427432
// topological constraint of Xi to XicPlus
433+
float chi2topoXiToXicPlusBeforeConstraint = kfXi.GetDeviationFromVertex(kfXicPlus);
428434
KFParticle kfXiToXicPlus = kfXi;
429435
kfXiToXicPlus.SetProductionVertex(kfXicPlus);
430436
float chi2topoXiToXicPlus = kfXiToXicPlus.GetChi2() / kfXiToXicPlus.GetNDF();
@@ -532,7 +538,7 @@ struct HfCandidateCreatorXicToXiPiPi {
532538
//------------------------------fill candidate table rows--------------------------------------
533539
rowCandidateBase(collision.globalIndex(),
534540
KFPV.GetX(), KFPV.GetY(), KFPV.GetZ(),
535-
covMatrixPV[0], covMatrixPV[2], covMatrixPV[5],
541+
std::sqrt(covMatrixPV[0]), std::sqrt(covMatrixPV[2]), std::sqrt(covMatrixPV[5]),
536542
/*3-prong specific columns*/
537543
rowTrackIndexXicPlus.cascadeId(), rowTrackIndexXicPlus.prong0Id(), rowTrackIndexXicPlus.prong1Id(),
538544
casc.bachelorId(), casc.posTrackId(), casc.negTrackId(),
@@ -550,7 +556,8 @@ struct HfCandidateCreatorXicToXiPiPi {
550556
casc.xlambda(), casc.ylambda(), casc.zlambda(),
551557
cpaXi, cpaXYXi, cpaLambda, cpaXYLambda,
552558
massXiPi0, massXiPi1);
553-
rowCandidateKF(casc.kfCascadeChi2(), casc.kfV0Chi2(), chi2topoXicPlusPV, chi2topoXiToXicPlus,
559+
rowCandidateKF(casc.kfCascadeChi2(), casc.kfV0Chi2(),
560+
chi2topoXicPlusToPVBeforeConstraint, chi2topoXicPlusToPV, chi2topoXiToXicPlusBeforeConstraint, chi2topoXiToXicPlus,
554561
dcaXYPi0Pi1, dcaXYPi0Xi, dcaXYPi1Xi,
555562
dcaPi0Pi1, dcaPi0Xi, dcaPi1Xi,
556563
casc.dcacascdaughters());

PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
/// \author Phil Lennart Stahlhut <phil.lennart.stahlhut@cern.ch>, Heidelberg University
1616
/// \author Carolina Reetz <c.reetz@cern.ch>, Heidelberg University
1717

18+
#include <vector>
19+
1820
#include "CommonConstants/PhysicsConstants.h"
1921
#include "Framework/AnalysisTask.h"
2022
#include "Framework/runDataProcessing.h"
@@ -76,8 +78,10 @@ DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //!
7678
DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate
7779
DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate
7880
DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane
79-
DECLARE_SOA_COLUMN(Chi2XicPlusTopoToPV, chi2XicPlusTopoToPV, float);
80-
DECLARE_SOA_COLUMN(Chi2XicPlusTopoXiToXicPlus, chi2XicPlusTopoXiToXicPlus, float);
81+
DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPVBeforeConstraint, chi2TopoXicPlusToPVBeforeConstraint, float);
82+
DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPV, chi2TopoXicPlusToPV, float);
83+
DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlusBeforeConstraint, chi2TopoXiToXicPlusBeforeConstraint, float);
84+
DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlus, chi2TopoXiToXicPlus, float);
8185
// properties of daughter tracks
8286
DECLARE_SOA_COLUMN(PtXi, ptXi, float); //! Transverse momentum of Xi (prong0) (GeV/c)
8387
DECLARE_SOA_COLUMN(ImpactParameterXi, impactParameterXi, float); //! Impact parameter of Xi (prong0)
@@ -191,8 +195,10 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF",
191195
// KF specific columns
192196
full::Chi2XiVtx,
193197
full::Chi2LamVtx,
194-
full::Chi2XicPlusTopoToPV,
195-
full::Chi2XicPlusTopoXiToXicPlus,
198+
full::Chi2TopoXicPlusToPVBeforeConstraint,
199+
full::Chi2TopoXicPlusToPV,
200+
full::Chi2TopoXiToXicPlusBeforeConstraint,
201+
full::Chi2TopoXiToXicPlus,
196202
full::DcaXYPi0Pi1,
197203
full::DcaXYPi0Xi,
198204
full::DcaXYPi1Xi,
@@ -313,8 +319,10 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF",
313319
// KF-specific columns
314320
full::Chi2XiVtx,
315321
full::Chi2LamVtx,
316-
full::Chi2XicPlusTopoToPV,
317-
full::Chi2XicPlusTopoXiToXicPlus,
322+
full::Chi2TopoXicPlusToPVBeforeConstraint,
323+
full::Chi2TopoXicPlusToPV,
324+
full::Chi2TopoXiToXicPlusBeforeConstraint,
325+
full::Chi2TopoXiToXicPlus,
318326
full::DcaXYPi0Pi1,
319327
full::DcaXYPi0Xi,
320328
full::DcaXYPi1Xi,
@@ -525,7 +533,9 @@ struct HfTreeCreatorXicToXiPiPi {
525533
// KF-specific columns
526534
candidate.kfCascadeChi2(),
527535
candidate.kfV0Chi2(),
536+
candidate.chi2TopoXicPlusToPVBeforeConstraint(),
528537
candidate.chi2TopoXicPlusToPV(),
538+
candidate.chi2TopoXiToXicPlusBeforeConstraint(),
529539
candidate.chi2TopoXiToXicPlus(),
530540
candidate.dcaXYPi0Pi1(),
531541
candidate.dcaXYPi0Xi(),
@@ -592,7 +602,9 @@ struct HfTreeCreatorXicToXiPiPi {
592602
// KF-specific columns
593603
candidate.kfCascadeChi2(),
594604
candidate.kfV0Chi2(),
605+
candidate.chi2TopoXicPlusToPVBeforeConstraint(),
595606
candidate.chi2TopoXicPlusToPV(),
607+
candidate.chi2TopoXiToXicPlusBeforeConstraint(),
596608
candidate.chi2TopoXiToXicPlus(),
597609
candidate.dcaXYPi0Pi1(),
598610
candidate.dcaXYPi0Xi(),
@@ -615,7 +627,7 @@ struct HfTreeCreatorXicToXiPiPi {
615627
}
616628
for (const auto& candidate : candidates) {
617629
if (fillOnlyBackground && downSampleBkgFactor < 1.) {
618-
float pseudoRndm = candidate.ptProng1() * 1000. - (int64_t)(candidate.ptProng1() * 1000);
630+
float pseudoRndm = candidate.ptProng1() * 1000. - static_cast<int64_t>(candidate.ptProng1() * 1000);
619631
if (pseudoRndm >= downSampleBkgFactor && candidate.pt() < ptMaxForDownSample) {
620632
continue;
621633
}
@@ -635,7 +647,7 @@ struct HfTreeCreatorXicToXiPiPi {
635647
}
636648
for (const auto& candidate : candidates) {
637649
if (fillOnlyBackground && downSampleBkgFactor < 1.) {
638-
float pseudoRndm = candidate.ptProng1() * 1000. - (int64_t)(candidate.ptProng1() * 1000);
650+
float pseudoRndm = candidate.ptProng1() * 1000. - static_cast<int64_t>(candidate.ptProng1() * 1000);
639651
if (pseudoRndm >= downSampleBkgFactor && candidate.pt() < ptMaxForDownSample) {
640652
continue;
641653
}
@@ -667,7 +679,7 @@ struct HfTreeCreatorXicToXiPiPi {
667679
rowCandidateFull.reserve(recBg.size());
668680
}
669681
for (const auto& candidate : recBg) {
670-
float pseudoRndm = candidate.ptProng1() * 1000. - (int64_t)(candidate.ptProng1() * 1000);
682+
float pseudoRndm = candidate.ptProng1() * 1000. - static_cast<int64_t>(candidate.ptProng1() * 1000);
671683
if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) {
672684
continue;
673685
}
@@ -733,7 +745,7 @@ struct HfTreeCreatorXicToXiPiPi {
733745
rowCandidateFull.reserve(recBgKf.size());
734746
}
735747
for (const auto& candidate : recBgKf) {
736-
float pseudoRndm = candidate.ptProng1() * 1000. - (int64_t)(candidate.ptProng1() * 1000);
748+
float pseudoRndm = candidate.ptProng1() * 1000. - static_cast<int64_t>(candidate.ptProng1() * 1000);
737749
if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) {
738750
continue;
739751
}

0 commit comments

Comments
 (0)