Project
Loading...
Searching...
No Matches
DecayNBodyIndex.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_NBODY_INDEX_H
13#define ALICEO2_NBODY_INDEX_H
14
16
17namespace o2::dataformats
18{
19
20template <int N>
22{
23 public:
25 DecayNBodyIndex() = default;
26 DecayNBodyIndex(int v, const std::array<GIndex, N>& arr) : mVertexID(v), mProngIDs(arr) {}
27 DecayNBodyIndex(int v, std::initializer_list<GIndex> l) : mVertexID(v)
28 {
29 assert(l.size() == N);
30 int i = 0;
31 for (auto e : l) {
32 mProngIDs[i++] = e;
33 }
34 }
35 GIndex getProngID(int i) const { return mProngIDs[i]; }
36 void setProngID(int i, GIndex gid) { mProngIDs[i] = gid; }
37 int getVertexID() const { return mVertexID; }
38 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
44 const std::array<GIndex, N>& getProngs() const { return mProngIDs; }
45 static constexpr int getNProngs() { return N; }
46
47 protected:
48 int mVertexID = -1; // id of parent vertex
49 std::array<GIndex, N> mProngIDs{}; // global IDs of prongs
50 uint8_t mBits = 0; // user defined bits
51
53};
54
55class V0Index : public DecayNBodyIndex<2>
56{
57 public:
58 enum V0Type : uint8_t {
62 };
64 V0Index(int v, GIndex p, GIndex n) : DecayNBodyIndex<2>(v, {p, n}) {}
65 bool isStandaloneV0() const { return testBit(kStandaloneV0); }
66 bool isPhotonOnly() const { return testBit(kPhotonOnly); }
67 bool isCollinear() const { return testBit(kCollinear); }
72};
73
81
83{
84 public:
86 CascadeIndex() = default;
87 CascadeIndex(int v, int v0id, GIndex bachelorID) : mVertexID(v), mV0ID(v0id), mBach(bachelorID) {}
88
89 GIndex getBachelorID() const { return mBach; }
90 void setBachelorID(GIndex gid) { mBach = gid; }
91
92 int getV0ID() const { return mV0ID; }
93 void setV0ID(int vid) { mV0ID = vid; }
94
95 int getVertexID() const { return mVertexID; }
96 void setVertexID(int id) { mVertexID = id; }
97
98 protected:
99 int mVertexID = -1;
100 int mV0ID = -1;
102
104};
105
106} // namespace o2::dataformats
107
108#endif
int32_t i
constexpr int p2()
constexpr int p1()
constexpr to accelerate the coordinates changing
Extention of GlobalTrackID by flags relevant for verter-track association.
CascadeIndex(int v, int v0id, GIndex bachelorID)
Decay3BodyIndex(int v, GIndex p0, GIndex p1, GIndex p2)
ClassDefNV(Decay3BodyIndex, 1)
static constexpr int getNProngs()
void setProngID(int i, GIndex gid)
ClassDefNV(DecayNBodyIndex, 2)
std::array< GIndex, N > mProngIDs
DecayNBodyIndex(int v, const std::array< GIndex, N > &arr)
const std::array< GIndex, N > & getProngs() const
DecayNBodyIndex(int v, std::initializer_list< GIndex > l)
V0Index(int v, GIndex p, GIndex n)
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLuint id
Definition glcorearb.h:650
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...