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