Project
Loading...
Searching...
No Matches
Vertex.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#include <iostream>
14#ifndef GPUCA_NO_FMT
15#include <fmt/printf.h>
16#endif
17
18namespace o2
19{
20namespace dataformats
21{
22
23#ifndef GPUCA_GPUCODE_DEVICE
24#ifndef GPUCA_NO_FMT
25std::string VertexBase::asString() const
26{
27 return fmt::format("Vtx {{{:+.4e},{:+.4e},{:+.4e}}} Cov.:{{{{{:.3e}..}},{{{:.3e},{:.3e}..}},{{{:.3e},{:.3e},{:.3e}}}}}",
28 mPos.X(), mPos.Y(), mPos.Z(), mCov[0], mCov[1], mCov[2], mCov[3], mCov[4], mCov[5]);
29}
30
31std::ostream& operator<<(std::ostream& os, const o2::dataformats::VertexBase& v)
32{
33 // stream itself
34 os << v.asString();
35 return os;
36}
37
39{
40 std::cout << *this << std::endl;
41}
42#endif
43
45{
46 if (mPos.X() != other.mPos.X() || mPos.Y() != other.mPos.Y() || mPos.Z() != other.mPos.Z()) {
47 return false;
48 }
49 for (int i = 0; i < kNCov; i++) {
50 if (mCov[i] != other.mCov[i]) {
51 return false;
52 }
53 }
54 return true;
55}
56
57#endif
58
61
62} // namespace dataformats
63} // namespace o2
int32_t i
static constexpr int kNCov
Definition Vertex.h:42
std::string asString() const
Definition Vertex.cxx:25
bool operator==(const VertexBase &other) const
Definition Vertex.cxx:44
math_utils::Point3D< float > mPos
cartesian position
Definition Vertex.h:110
gpu::gpustd::array< float, kNCov > mCov
errors, see CovElems enum
Definition Vertex.h:111
const GLdouble * v
Definition glcorearb.h:832
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 ...
VectorOfTObjectPtrs other