forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDCA.h
More file actions
82 lines (65 loc) · 1.88 KB
/
DCA.h
File metadata and controls
82 lines (65 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef ALICEO2_DCA_H
#define ALICEO2_DCA_H
#include "GPUCommonDef.h"
#include "GPUCommonRtypes.h"
#ifndef GPUCA_GPUCODE_DEVICE
#include <iosfwd>
#include <array>
#endif
/// \author ruben.shahoyan@cern.ch
/// \brief class for distance of closest approach to vertex
namespace o2
{
namespace dataformats
{
class DCA
{
public:
GPUdDefault() DCA() = default;
GPUd() DCA(float y, float z, float syy = 0.f, float syz = 0.f, float szz = 0.f)
{
set(y, z, syy, syz, szz);
}
GPUd() void set(float y, float z, float syy, float syz, float szz)
{
mY = y;
mZ = z;
mCov[0] = syy;
mCov[1] = syz;
mCov[2] = szz;
}
GPUd() void set(float y, float z)
{
mY = y;
mZ = z;
}
GPUd() auto getY() const { return mY; }
GPUd() auto getZ() const { return mZ; }
GPUd() auto getR2() const { return mY * mY + mZ * mZ; }
GPUd() auto getSigmaY2() const { return mCov[0]; }
GPUd() auto getSigmaYZ() const { return mCov[1]; }
GPUd() auto getSigmaZ2() const { return mCov[2]; }
GPUd() const auto& getCovariance() const { return mCov; }
void print() const;
private:
float mY = 0.f;
float mZ = 0.f;
std::array<float, 3> mCov; ///< s2y, syz, s2z
ClassDefNV(DCA, 1);
};
#ifndef GPUCA_GPUCODE_DEVICE
std::ostream& operator<<(std::ostream& os, const DCA& d);
#endif
} // namespace dataformats
} // namespace o2
#endif //ALICEO2_DCA_H