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
18#ifndef GPUCA_GPUCODE_DEVICE
19#include <iosfwd>
20#include <array>
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() void setY(float y) { mY = y; }
58 GPUd() void setZ(float z) { mZ = z; }
59 GPUd() void setSigmaY2(float v) { mCov[0] = v; }
60 GPUd() void setSigmaYZ(float v) { mCov[1] = v; }
61 GPUd() void setSigmaZ2(float v) { mCov[2] = v; }
62 GPUd() void addCov(const std::array<float, 3>& vadd)
63 {
64 mCov[0] += vadd[0];
65 mCov[1] += vadd[1];
66 mCov[2] += vadd[2];
67 }
68 GPUd() auto getY() const { return mY; }
69 GPUd() auto getZ() const { return mZ; }
70 GPUd() auto getR2() const { return mY * mY + mZ * mZ; }
71 GPUd() auto getSigmaY2() const { return mCov[0]; }
72 GPUd() auto getSigmaYZ() const { return mCov[1]; }
73 GPUd() auto getSigmaZ2() const { return mCov[2]; }
74 GPUd() const auto& getCovariance() const { return mCov; }
75 GPUd() float calcChi2() const;
76
77 void print() const;
78
79 private:
80 float mY = 0.f;
81 float mZ = 0.f;
82 std::array<float, 3> mCov;
83
84 ClassDefNV(DCA, 1);
85};
86
87#ifndef GPUCA_GPUCODE_DEVICE
88std::ostream& operator<<(std::ostream& os, const DCA& d);
89#endif
90
91} // namespace dataformats
92} // namespace o2
93
94#endif //ALICEO2_DCA_H
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
void print() const
Definition DCA.cxx:42
const GLdouble * v
Definition glcorearb.h:832
GLenum array
Definition glcorearb.h:4274
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 ...