Skip to content

Commit 2332bfe

Browse files
committed
Extra tolerances for P/S-vertexing
1 parent 4f1b642 commit 2332bfe

6 files changed

Lines changed: 32 additions & 10 deletions

File tree

Detectors/Vertexing/include/DetectorsVertexing/PVertexerParams.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct PVertexerParams : public o2::conf::ConfigurableParamHelper<PVertexerParam
7070
int minNContributorsForIRcut = 4; ///< do not apply IR cut to vertices below IR tagging efficiency threshold
7171
float maxTError = 0.2; ///< use min of vertex time error or this for nsigma evaluation
7272
float minTError = 0.003; ///< don't use error smaller than that (~BC/2/minNContributorsForFT0cut)
73-
float nSigmaTimeCut = 4.; ///< eliminate vertex if there is no FT0 signal within this cut
73+
float nSigmaTimeCut = 4.; ///< eliminate vertex if there is no FT0 or BC signal within this cut
7474
float timeBiasMS = 0; ///< relative bias in ms to add to TPCITS-based time stamp
7575
//
7676
// stopping condition params
@@ -81,6 +81,11 @@ struct PVertexerParams : public o2::conf::ConfigurableParamHelper<PVertexerParam
8181
int maxNScaleSlowConvergence = 3; ///< max number of weak scaling decrease iterations
8282
bool useTimeInChi2 = true; ///< use track-vertex time difference in chi2 calculation
8383

84+
// track vertex time-wise association
85+
float nSigmaTimeTrack = 4.; ///< define track time bracker as +- this number of sigmas of its time resolution
86+
float timeMarginTrackTime = 0.5; ///< additive marginal error in \mus to track time bracket
87+
float timeMarginVertexTime = 0.0; ///< additive marginal error to \mus vertex time bracket
88+
8489
O2ParamDef(PVertexerParams, "pvertexer");
8590
};
8691

Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ struct SVertexerParams : public o2::conf::ConfigurableParamHelper<SVertexerParam
6363
float maxTglCasc = 2.; // maximum tgLambda of cascade
6464

