Project
Loading...
Searching...
No Matches
V0.cxx
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
13
14using namespace o2::dataformats;
15
16V0::V0(const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, const std::array<float, 6>& covxyz,
17 const o2::track::TrackParCov& trPos, const o2::track::TrackParCov& trNeg, o2::track::PID pid) : mProngs{trPos, trNeg}
18{
19 std::array<float, 21> covV{0.}, covP, covN;
20 trPos.getCovXYZPxPyPzGlo(covP);
21 trNeg.getCovXYZPxPyPzGlo(covN);
22 constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
23 for (int i = 0; i < 6; i++) {
24 covV[i] = covxyz[i];
25 covV[MomInd[i]] = covP[MomInd[i]] + covN[MomInd[i]];
26 }
27 this->set(xyz, pxyz, covV, trPos.getCharge() + trNeg.getCharge(), true, pid);
28 this->checkCorrelations();
29}
30
31float V0::calcMass2(float massPos2, float massNeg2) const
32{
33 auto p2 = getP2();
34 auto p2pos = mProngs[0].getP2(), p2neg = mProngs[1].getP2();
35 auto energy = std::sqrt(massPos2 + p2pos) + std::sqrt(massNeg2 + p2neg);
36 return energy * energy - p2;
37}
38
39float V0::calcAPAlpha() const
40{
41 // calculate Armenteros-Podolanski alpha
42 std::array<float, 3> pP, pN, pV0;
43 float alp = 0.f, pV0tot2 = 0.f;
44 getProng(0).getPxPyPzGlo(pP);
45 getProng(1).getPxPyPzGlo(pN);
46 for (int i = 0; i < 3; i++) {
47 pV0[i] = pP[i] + pN[i];
48 alp += pV0[i] * (pP[i] - pN[i]);
49 pV0tot2 += pV0[i] * pV0[i];
50 }
51 alp /= pV0tot2;
52 return alp;
53}
54
55float V0::calcAPQt() const
56{
57 // calculate Armenteros-Podolanski qt
58 std::array<float, 3> pP, pN, pV0;
59 float pPtot2 = 0.f, pV0tot2 = 0.f, cross = 0.f;
60 getProng(0).getPxPyPzGlo(pP);
61 getProng(1).getPxPyPzGlo(pN);
62 for (int i = 0; i < 3; i++) {
63 pV0[i] = pP[i] + pN[i];
64 pPtot2 += pP[i] * pP[i];
65 pV0tot2 += pV0[i] * pV0[i];
66 cross += pV0[i] * pP[i]; // -> pP * pV0 * cos
67 }
68 float qt = pPtot2 - (cross * cross) / pV0tot2;
69 return qt > 0 ? std::sqrt(qt) : 0;
70}
int32_t i
constexpr int p2()
uint16_t pid
Definition RawData.h:2
const Track & getProng(int i) const
Definition V0.h:39
std::array< Track, 2 > mProngs
Definition V0.h:66
float calcMass2() const
Definition V0.h:49
float calcAPAlpha() const
Definition V0.cxx:39
float calcAPQt() const
Definition V0.cxx:55
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
TrackParCovF TrackParCov
Definition Track.h:33