Project
Loading...
Searching...
No Matches
DCA.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
12#include "GPUCommonMath.h"
15#include <iostream>
16
19
20namespace o2
21{
22namespace dataformats
23{
24
25float DCA::calcChi2() const
26{
27 // Estimate the chi2 for DCA
28 const auto sdd = mCov[0], sdz = mCov[1], szz = mCov[2], det = sdd * szz - sdz * sdz;
29 if (o2::gpu::CAMath::Abs(det) < o2::constants::math::Almost0) {
31 }
32 return (mY * (szz * mY - sdz * mZ) + mZ * (sdd * mZ - mY * sdz)) / det;
33}
34
35std::ostream& operator<<(std::ostream& os, const o2::dataformats::DCA& d)
36{
37 // stream itself
38 os << "DCA YZ {" << d.getY() << ", " << d.getZ() << "} Cov {" << d.getSigmaY2() << ", " << d.getSigmaYZ() << ", " << d.getSigmaZ2() << "}";
39 return os;
40}
41
42void DCA::print() const
43{
44 std::cout << *this << '\n';
45}
46
47} // namespace dataformats
48} // namespace o2
useful math constants
float float float float szz
Definition DCA.h:37
void print() const
Definition DCA.cxx:42
constexpr float Almost0
constexpr float VeryBig
std::ostream & operator<<(std::ostream &os, const o2::dataformats::MeanVertexObject &o)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...