Skip to content

Commit 6e5594f

Browse files
ddobrigkalibuild
authored andcommitted
svertexer: adaptive mass windows (#12136)
* svertexer: adaptive mass windows * One more step: Lucia's changes * Tighter windows when doing decay chains * Please consider the following formatting changes * Latest bugfixes * Please consider the following formatting changes --------- Co-authored-by: David Dobrigkeit Chinellato <david.dobrigkeit.chinellato.cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent bfc5cfb commit 6e5594f

File tree

4 files changed

+77
-26
lines changed

4 files changed

+77
-26
lines changed

Detectors/Vertexing/include/DetectorsVertexing/SVertexHypothesis.h

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,20 @@ class SVertexHypothesis
3030

3131
public:
3232
using PID = o2::track::PID;
33-
enum PIDParams { SigmaM, // sigma of mass res at 0 pt
34-
NSigmaM, // number of sigmas of mass res
35-
MarginM, // additive safety margin in mass cut
36-
CPt }; // pT dependence of mass resolution parameterized as mSigma*(1+mC1*pt);
33+
enum PIDParams { SigmaM, // sigma of mass res at 0 pt
34+
NSigmaM, // number of sigmas of mass res
35+
MarginM, // additive safety margin in mass cut
36+
NSigmaTightM, // number of sigmas of mass res when doing tight cut around mass (V0s used in cascades)
37+
MarginTightM, // additive safety margin in mass cut when doing tight cut around mass (V0s used in cascades)
38+
CPt, // pT dependence of mass resolution parameterized as mSigma*(1+mC1*pt);
39+
CPt1,
40+
CPt2,
41+
CPt3 }; // pT dependence of mass resolution of Cascade parameterized as CPt+CPt1*pt +CPt2*TMath::Exp(-CPt3*pt);
3742

38-
static constexpr int NPIDParams = 4;
43+
static constexpr int NPIDParams = 9;
3944

40-
void set(PID v0, PID ppos, PID pneg, float sig, float nSig, float margin, float cpt, float bz = 0.f);
41-
void set(PID v0, PID ppos, PID pneg, const float pars[NPIDParams], float bz = 0.f);
45+
void set(PID v0, PID ppos, PID pneg, float sig, float nSig, float margin, float nSigTight, float marginTight, float cpt, float cpt1, float cpt2, float cpt3, float bz = 0.f, float maxSigma = 0.01);
46+
void set(PID v0, PID ppos, PID pneg, const float pars[NPIDParams], float bz = 0.f, float maxSigma = 0.01);
4247

4348
float getMassV0Hyp() const { return PID::getMass(mPIDV0); }
4449
float getMassPosProng() const { return PID::getMass(mPIDPosProng); }
@@ -57,14 +62,44 @@ class SVertexHypothesis
5762
{ // check if given mass and pt is matching to hypothesis
5863
return check(calcMass(p2Pos, p2Neg, p2V0), ptV0);
5964
}
60-
6165
bool check(float mass, float pt) const
6266
{ // check if given mass and pt is matching to hypothesis
6367
return std::abs(mass - getMassV0Hyp()) < getMargin(pt);
6468
}
6569

70+
bool checkTight(float p2Pos, float p2Neg, float p2V0, float ptV0) const
71+
{ // check if given mass and pt is matching to hypothesis
72+
return checkTight(calcMass(p2Pos, p2Neg, p2V0), ptV0);
73+
}
74+
bool checkTight(float mass, float pt) const
75+
{ // check if given mass and pt is matching to hypothesis
76+
return std::abs(mass - getMassV0Hyp()) < getMarginTight(pt);
77+
}
78+
79+
float getSigmaV0Cascade(float pt) const { return mPars[CPt] + mPars[CPt1] * pt + mPars[CPt2] * std::exp(-mPars[CPt3] * pt); }
6680
float getSigma(float pt) const { return mPars[SigmaM] * (1.f + mPars[CPt] * pt); }
67-
float getMargin(float pt) const { return mPars[NSigmaM] * getSigma(pt) + mPars[MarginM]; }
81+
float getMargin(float pt, bool tight = false) const
82+
{
83+
int idxNsigma = NSigmaM;
84+
int idxMargin = MarginM;
85+
if (tight) { // move to indices for tight variables in case asked to do so (tighter peak cuts for decay chains)
86+
idxNsigma = NSigmaTightM;
87+
idxMargin = MarginTightM;
88+
}
89+
if (mPIDV0 == PID::XiMinus || mPIDV0 == PID::OmegaMinus) { // case for cascades, antiparticles included
90+
float sigmaV0Cascade = getSigmaV0Cascade(pt);
91+
if (sigmaV0Cascade > maxSigma) { // insuring that at low pt one gets reasonable width as the parametrisation function may explode to unphysical values
92+
return mPars[idxNsigma] * maxSigma + mPars[idxMargin];
93+
} else {
94+
return mPars[idxNsigma] * sigmaV0Cascade + mPars[idxMargin];
95+
}
96+
} else if (mPIDV0 == PID::K0 || mPIDV0 == PID::Lambda) { // case for V0s, AntiLambda is included in PID::Lambda
97+
return mPars[idxNsigma] * getSigmaV0Cascade(pt) + mPars[idxMargin];
98+
} else {
99+
return mPars[idxNsigma] * getSigma(pt) + mPars[idxMargin]; // case for HyperTriton and Hyperhydrog4
100+
}
101+
}
102+
float getMarginTight(float pt) const { return getMargin(pt, true); }
68103

69104
private:
70105
float getMass2PosProng() const { return PID::getMass2(mPIDPosProng); }
@@ -76,8 +111,9 @@ class SVertexHypothesis
76111

77112
public: // to be deleted
78113
std::array<float, NPIDParams> mPars{};
114+
float maxSigma;
79115

80-
ClassDefNV(SVertexHypothesis, 1);
116+
ClassDefNV(SVertexHypothesis, 2);
81117
};
82118

