Skip to content

Commit 2fdcd65

Browse files
authored
Create and pass v0 flag to AOD (#12443)
* Flag standalone and photon V0s in the V0Index * Pass v0 flags to AOD * Set v0s_002 as default --------- Co-authored-by: shahoian <ruben.shahoyan@cern.ch>
1 parent b1a6359 commit 2fdcd65

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/DecayNBodyIndex.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,31 @@ class DecayNBodyIndex
3636
void setProngID(int i, GIndex gid) { mProngIDs[i] = gid; }
3737
int getVertexID() const { return mVertexID; }
3838
void setVertexID(int id) { mVertexID = id; }
39+
uint8_t getBits() const { return mBits; }
40+
bool testBit(int i) const { return (mBits & (0x1 << i)) != 0; }
41+
void setBit(int i) { mBits |= (0x1 << i); }
42+
void resetBit(int i) { mBits &= ~(0x1 << i); }
43+
3944
const std::array<GIndex, N>& getProngs() const { return mProngIDs; }
4045
static constexpr int getNProngs() { return N; }
4146

4247
protected:
4348
int mVertexID = -1; // id of parent vertex
4449
std::array<GIndex, N> mProngIDs{}; // global IDs of prongs
45-
ClassDefNV(DecayNBodyIndex, 1);
50+
uint8_t mBits = 0; // user defined bits
51+
52+
ClassDefNV(DecayNBodyIndex, 2);
4653
};
4754

4855
class V0Index : public DecayNBodyIndex<2>
4956
{
5057
public:
5158
using DecayNBodyIndex<2>::DecayNBodyIndex;
5259
V0Index(int v, GIndex p, GIndex n) : DecayNBodyIndex<2>(v, {p, n}) {}
60+
bool isStandaloneV0() const { return testBit(0); }
61+
bool isPhotonOnly() const { return testBit(1); }
62+
void setStandaloneV0() { setBit(0); }
63+
void setPhotonOnly() { setBit(1); }
5364
ClassDefNV(V0Index, 1);
5465
};
5566

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,7 @@ void AODProducerWorkflowDPL::fillSecondaryVertices(const o2::globaltracking::Rec
11991199
const auto& v0 = v0s[iv0];
12001200
auto trPosID = v0.getProngID(0);
12011201
auto trNegID = v0.getProngID(1);
1202+
uint8_t v0flags = v0.getBits();
12021203
int posTableIdx = -1, negTableIdx = -1, collID = -1;
12031204
auto item = mGIDToTableID.find(trPosID);
12041205
if (item != mGIDToTableID.end()) {
@@ -1219,7 +1220,7 @@ void AODProducerWorkflowDPL::fillSecondaryVertices(const o2::globaltracking::Rec
12191220
collID = itemV->second;
12201221
}
12211222
if (posTableIdx != -1 and negTableIdx != -1 and collID != -1) {
1222-
v0Cursor(collID, posTableIdx, negTableIdx);
1223+
v0Cursor(collID, posTableIdx, negTableIdx, v0flags);
12231224
mV0ToTableID[int(iv0)] = mTableV0ID++;
12241225
}
12251226
}

Detectors/Vertexing/src/SVertexer.cxx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,9 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
663663
// apply mass selections
664664
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];
665665

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

856856
if (nV0Used || !rejectIfNotCascade) { // need to add this v0
857857
mV0sIdxTmp[ithread].push_back(v0Idxnew);
858+
if (!rejectIfNotCascade) {
859+
mV0sIdxTmp[ithread].back().setStandaloneV0();
860+
}
861+
if (photonOnly) {
862+
mV0sIdxTmp[ithread].back().setPhotonOnly();
863+
}
864+
858865
if (mSVParams->createFullV0s) {
859866
mV0sTmp[ithread].push_back(v0new);
860867
}

Framework/Core/include/Framework/AnalysisDataModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ DECLARE_SOA_TABLE_VERSIONED(V0s_002, "AOD", "V0", 2, //! Run 3 V0 table (version
12971297
v0::IsStandardV0<v0::V0Type>,
12981298
v0::IsPhotonV0<v0::V0Type>);
12991299

1300-
using V0s = V0s_001; //! this defines the current default version
1300+
using V0s = V0s_002; //! this defines the current default version
13011301
using V0 = V0s::iterator;
13021302

13031303
namespace cascade

0 commit comments

Comments
 (0)