Project
Loading...
Searching...
No Matches
Decay3Body.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
16Decay3Body::Decay3Body(const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, const std::array<float, 6>& covxyz, const Track& tr0, const Track& tr1, const Track& tr2, o2::track::PID pid)
17 : mProngs{tr0, tr1, tr2}
18{
19 std::array<float, 21> cov{}, cov0{}, cov1{}, cov2{};
20 tr0.getCovXYZPxPyPzGlo(cov0);
21 tr1.getCovXYZPxPyPzGlo(cov1);
22 tr2.getCovXYZPxPyPzGlo(cov2);
23 constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
24 for (int i = 0; i < 6; i++) {
25 cov[i] = covxyz[i];
26 cov[MomInd[i]] = cov0[MomInd[i]] + cov1[MomInd[i]] + cov2[MomInd[i]];
27 }
28 this->set(xyz, pxyz, cov, tr0.getCharge() + tr1.getCharge() + tr2.getCharge(), true, pid);
29}
30
31float Decay3Body::calcMass2(float mass0, float mass1, float mass2) const
32{
33 auto p2 = getP2();
34 auto energy = std::sqrt(mass0 + mProngs[0].getP2()) + std::sqrt(mass1 + mProngs[1].getP2()) + std::sqrt(mass1 + mProngs[2].getP2());
35 return energy * energy - p2;
36}
int32_t i
constexpr int p2()
uint16_t pid
Definition RawData.h:2
o2::track::TrackParCov Track
Definition Decay3Body.h:28
std::array< Track, 3 > mProngs
Definition Decay3Body.h:51
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...