Project
Loading...
Searching...
No Matches
DCA.h
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#ifndef ALICEO2_DCA_H
13#define ALICEO2_DCA_H
14
15#include "GPUCommonDef.h"
16#include "GPUCommonRtypes.h"
17#include "GPUCommonArray.h"
18
19#ifndef GPUCA_GPUCODE_DEVICE
20#include <iosfwd>
21#endif
22
25
26namespace o2
27{
28namespace dataformats
29{
30
31class DCA
32{
33
34 public:
35 GPUdDefault() DCA() = default;
36
37 GPUd() DCA(float y, float z, float syy = 0.f, float syz = 0.f, float szz = 0.f)
38 {
39 set(y, z, syy, syz, szz);
40 }
41
42 GPUd() void set(float y, float z, float syy, float syz, float szz)
43 {
44 mY = y;
45 mZ = z;
46 mCov[0] = syy;
47 mCov[1] = syz;
48 mCov[2] = szz;
49 }
50
51 GPUd() void set(float y, float z)
52 {
53 mY = y;
54 mZ = z;
55 }
56
57 GPUd() auto getY() const { return mY; }
58 GPUd() auto getZ() const { return mZ; }
59 GPUd() auto getR2() const { return mY * mY + mZ * mZ; }
60 GPUd() auto getSigmaY2() const { return mCov[0]; }
61 GPUd() auto getSigmaYZ() const { return mCov[1]; }
62 GPUd() auto getSigmaZ2() const { return mCov[2]; }
63 GPUd() const auto& getCovariance() const { return mCov; }
64
65 void print() const;
66
67 private:
68 float mY = 0.f;
69 float mZ = 0.f;
70 gpu::gpustd::array<float, 3> mCov;
71
72 ClassDefNV(DCA, 1);
73};
74
75#ifndef GPUCA_GPUCODE_DEVICE
76std::ostream& operator<<(std::ostream& os, const DCA& d);
77#endif
78
79} // namespace dataformats
80} // namespace o2
81
82#endif //ALICEO2_DCA_H
void print() const
float float float float szz
Definition DCA.h:37
GPUdDefault() DCA()=default
GPUd() DCA(float y
float float float syz
Definition DCA.h:37
float float syy
Definition DCA.h:37
GLdouble f
Definition glcorearb.h:310
GLint y
Definition glcorearb.h:270
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
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 ...