Project
Loading...
Searching...
No Matches
TrackMCH.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
16
17#ifndef ALICEO2_MCH_TRACKMCH_H_
18#define ALICEO2_MCH_TRACKMCH_H_
19
20#include <TMatrixD.h>
21#include <iosfwd>
22
26
27namespace o2
28{
29namespace mch
30{
31
34{
36
37 public:
39
40 TrackMCH() = default;
41 TrackMCH(double z, const TMatrixD& param, const TMatrixD& cov, double chi2, int firstClIdx, int nClusters,
42 double zAtMID, const TMatrixD& paramAtMID, const TMatrixD& covAtMID, const Time& time);
43 ~TrackMCH() = default;
44
45 TrackMCH(const TrackMCH& track) = default;
46 TrackMCH& operator=(const TrackMCH& track) = default;
47 TrackMCH(TrackMCH&&) = default;
49
51 double getX() const { return mParam[0]; }
53 double getY() const { return mParam[2]; }
55 double getZ() const { return mZ; }
57 void setZ(double z) { mZ = z; }
58
59 double getPx() const;
60 double getPy() const;
61 double getPz() const;
62 double getP() const;
63
65 short getSign() const { return (mParam[4] < 0) ? -1 : 1; }
66
68 const double* getParameters() const { return mParam; }
70 void setParameters(const TMatrixD& param) { param.GetMatrix2Array(mParam); }
71
73 const double* getCovariances() const { return mCov; }
75 double getCovariance(int i, int j) const { return mCov[SCovIdx[i][j]]; }
77 void setCovariances(const TMatrixD& cov) { setCovariances(cov, mCov); }
78
80 double getZAtMID() const { return mZAtMID; }
82 void setZAtMID(double z) { mZAtMID = z; }
83
85 const double* getParametersAtMID() const { return mParamAtMID; }
87 void setParametersAtMID(const TMatrixD& param) { param.GetMatrix2Array(mParamAtMID); }
88
90 const double* getCovariancesAtMID() const { return mCovAtMID; }
92 double getCovarianceAtMID(int i, int j) const { return mCovAtMID[SCovIdx[i][j]]; }
94 void setCovariancesAtMID(const TMatrixD& cov) { setCovariances(cov, mCovAtMID); }
95
97 double getChi2() const { return mChi2; }
99 void setChi2(double chi2) { mChi2 = chi2; }
101 int getNDF() const { return 2 * mClusRef.getEntries() - 5; }
103 double getChi2OverNDF() const { return mChi2 / getNDF(); }
104
106 int getNClusters() const { return mClusRef.getEntries(); }
108 int getFirstClusterIdx() const { return mClusRef.getFirstEntry(); }
110 int getLastClusterIdx() const { return mClusRef.getFirstEntry() + mClusRef.getEntries() - 1; }
112 void setClusterRef(int firstClusterIdx, int nClusters) { mClusRef.set(firstClusterIdx, nClusters); }
113
115 const Time& getTimeMUS() const { return mTimeMUS; }
116 Time& getTimeMUS() { return mTimeMUS; }
117 void setTimeMUS(const Time& t) { mTimeMUS = t; }
118 void setTimeMUS(float t, float te)
119 {
120 mTimeMUS.setTimeStamp(t);
121 mTimeMUS.setTimeStampError(te);
122 }
123
125 InteractionRecord getMeanIR(uint32_t refOrbit) const;
126
127 private:
128 static constexpr int SNParams = 5;
129 static constexpr int SCovSize = 15;
131 static constexpr int SCovIdx[SNParams][SNParams] = {{0, 1, 3, 6, 10},
132 {1, 2, 4, 7, 11},
133 {3, 4, 5, 8, 12},
134 {6, 7, 8, 9, 13},
135 {10, 11, 12, 13, 14}};
136
137 void setCovariances(const TMatrixD& src, double (&dest)[SCovSize]);
138
139 double mZ = 0.;
140 double mParam[SNParams] = {0.};
147 double mCov[SCovSize] = {0.};
148
149 double mChi2 = 0.;
150
151 ClusRef mClusRef{};
152
153 double mZAtMID = 0.;
154 double mParamAtMID[SNParams] = {0.};
155 double mCovAtMID[SCovSize] = {0.};
156 Time mTimeMUS{};
157
158 ClassDefNV(TrackMCH, 3);
159};
160
161std::ostream& operator<<(std::ostream& os, const TrackMCH& t);
162
163std::string asString(const o2::mch::TrackMCH& t);
164
165} // namespace mch
166} // namespace o2
167
168#endif // ALICEO2_MCH_TRACKMCH_H_
int16_t time
Definition RawEventData.h:4
int32_t i
Class to refer to the 1st entry and N elements of some group in the continuous container.
uint32_t j
Definition RawData.h:0
int nClusters
MCH track external format.
Definition TrackMCH.h:34
TrackMCH(const TrackMCH &track)=default
double getZAtMID() const
get the track z position on the MID side where the parameters are evaluated
Definition TrackMCH.h:80
TrackMCH()=default
TrackMCH & operator=(const TrackMCH &track)=default
void setParametersAtMID(const TMatrixD &param)
set the track parameters on the MID side
Definition TrackMCH.h:87
void setTimeMUS(const Time &t)
Definition TrackMCH.h:117
o2::dataformats::TimeStampWithError< float, float > Time
Definition TrackMCH.h:38
const double * getParameters() const
get the track parameters
Definition TrackMCH.h:68
~TrackMCH()=default
InteractionRecord getMeanIR(uint32_t refOrbit) const
interaction record corresponding to the mean track time
Definition TrackMCH.cxx:91
double getZ() const
get the track z position where the parameters are evaluated
Definition TrackMCH.h:55
const double * getCovariances() const
get the track parameter covariances
Definition TrackMCH.h:73
void setClusterRef(int firstClusterIdx, int nClusters)
set the number of the clusters attached to the track and the index of the first one
Definition TrackMCH.h:112
void setTimeMUS(float t, float te)
Definition TrackMCH.h:118
void setCovariances(const TMatrixD &cov)
set the track parameter covariances
Definition TrackMCH.h:77
int getLastClusterIdx() const
get the index of the last cluster attached to the track
Definition TrackMCH.h:110
void setZAtMID(double z)
set the track z position on the MID side where the parameters are evaluated
Definition TrackMCH.h:82
double getChi2OverNDF() const
get the track normalized chi2
Definition TrackMCH.h:103
int getFirstClusterIdx() const
get the index of the first cluster attached to the track
Definition TrackMCH.h:108
void setChi2(double chi2)
set the track chi2
Definition TrackMCH.h:99
double getPz() const
Definition TrackMCH.cxx:57
double getP() const
Definition TrackMCH.cxx:68
int getNDF() const
get the number of degrees of freedom of the track
Definition TrackMCH.h:101
double getPx() const
Definition TrackMCH.cxx:43
double getChi2() const
get the track chi2
Definition TrackMCH.h:97
double getX() const
get the track x position
Definition TrackMCH.h:51
void setParameters(const TMatrixD &param)
set the track parameters
Definition TrackMCH.h:70
const Time & getTimeMUS() const
mean time associated to this track, with error
Definition TrackMCH.h:115
int getNClusters() const
get the number of clusters attached to the track
Definition TrackMCH.h:106
double getCovarianceAtMID(int i, int j) const
get the covariance between track parameters i and j on the MID side
Definition TrackMCH.h:92
void setCovariancesAtMID(const TMatrixD &cov)
set the track parameter covariances on the MID side
Definition TrackMCH.h:94
const double * getCovariancesAtMID() const
get the track parameter covariances on the MID side
Definition TrackMCH.h:90
TrackMCH(TrackMCH &&)=default
double getPy() const
Definition TrackMCH.cxx:50
short getSign() const
get the muon sign
Definition TrackMCH.h:65
double getCovariance(int i, int j) const
get the covariance between track parameters i and j
Definition TrackMCH.h:75
TrackMCH & operator=(TrackMCH &&)=default
void setZ(double z)
set the track z position where the parameters are evaluated
Definition TrackMCH.h:57
const double * getParametersAtMID() const
get the track parameters on the MID side
Definition TrackMCH.h:85
Time & getTimeMUS()
Definition TrackMCH.h:116
double getY() const
get the track y position
Definition TrackMCH.h:53
GLenum src
Definition glcorearb.h:1767
GLenum GLfloat param
Definition glcorearb.h:271
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
std::ostream & operator<<(std::ostream &os, const o2::dataformats::MeanVertexObject &o)
std::string asString(const o2::mch::TrackMCH &t)
Definition TrackMCH.cxx:104
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...