83119
class SVertex3Hypothesis

Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,17 @@ struct SVertexerParams : public o2::conf::ConfigurableParamHelper<SVertexerParam
9696

9797
// cuts on different V0 PID params
9898
bool checkV0Hypothesis = true;
99-
float pidCutsPhoton[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.60, 0.0}; // Photon
100-
float pidCutsK0[SVertexHypothesis::NPIDParams] = {0.003, 20, 0.07, 0.5}; // K0
101-
float pidCutsLambda[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.07, 0.5}; // Lambda
102-
float pidCutsHTriton[SVertexHypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // HyperTriton
103-
float pidCutsHhydrog4[SVertexHypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // Hyperhydrog4 - Need to update
99+
float pidCutsPhoton[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.60, 20, 0.60, 0.0, 0.0, 0.0, 0.0}; // Photon
100+
float pidCutsK0[SVertexHypothesis::NPIDParams] = {0., 20, 0., 5.0, 0.0, 2.84798e-03, 9.84206e-04, 3.31951e-03, 2.39438}; // K0
101+
float pidCutsLambda[SVertexHypothesis::NPIDParams] = {0., 20, 0., 5.0, 0.0, 1.09004e-03, 2.62291e-04, 8.93179e-03, 2.83121}; // Lambda
102+
float pidCutsHTriton[SVertexHypothesis::NPIDParams] = {0.0025, 14, 0.07, 14, 0.0, 0.5, 0.0, 0.0, 0.0}; // HyperTriton
103+
float pidCutsHhydrog4[SVertexHypothesis::NPIDParams] = {0.0025, 14, 0.07, 14, 0.0, 0.5, 0.0, 0.0, 0.0}; // Hyperhydrog4 - Need to update
104104
//
105105
// cuts on different Cascade PID params
106106
bool checkCascadeHypothesis = true;
107-
float pidCutsXiMinus[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.07, 0.5}; // XiMinus
108-
float pidCutsOmegaMinus[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.07, 0.5}; // OmegaMinus
107+
float pidCutsXiMinus[SVertexHypothesis::NPIDParams] = {0.0, 10, 0.0, 4.0, 0.0, 1.56315e-03, 2.23279e-04, 2.75136e-02, 3.309}; // XiMinus
108+
float pidCutsOmegaMinus[SVertexHypothesis::NPIDParams] = {0.0, 10, 0.0, 4.0, 0.0, 1.43572e-03, 6.94416e-04, 2.13534e+05, 1.48889e+01}; // OmegaMinus
109+
float maximalCascadeWidth = 0.006;
109110
//
110111
// cuts on different 3 body PID params
111112
bool check3bodyHypothesis = true;

Detectors/Vertexing/src/SVertexHypothesis.cxx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,29 @@
1717

1818
using namespace o2::vertexing;
1919

20-
void SVertexHypothesis::set(PID v0, PID ppos, PID pneg, float sig, float nSig, float margin, float cpt, float bz)
20+
void SVertexHypothesis::set(PID v0, PID ppos, PID pneg, float sig, float nSig, float margin, float nSigTight, float marginTight, float cpt, float cpt1, float cpt2, float cpt3, float bz, float maxSigmaInput)
2121
{
2222
mPIDV0 = v0;
2323
mPIDPosProng = ppos;
2424
mPIDNegProng = pneg;
2525
mPars[SigmaM] = sig;
2626
mPars[NSigmaM] = nSig;
2727
mPars[MarginM] = margin;
28+
mPars[NSigmaTightM] = nSigTight;
29+
mPars[MarginTightM] = marginTight;
30+
mPars[CPt] = cpt;
31+
mPars[CPt1] = cpt1;
32+
mPars[CPt2] = cpt2;
33+
mPars[CPt3] = cpt3;
34+
maxSigma = maxSigmaInput;
2835
float absBz{std::abs(bz)};
29-
mPars[CPt] = absBz > 1e-3 ? cpt * 5.0066791 / absBz : 0.; // assume that pT dependent sigma is linear with B
36+
if (cpt3 < 1)
37+
mPars[CPt] = absBz > 1e-3 ? cpt * 5.0066791 / absBz : 0.; // assume that pT dependent sigma is linear with B; case for HyperTriton and Hyperhydrog4
3038
}
3139

32-
void SVertexHypothesis::set(PID v0, PID ppos, PID pneg, const float pars[NPIDParams], float bz)
40+
void SVertexHypothesis::set(PID v0, PID ppos, PID pneg, const float pars[NPIDParams], float bz, float maxSigmaInput)
3341
{
34-
set(v0, ppos, pneg, pars[SigmaM], pars[NSigmaM], pars[MarginM], pars[CPt], bz);
42+
set(v0, ppos, pneg, pars[SigmaM], pars[NSigmaM], pars[MarginM], pars[NSigmaTightM], pars[MarginTightM], pars[CPt], pars[CPt1], pars[CPt2], pars[CPt3], bz, maxSigmaInput);
3543
}
3644

3745
void SVertex3Hypothesis::set(PID v0, PID ppos, PID pneg, PID pbach, float sig, float nSig, float margin, float cpt, float bz)

Detectors/Vertexing/src/SVertexer.cxx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ void SVertexer::updateTimeDependentParams()
283283
mV0Hyps[HypV0::AntiHyperTriton].set(PID::HyperTriton, PID::Pion, PID::Helium3, mSVParams->pidCutsHTriton, bz);
284284
mV0Hyps[HypV0::Hyperhydrog4].set(PID::Hyperhydrog4, PID::Alpha, PID::Pion, mSVParams->pidCutsHhydrog4, bz);
285285
mV0Hyps[HypV0::AntiHyperhydrog4].set(PID::Hyperhydrog4, PID::Pion, PID::Alpha, mSVParams->pidCutsHhydrog4, bz);
286-
mCascHyps[HypCascade::XiMinus].set(PID::XiMinus, PID::Lambda, PID::Pion, mSVParams->pidCutsXiMinus, bz);
287-
mCascHyps[HypCascade::OmegaMinus].set(PID::OmegaMinus, PID::Lambda, PID::Kaon, mSVParams->pidCutsOmegaMinus, bz);
286+
mCascHyps[HypCascade::XiMinus].set(PID::XiMinus, PID::Lambda, PID::Pion, mSVParams->pidCutsXiMinus, bz, mSVParams->maximalCascadeWidth);
287+
mCascHyps[HypCascade::OmegaMinus].set(PID::OmegaMinus, PID::Lambda, PID::Kaon, mSVParams->pidCutsOmegaMinus, bz, mSVParams->maximalCascadeWidth);
288288

289289
m3bodyHyps[Hyp3body::H3L3body].set(PID::HyperTriton, PID::Proton, PID::Pion, PID::Deuteron, mSVParams->pidCutsH3L3body, bz);
290290
m3bodyHyps[Hyp3body::AntiH3L3body].set(PID::HyperTriton, PID::Pion, PID::Proton, PID::Deuteron, mSVParams->pidCutsH3L3body, bz);
@@ -567,6 +567,12 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
567567
goodHyp = hypCheckStatus[ipid] = true;
568568
}
569569
}
570+
// check tight lambda mass only
571+
bool goodLamForCascade = false, goodALamForCascade = false;
572+
if (mV0Hyps[Lambda].checkTight(p2Pos, p2Neg, p2V0, ptV0))
573+
goodLamForCascade = true;
574+
if (mV0Hyps[AntiLambda].checkTight(p2Pos, p2Neg, p2V0, ptV0))
575+
goodALamForCascade = true;
570576

