From 1222dc8eadc59d4d18e8bf96c3c59beb1f057f43 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Fri, 13 Oct 2023 15:32:30 +0200 Subject: [PATCH] alsdjlk Signed-off-by: Felix Schlepper --- .../DetectorsVertexing/SVertexerParams.h | 2 +- Detectors/Vertexing/src/SVertexer.cxx | 55 +++++++++++++------ 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h b/Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h index 737fb5fcb9ea1..422296afe4745 100644 --- a/Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h +++ b/Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h @@ -28,7 +28,7 @@ namespace vertexing // These are configurable params for Primary Vertexer struct SVertexerParams : public o2::conf::ConfigurableParamHelper { - + bool ret = true; // parameters bool createFullV0s = false; ///< fill V0s prongs/kinematics bool createFullCascades = false; ///< fill cascades prongs/kinematics diff --git a/Detectors/Vertexing/src/SVertexer.cxx b/Detectors/Vertexing/src/SVertexer.cxx index a2b90b116460d..bb8c5e8d6e17e 100644 --- a/Detectors/Vertexing/src/SVertexer.cxx +++ b/Detectors/Vertexing/src/SVertexer.cxx @@ -683,26 +683,34 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP, fitterV0.unsetDebug(); } mCounterV0.inc(CHECKV0::FPROCESS, {}, pVtx, pVtxLbl, {}, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, check, true, fitterV0.isPropagationFailure(), fitterV0.getNIterations()); - return false; + if (mSVParams->ret) { + return false; + } } const auto& v0XYZ = fitterV0.getPCACandidate(); // validate V0 radial position // check closeness to the beam-line float dxv0 = v0XYZ[0] - mMeanVertex.getX(), dyv0 = v0XYZ[1] - mMeanVertex.getY(), r2v0 = dxv0 * dxv0 + dyv0 * dyv0; if (r2v0 < mMinR2ToMeanVertex) { - mCounterV0.inc(CHECKV0::MINR2TOMEANVERTEX, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + mCounterV0.inc(CHECKV0::MINR2TOMEANVERTEX, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure()); + if (mSVParams->ret) { + return false; + } } float rv0 = std::sqrt(r2v0), drv0P = rv0 - seedP.minR, drv0N = rv0 - seedN.minR; if (drv0P > mSVParams->causalityRTolerance || drv0P < -mSVParams->maxV0ToProngsRDiff || drv0N > mSVParams->causalityRTolerance || drv0N < -mSVParams->maxV0ToProngsRDiff) { - mCounterV0.inc(CHECKV0::REJCAUSALITY, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + mCounterV0.inc(CHECKV0::REJCAUSALITY, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure()); + if (mSVParams->ret) { + return false; + } } const int cand = 0; if (!fitterV0.isPropagateTracksToVertexDone(cand) && !fitterV0.propagateTracksToVertex(cand)) { - mCounterV0.inc(CHECKV0::PROPVTX, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + mCounterV0.inc(CHECKV0::PROPVTX, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure()); + if (mSVParams->ret) { + return false; + } } auto& trPProp = fitterV0.getTrack(0, cand); auto& trNProp = fitterV0.getTrack(1, cand); @@ -717,13 +725,17 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP, float pt2V0 = pV0[0] * pV0[0] + pV0[1] * pV0[1], prodXYv0 = dxv0 * pV0[0] + dyv0 * pV0[1], tDCAXY = prodXYv0 / pt2V0; if (pt2V0 < mMinPt2V0) { // pt cut LOG(debug) << "RejPt2 " << pt2V0; - mCounterV0.inc(CHECKV0::REJPT2, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + mCounterV0.inc(CHECKV0::REJPT2, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure()); + if (mSVParams->ret) { + return false; + } } if (pV0[2] * pV0[2] / pt2V0 > mMaxTgl2V0) { // tgLambda cut LOG(debug) << "RejTgL " << pV0[2] * pV0[2] / pt2V0; - mCounterV0.inc(CHECKV0::REJTGL, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + mCounterV0.inc(CHECKV0::REJTGL, {}, pVtx, pVtxLbl, v0XYZ, seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure()); + if (mSVParams->ret) { + return false; + } } float p2V0 = pt2V0 + pV0[2] * pV0[2], ptV0 = std::sqrt(pt2V0); // apply mass selections @@ -759,8 +771,10 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP, if (!goodHyp && mSVParams->checkV0Hypothesis) { LOG(debug) << "RejHypo"; if (!checkFor3BodyDecays && !checkForCascade) { - mCounterV0.inc(CHECKV0::V0HYP, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + mCounterV0.inc(CHECKV0::V0HYP, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure()); + if (mSVParams->ret) { + return false; + } } else { rejectAfter3BodyCheck = true; } @@ -774,7 +788,9 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP, LOG(debug) << "Rej for cascade DCAXY2: " << dca2 << " << cosPAXY: " << cosPAXY; if (!checkFor3BodyDecays) { mCounterV0.inc(CHECKV0::REJAFTER3BODYCHECK, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); - return false; + if (mSVParams->ret) { + return false; + } } else { rejectAfter3BodyCheck = true; } @@ -796,11 +812,14 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP, } else if (checkFor3BodyDecays) { rejectAfter3BodyCheck = true; } else { - mCounterV0.inc(CHECKV0::COSPAXY, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure(), -1, cosPAXY, dca2); - return false; + mCounterV0.inc(CHECKV0::COSPAXY, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure(), -1, cosPAXY, dca2); + if (mSVParams->ret) { + return false; + } } } - mCounterV0.inc(CHECKV0::ACOSPAXY, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure(), -1, cosPAXY, dca2); + LOG_IF(info, check) << "[------] V0: dca2(=" << dca2 << ") > mMaxDCAXY2ToMeanVertex(=" << mMaxDCAXY2ToMeanVertex << "); cosPAXY(=" << cosPAXY << ") < minCosPAXYMeanVertex(=" << mSVParams->minCosPAXYMeanVertex << ")"; + mCounterV0.inc(CHECKV0::ACOSPAXY, {}, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, check, fitterV0.isPropagationFailure(), -1, cosPAXY, dca2); auto vlist = seedP.vBracket.getOverlap(seedN.vBracket); // indices of vertices shared by both seeds bool candFound = false; @@ -824,7 +843,7 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP, new (&v0new) V0(v0XYZ, pV0, fitterV0.calcPCACovMatrixFlat(cand), trPProp, trNProp); new (&v0Idxnew) V0Index(-1, seedP.gid, seedN.gid); v0new.setDCA(fitterV0.getChi2AtPCACandidate(cand)); - mCounterV0.inc(CHECKV0::NEWV0, pv, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure()); + mCounterV0.inc(CHECKV0::NEWV0, pv, pVtx, pVtxLbl, fitterV0.getPCACandidate(cand), seedP, seedN, lbl0, lbl1, ok, mD0V0Map, mD1V0Map, mcReader, mDebugStream, true, false, fitterV0.isPropagationFailure(), fitterV0.getNIterations(), cosPA, dca2); candFound = true; } v0new.setCosPA(cosPA);