Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,31 @@ class DecayNBodyIndex
void setProngID(int i, GIndex gid) { mProngIDs[i] = gid; }
int getVertexID() const { return mVertexID; }
void setVertexID(int id) { mVertexID = id; }
uint8_t getBits() const { return mBits; }
bool testBit(int i) const { return (mBits & (0x1 << i)) != 0; }
void setBit(int i) { mBits |= (0x1 << i); }
void resetBit(int i) { mBits &= ~(0x1 << i); }

const std::array<GIndex, N>& getProngs() const { return mProngIDs; }
static constexpr int getNProngs() { return N; }

protected:
int mVertexID = -1; // id of parent vertex
std::array<GIndex, N> mProngIDs{}; // global IDs of prongs
ClassDefNV(DecayNBodyIndex, 1);
uint8_t mBits = 0; // user defined bits

ClassDefNV(DecayNBodyIndex, 2);
};

class V0Index : public DecayNBodyIndex<2>
{
public:
using DecayNBodyIndex<2>::DecayNBodyIndex;
V0Index(int v, GIndex p, GIndex n) : DecayNBodyIndex<2>(v, {p, n}) {}
bool isStandaloneV0() const { return testBit(0); }
bool isPhotonOnly() const { return testBit(1); }
void setStandaloneV0() { setBit(0); }
void setPhotonOnly() { setBit(1); }
ClassDefNV(V0Index, 1);
};

Expand Down
11 changes: 9 additions & 2 deletions Detectors/Vertexing/src/SVertexer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,9 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
// apply mass selections
float p2Pos = pP[0] * pP[0] + pP[1] * pP[1] + pP[2] * pP[2], p2Neg = pN[0] * pN[0] + pN[1] * pN[1] + pN[2] * pN[2];

bool goodHyp = false;
bool goodHyp = false, photonOnly = mSVParams->mTPCTrackPhotonTune && isTPConly;
std::array<bool, NHypV0> hypCheckStatus{};
int nPID = (mSVParams->mTPCTrackPhotonTune && isTPConly) ? (Photon + 1) : NHypV0;
int nPID = photonOnly ? (Photon + 1) : NHypV0;
for (int ipid = 0; (ipid < nPID) && mSVParams->checkV0Hypothesis; ipid++) {
if (mV0Hyps[ipid].check(p2Pos, p2Neg, p2V0, ptV0)) {
goodHyp = hypCheckStatus[ipid] = true;
Expand Down Expand Up @@ -855,6 +855,13 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,

if (nV0Used || !rejectIfNotCascade) { // need to add this v0
mV0sIdxTmp[ithread].push_back(v0Idxnew);
if (!rejectIfNotCascade) {
mV0sIdxTmp[ithread].back().setStandaloneV0();
}
if (photonOnly) {
mV0sIdxTmp[ithread].back().setPhotonOnly();
}

if (mSVParams->createFullV0s) {
mV0sTmp[ithread].push_back(v0new);
}
Expand Down