571577
// apply mass selections for 3-body decay
572578
bool good3bodyV0Hyp = false;
@@ -581,7 +587,7 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
581587
// we want to reconstruct the 3 body decay of hypernuclei starting from the V0 of a proton and a pion (e.g. H3L->d + (p + pi-), or He4L->He3 + (p + pi-)))
582588
bool checkFor3BodyDecays = mEnable3BodyDecays && (!mSVParams->checkV0Hypothesis || good3bodyV0Hyp) && (pt2V0 > 0.5);
583589
bool rejectAfter3BodyCheck = false; // To reject v0s which can be 3-body decay candidates but not cascade or v0
584-
bool checkForCascade = mEnableCascades && r2v0 < mMaxR2ToMeanVertexCascV0 && (!mSVParams->checkV0Hypothesis || (hypCheckStatus[HypV0::Lambda] || hypCheckStatus[HypV0::AntiLambda]));
590+
bool checkForCascade = mEnableCascades && r2v0 < mMaxR2ToMeanVertexCascV0 && (!mSVParams->checkV0Hypothesis || (goodLamForCascade || goodALamForCascade));
585591
bool rejectIfNotCascade = false;
586592

587593
if (!goodHyp && mSVParams->checkV0Hypothesis) {
@@ -673,10 +679,10 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
673679
// check cascades
674680
int nCascIni = mCascadesIdxTmp[ithread].size(), nV0Used = 0; // number of times this particular v0 (with assigned PV) was used (not counting using its clones with other PV)
675681
if (checkForCascade) {
676-
if (hypCheckStatus[HypV0::Lambda] || !mSVParams->checkCascadeHypothesis) {
682+
if (goodLamForCascade || !mSVParams->checkCascadeHypothesis) {
677683
nV0Used += checkCascades(v0Idxnew, v0new, rv0, pV0, p2V0, iN, NEG, vlist, ithread);
678684
}
679-
if (hypCheckStatus[HypV0::AntiLambda] || !mSVParams->checkCascadeHypothesis) {
685+
if (goodALamForCascade || !mSVParams->checkCascadeHypothesis) {
680686
nV0Used += checkCascades(v0Idxnew, v0new, rv0, pV0, p2V0, iP, POS, vlist, ithread);
681687
}
682688
}

0 commit comments

Comments
 (0)