6565
// cuts on different V0 PID params
66+
bool checkV0Hypothesis = true;
6667
float pidCutsPhoton[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.60, 0.0}; // Photon
6768
float pidCutsK0[SVertexHypothesis::NPIDParams] = {0.003, 20, 0.07, 0.5}; // K0
6869
float pidCutsLambda[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.07, 0.5}; // Lambda
6970
float pidCutsHTriton[SVertexHypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // HyperTriton
7071
//
7172
// cuts on different Cascade PID params
73+
bool checkCascadeHypothesis = true;
7274
float pidCutsXiMinus[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.07, 0.5}; // XiMinus
7375
float pidCutsOmegaMinus[SVertexHypothesis::NPIDParams] = {0.001, 20, 0.07, 0.5}; // OmegaMinus
7476

Detectors/Vertexing/include/DetectorsVertexing/VertexTrackMatcher.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class VertexTrackMatcher
5959
private:
6060
void updateTimeDependentParams();
6161
void extractTracks(const o2::globaltracking::RecoContainer& data, const std::unordered_map<GIndex, bool>& vcont);
62-
6362
std::vector<TrackTBracket> mTBrackets;
6463
float mITSROFrameLengthMUS = 0; ///< ITS RO frame in mus
6564
float mMFTROFrameLengthMUS = 0; ///< MFT RO frame in mus

Detectors/Vertexing/src/PVertexer.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ bool PVertexer::setCompatibleIR(PVertex& vtx)
765765
// assign compatible IRs accounting for the bunch filling scheme
766766
const auto& vtxT = vtx.getTimeStamp();
767767
o2::InteractionRecord irMin(mStartIR), irMax(mStartIR);
768-
auto rangeT = mPVParams->nSigmaTimeCut * std::max(mPVParams->minTError, std::min(mPVParams->maxTError, vtxT.getTimeStampError()));
768+
auto rangeT = std::max(mPVParams->minTError, mPVParams->nSigmaTimeCut * std::min(mPVParams->maxTError, vtxT.getTimeStampError())) + mPVParams->timeMarginVertexTime;
769769
float t = vtxT.getTimeStamp() + mPVParams->timeBiasMS;
770770
if (t > rangeT) {
771771
irMin += o2::InteractionRecord(1.e3 * (t - rangeT));
@@ -777,11 +777,13 @@ bool PVertexer::setCompatibleIR(PVertex& vtx)
777777
irMax++; // to account for rounding
778778
// restrict using bunch filling
779779
int bc = mClosestBunchAbove[irMin.bc];
780+
LOG(DEBUG) << "irMin.bc = " << irMin.bc << " bcAbove = " << bc;
780781
if (bc < irMin.bc) {
781782
irMin.orbit++;
782783
}
783784
irMin.bc = bc;
784785
bc = mClosestBunchBelow[irMax.bc];
786+
LOG(DEBUG) << "irMax.bc = " << irMax.bc << " bcBelow = " << bc;
785787
if (bc > irMax.bc) {
786788
if (irMax.orbit == 0) {
787789
return false;
@@ -791,6 +793,9 @@ bool PVertexer::setCompatibleIR(PVertex& vtx)
791793
irMax.bc = bc;
792794
vtx.setIRMin(irMin);
793795
vtx.setIRMax(irMax);
796+
if (irMin > irMax) {
797+
LOG(DEBUG) << "Reject VTX " << vtx.asString() << " trange = " << rangeT;
798+
}
794799
return irMax >= irMin;
795800
}
796801

Detectors/Vertexing/src/SVertexer.cxx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ void SVertexer::process(const o2::globaltracking::RecoContainer& recoData) // ac
4949
auto& seedP = mTracksPool[POS][itp];
5050
int firstN = mVtxFirstTrack[NEG][seedP.vBracket.getMin()];
5151
if (firstN < 0) {
52+
LOG(DEBUG) << "No partner is found for pos.track " << itp << " out of " << ntrP;
5253
continue;
5354
}
5455
for (int itn = firstN; itn < ntrN; itn++) { // start from the 1st negative track of lowest-ID vertex of positive
5556
auto& seedN = mTracksPool[NEG][itn];
5657
if (seedN.vBracket > seedP.vBracket) { // all vertices compatible with seedN are in future wrt that of seedP
58+
LOG(DEBUG) << "Brackets do not match";
5759
break;
5860
}
5961
#ifdef WITH_OPENMP
@@ -231,6 +233,7 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
231233
float rv0 = std::sqrt(r2v0), drv0P = rv0 - seedP.minR, drv0N = rv0 - seedN.minR;
232234
if (drv0P > mSVParams->causalityRTolerance || drv0P < -mSVParams->maxV0ToProngsRDiff ||
233235
drv0N > mSVParams->causalityRTolerance || drv0N < -mSVParams->maxV0ToProngsRDiff) {
236+
LOG(DEBUG) << "RejCausality " << drv0P << " " << drv0N;
234237
return false;
235238
}
236239

@@ -250,9 +253,11 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
250253
std::array<float, 3> pV0 = {pP[0] + pN[0], pP[1] + pN[1], pP[2] + pN[2]};
251254
float pt2V0 = pV0[0] * pV0[0] + pV0[1] * pV0[1], prodXYv0 = dxv0 * pV0[0] + dyv0 * pV0[1], tDCAXY = prodXYv0 / pt2V0;
252255
if (pt2V0 < mMinPt2V0) { // pt cut
256+
LOG(DEBUG) << "RejPt2 " << pt2V0;
253257
return false;
254258
}
255259
if (pV0[2] * pV0[2] / pt2V0 > mMaxTgl2V0) { // tgLambda cut
260+
LOG(DEBUG) << "RejTgL " << pV0[2] * pV0[2] / pt2V0;
256261
return false;
257262
}
258263
float p2V0 = pt2V0 + pV0[2] * pV0[2], ptV0 = std::sqrt(pt2V0);
@@ -266,17 +271,19 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
266271
goodHyp = hypCheckStatus[ipid] = true;
267272
}
268273
}
269-
if (!goodHyp) {
274+
if (!goodHyp && mSVParams->checkV0Hypothesis) {
275+
LOG(DEBUG) << "RejHypo";
270276
return false;
271277
}
272278

273-
bool checkForCascade = mEnableCascades && r2v0 < mMaxR2ToMeanVertexCascV0 && (hypCheckStatus[HypV0::Lambda] || hypCheckStatus[HypV0::AntiLambda]);
279+
bool checkForCascade = mEnableCascades && r2v0 < mMaxR2ToMeanVertexCascV0 && (!mSVParams->checkV0Hypothesis || (hypCheckStatus[HypV0::Lambda] || hypCheckStatus[HypV0::AntiLambda]));
274280
bool rejectIfNotCascade = false;
275281
float dcaX = dxv0 - pV0[0] * tDCAXY, dcaY = dyv0 - pV0[1] * tDCAXY, dca2 = dcaX * dcaX + dcaY * dcaY;
276282
float cosPAXY = prodXYv0 / std::sqrt(r2v0 * pt2V0);
277283

278284
if (checkForCascade) { // use loser cuts for cascade v0 candidates
279285
if (dca2 > mMaxDCAXY2ToMeanVertexV0Casc || cosPAXY < mSVParams->minCosPAXYMeanVertexCascV0) {
286+
LOG(DEBUG) << "Rej for cascade DCAXY2: " << dca2 << " << cosPAXY: " << cosPAXY;
280287
return false;
281288
}
282289
}
@@ -298,6 +305,7 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
298305
float dx = v0XYZ[0] - pv.getX(), dy = v0XYZ[1] - pv.getY(), dz = v0XYZ[2] - pv.getZ(), prodXYZv0 = dx * pV0[0] + dy * pV0[1] + dz * pV0[2];
299306
float cosPA = prodXYZv0 / std::sqrt((dx * dx + dy * dy + dz * dz) * p2V0);
300307
if (cosPA < bestCosPA) {
308+
LOG(DEBUG) << "Rej. cosPA: " << cosPA;
301309
continue;
302310
}
303311
if (!added) {
@@ -318,10 +326,10 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
318326
// check cascades
319327
if (checkForCascade) {
320328
int nCascAdded = 0;
321-
if (hypCheckStatus[HypV0::Lambda]) {
329+
if (hypCheckStatus[HypV0::Lambda] || !mSVParams->checkCascadeHypothesis) {
322330
nCascAdded += checkCascades(rv0, pV0, p2V0, iN, NEG, ithread);
323331
}
324-
if (hypCheckStatus[HypV0::AntiLambda]) {
332+
if (hypCheckStatus[HypV0::AntiLambda] || !mSVParams->checkCascadeHypothesis) {
325333
nCascAdded += checkCascades(rv0, pV0, p2V0, iP, POS, ithread);
326334
}
327335
if (!nCascAdded && rejectIfNotCascade) { // v0 would be accepted only if it creates a cascade

Detectors/Vertexing/src/VertexTrackMatcher.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ void VertexTrackMatcher::process(const o2::globaltracking::RecoContainer& recoDa
8686
}
8787
const auto& vtx = vertices[iv];
8888
const auto& vto = vtxOrdBrack.emplace_back(VtxTBracket{
89-
{float((vtx.getIRMin().differenceInBC(recoData.startIR) - 0.5f) * o2::constants::lhc::LHCBunchSpacingMUS),
90-
float((vtx.getIRMax().differenceInBC(recoData.startIR) + 0.5f) * o2::constants::lhc::LHCBunchSpacingMUS)},
89+
{float((vtx.getIRMin().differenceInBC(recoData.startIR) - 0.5f) * o2::constants::lhc::LHCBunchSpacingMUS - mPVParams->timeMarginVertexTime),
90+
float((vtx.getIRMax().differenceInBC(recoData.startIR) + 0.5f) * o2::constants::lhc::LHCBunchSpacingMUS + mPVParams->timeMarginVertexTime)},
9191
iv});
9292
if (vto.tBracket.delta() > maxVtxSpan) {
9393
maxVtxSpan = vto.tBracket.delta();
@@ -196,9 +196,12 @@ void VertexTrackMatcher::extractTracks(const o2::globaltracking::RecoContainer&
196196
terr *= this->mMFTROFrameLengthMUS;
197197
} else if constexpr (isGlobalFwdTrack<decltype(_tr)>()) {
198198
t0 = _tr.getTimeMUS().getTimeStamp();
199-
terr = _tr.getTimeMUS().getTimeStampError();
199+
terr = _tr.getTimeMUS().getTimeStampError() * mPVParams->nSigmaTimeTrack; // gaussian errors must be scaled by requested n-sigma
200+
} else {
201+
terr *= mPVParams->nSigmaTimeTrack; // gaussian errors must be scaled by requested n-sigma
200202
}
201203
// for all other tracks the time is in \mus with gaussian error
204+
terr += mPVParams->timeMarginTrackTime;
202205
mTBrackets.emplace_back(TrackTBracket{{t0 - terr, t0 + terr}, _origID});
203206
return true;
204207
};

0 commit comments

Comments
 (0)