Skip to content

Commit

Permalink
alsdjlk
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
  • Loading branch information
f3sch committed Oct 13, 2023
1 parent 2ec7d0c commit 1222dc8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace vertexing

// These are configurable params for Primary Vertexer
struct SVertexerParams : public o2::conf::ConfigurableParamHelper<SVertexerParams> {

bool ret = true;
// parameters
bool createFullV0s = false; ///< fill V0s prongs/kinematics
bool createFullCascades = false; ///< fill cascades prongs/kinematics
Expand Down
55 changes: 37 additions & 18 deletions Detectors/Vertexing/src/SVertexer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 1222dc8

Please sign in to comment.