Skip to content

Commit ead09a6

Browse files
shahor02chiarazampolli
authored andcommitted
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 8f35bd2 commit ead09a6

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

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
@@ -1156,6 +1156,7 @@ void AODProducerWorkflowDPL::fillSecondaryVertices(const o2::globaltracking::Rec
11561156
const auto& v0 = v0s[iv0];
11571157
auto trPosID = v0.getProngID(0);
11581158
auto trNegID = v0.getProngID(1);
1159+
uint8_t v0flags = v0.getBits();
11591160
int posTableIdx = -1, negTableIdx = -1, collID = -1;
11601161
auto item = mGIDToTableID.find(trPosID);
11611162
if (item != mGIDToTableID.end()) {
@@ -1176,7 +1177,7 @@ void AODProducerWorkflowDPL::fillSecondaryVertices(const o2::globaltracking::Rec
11761177
collID = itemV->second;
11771178
}
11781179
if (posTableIdx != -1 and negTableIdx != -1 and collID != -1) {
1179-
v0Cursor(collID, posTableIdx, negTableIdx);
1180+
v0Cursor(collID, posTableIdx, negTableIdx, v0flags);
11801181
mV0ToTableID[int(iv0)] = mTableV0ID++;
11811182
}
11821183
}

Detectors/Vertexing/src/SVertexer.cxx

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

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

852852
if (nV0Used || !rejectIfNotCascade) { // need to add this v0
853853
mV0sIdxTmp[ithread].push_back(v0Idxnew);
854+
if (!rejectIfNotCascade) {
855+
mV0sIdxTmp[ithread].back().setStandaloneV0();
856+
}
857+
if (photonOnly) {
858+
mV0sIdxTmp[ithread].back().setPhotonOnly();
859+
}
860+
854861
if (mSVParams->createFullV0s) {
855862
mV0sTmp[ithread].push_back(v0new);
856863
}

Framework/Core/include/Framework/AnalysisDataModel.h

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

1274-
using V0s = V0s_001; //! this defines the current default version
1274+
using V0s = V0s_002; //! this defines the current default version
12751275
using V0 = V0s::iterator;
12761276

12771277
namespace cascade

0 commit comments

Comments
 (0)