|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | + |
| 11 | +#ifndef ALICEO2_V0_H |
| 12 | +#define ALICEO2_V0_H |
| 13 | + |
| 14 | +#include "ReconstructionDataFormats/VtxTrackIndex.h" |
| 15 | +#include "ReconstructionDataFormats/Track.h" |
| 16 | +#include "ReconstructionDataFormats/PID.h" |
| 17 | +#include <array> |
| 18 | +#include <Math/SVector.h> |
| 19 | + |
| 20 | +namespace o2 |
| 21 | +{ |
| 22 | +namespace dataformats |
| 23 | +{ |
| 24 | + |
| 25 | +class V0 : public o2::track::TrackParCov |
| 26 | +{ |
| 27 | + public: |
| 28 | + using GIndex = o2::dataformats::VtxTrackIndex; |
| 29 | + using Track = o2::track::TrackParCov; |
| 30 | + using PID = o2::track::PID; |
| 31 | + |
| 32 | + V0() = default; |
| 33 | + V0(const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, |
| 34 | + const o2::track::TrackParCov& trPos, const o2::track::TrackParCov& trNeg, |
| 35 | + GIndex trPosID, GIndex trNegID); |
| 36 | + |
| 37 | + GIndex getProngID(int i) const { return mProngIDs[i]; } |
| 38 | + void setProngID(int i, GIndex gid) { mProngIDs[i] = gid; } |
| 39 | + |
| 40 | + const Track& getProng(int i) const { return mProngs[i]; } |
| 41 | + Track& getProng(int i) { return mProngs[i]; } |
| 42 | + void setProng(int i, const Track& t) { mProngs[i] = t; } |
| 43 | + |
| 44 | + float getCosPA() const { return mCosPA; } |
| 45 | + void setCosPA(float c) { mCosPA = c; } |
| 46 | + |
| 47 | + float getDCA() const { return mDCA; } |
| 48 | + void setDCA(float d) { mDCA = d; } |
| 49 | + |
| 50 | + int getVertexID() const { return mVertexID; } |
| 51 | + void setVertexID(int id) { mVertexID = id; } |
| 52 | + |
| 53 | + float getMass2() const |
| 54 | + { |
| 55 | + return calcMass2(mProngs[0].getPID(), mProngs[1].getPID()); |
| 56 | + } |
| 57 | + |
| 58 | + float calcMass2(PID pidPos, PID pidNeg) const |
| 59 | + { |
| 60 | + return calcMass2(PID::getMass2(pidPos), PID::getMass2(pidNeg)); |
| 61 | + } |
| 62 | + |
| 63 | + float calcMass2(float massPos2, float massNeg2) const; |
| 64 | + |
| 65 | + protected: |
| 66 | + std::array<GIndex, 2> mProngIDs; // global IDs of prongs |
| 67 | + std::array<Track, 2> mProngs; // prongs kinematics at vertex |
| 68 | + float mCosPA = 0; // cos of pointing angle |
| 69 | + float mDCA = 9990; // distance of closest approach of prongs |
| 70 | + int mVertexID = -1; // id of parent vertex |
| 71 | + |
| 72 | + ClassDefNV(V0, 1); |
| 73 | +}; |
| 74 | + |
| 75 | +} // namespace dataformats |
| 76 | +} // namespace o2 |
| 77 | +#endif |
0 commit comments