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:
59 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 bool isCollinear() const { return testBit(2); }
63 void setStandaloneV0() { setBit(0); }
64 void setPhotonOnly() { setBit(1); }
65 void setCollinear() { setBit(2); }
67};
68
76
78{
79 public:
81 CascadeIndex() = default;
82 CascadeIndex(int v, int v0id, GIndex bachelorID) : mVertexID(v), mV0ID(v0id), mBach(bachelorID) {}
83
84 GIndex getBachelorID() const { return mBach; }
85 void setBachelorID(GIndex gid) { mBach = gid; }
86
87 int getV0ID() const { return mV0ID; }
88 void setV0ID(int vid) { mV0ID = vid; }
89
90 int getVertexID() const { return mVertexID; }
91 void setVertexID(int id) { mVertexID = id; }
92
93 protected:
94 int mVertexID = -1;
95 int mV0ID = -1;
97
99};
100
101} // namespace o2::dataformats
102
103#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...