ATLAS Offline Software
MuonCalibTrack_E.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCALIBEXTRATREEEVENT_MUONCALIBTRACK_E_H
6 #define MUONCALIBEXTRATREEEVENT_MUONCALIBTRACK_E_H
7 
11 
12 #include <cmath>
13 #include <memory>
14 #include <vector>
15 namespace MuonCalib {
16  class MuonCalibSegment;
25  public:
26  using CalibHitPtr = std::shared_ptr<const MuonCalibHit_E>;
27  using CalibHolePtr = std::shared_ptr<MuonCalibHole_E>;
28  using CalibSegPtr = std::shared_ptr<MuonCalibSegment>;
29  using HitVector = std::vector<CalibHitPtr>;
30  using HoleVector = std::vector<CalibHolePtr>;
31  using SegmentVector = std::vector<CalibSegPtr>;
32  MuonCalibTrack_E() = default;
33 
34  static constexpr float dummy_chi2{9999.};
35  struct defineParams {
36  float x0{0.};
37  float y0{0.};
38  float z0{0.};
39  float phi{5. * M_PI};
40  float theta{0.};
41  float qOverP{0.};
42 
43  int author{0};
44  float chi2{dummy_chi2};
45  int ndof{1};
47  };
48 
50  MuonCalibTrack_E(defineParams pars);
52 
55  virtual ~MuonCalibTrack_E() = default;
56 
57  const HitVector& hits() const;
58  HitVector& hits();
59 
60  const HoleVector& holes() const;
61  HoleVector& holes();
62 
63  const SegmentVector& segmetnsOnTrack() const;
65 
66  MuonCalibTrack_E& operator=(const MuonCalibTrack_E& rhs) = default;
67  unsigned int nrHits() const { return m_hits.size(); }
68  unsigned int nrHoles() const { return m_holes.size(); }
69 
70  virtual float d0() const;
71  virtual float z0ip() const;
72  float x0() const;
73  float y0() const;
74  float z0() const;
75  float phi() const;
76  float theta() const;
77  float qOverP() const;
78  float p() const;
79  float pt() const;
80  float errInvP() const;
81  int author() const;
82  float chi2() const;
83  int ndof() const;
84 
85  float cov00() const { return m_params.cov(0, 0); }
86  float cov01() const { return m_params.cov(0, 1); }
87  float cov02() const { return m_params.cov(0, 2); }
88  float cov03() const { return m_params.cov(0, 3); }
89  float cov04() const { return m_params.cov(0, 4); }
90  float cov11() const { return m_params.cov(1, 1); }
91  float cov12() const { return m_params.cov(1, 2); }
92  float cov13() const { return m_params.cov(1, 3); }
93  float cov14() const { return m_params.cov(1, 4); }
94  float cov22() const { return m_params.cov(2, 2); }
95  float cov23() const { return m_params.cov(2, 3); }
96  float cov24() const { return m_params.cov(2, 4); }
97  float cov33() const { return m_params.cov(3, 3); }
98  float cov34() const { return m_params.cov(3, 4); }
99  float cov44() const { return m_params.cov(4, 4); }
100 
101  void setX0(float x0);
102  void setY0(float y0);
103  void setZ0(float z0);
104  void setPhi(float phi);
105  void setTheta(float theta);
106  void setQOverP(float qOverP);
107  void setAuthor(int author);
108 
109  void setChi2(float chi2);
110  void setNdof(int ndof);
111 
113  const Amg::Vector3D& position() const;
115  const Amg::Vector3D& direction() const;
116 
117  void setCov00(float cov00) { m_params.cov(0, 0) = cov00; }
118  void setCov01(float cov01) { m_params.cov(0, 1) = cov01; }
119  void setCov02(float cov02) { m_params.cov(0, 2) = cov02; }
120  void setCov03(float cov03) { m_params.cov(0, 3) = cov03; }
121  void setCov04(float cov04) { m_params.cov(0, 4) = cov04; }
122  void setCov11(float cov11) { m_params.cov(1, 1) = cov11; }
123  void setCov12(float cov12) { m_params.cov(1, 2) = cov12; }
124  void setCov13(float cov13) { m_params.cov(1, 3) = cov13; }
125  void setCov14(float cov14) { m_params.cov(1, 4) = cov14; }
126  void setCov22(float cov22) { m_params.cov(2, 2) = cov22; }
127  void setCov23(float cov23) { m_params.cov(2, 3) = cov23; }
128  void setCov24(float cov24) { m_params.cov(2, 4) = cov24; }
129  void setCov33(float cov33) { m_params.cov(3, 3) = cov33; }
130  void setCov34(float cov34) { m_params.cov(3, 4) = cov34; }
131  void setCov44(float cov44) { m_params.cov(4, 4) = cov44; }
132 
133  void addHit(const CalibHitPtr& hit);
134  void addHole(const CalibHolePtr& hole);
135  void addSegmentOnTrack(const CalibSegPtr& s);
136 
137  private:
139  void clear();
140 
144 
146  Amg::Vector3D m_pos{0., 0., 0.};
147  Amg::Vector3D m_dir{0., 0., 1.};
148  };
149 
150 } // namespace MuonCalib
151 
152 #endif // MUONCALIBTRACK_E_H
MuonCalib::MuonCalibTrack_E::defineParams::z0
float z0
Definition: MuonCalibTrack_E.h:38
MuonCalib::MuonCalibTrack_E::addHit
void addHit(const CalibHitPtr &hit)
Add a MuonCalib::MuonCalibHit_E to the track.
Definition: MuonCalibTrack_E.cxx:63
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MuonCalib::MuonCalibTrack_E::setCov24
void setCov24(float cov24)
sets covariance matrix
Definition: MuonCalibTrack_E.h:128
MuonCalib::MuonCalibTrack_E::segmetnsOnTrack
const SegmentVector & segmetnsOnTrack() const
Definition: MuonCalibTrack_E.cxx:27
MuonCalib::MuonCalibTrack_E::ndof
int ndof() const
returns the number of degrees of freedom
Definition: MuonCalibTrack_E.cxx:49
MuonCalib::MuonCalibTrack_E::chi2
float chi2() const
returns track chi2
Definition: MuonCalibTrack_E.cxx:48
MuonCalib::MuonCalibTrack_E::hits
const HitVector & hits() const
Definition: MuonCalibTrack_E.cxx:21
MuonCalib::MuonCalibTrack_E::setCov11
void setCov11(float cov11)
sets covariance matrix
Definition: MuonCalibTrack_E.h:122
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
MuonCalib::MuonCalibTrack_E::setCov33
void setCov33(float cov33)
sets covariance matrix
Definition: MuonCalibTrack_E.h:129
MuonCalib::MuonCalibTrack_E::setAuthor
void setAuthor(int author)
sets author
Definition: MuonCalibTrack_E.cxx:57
MuonCalib::MuonCalibTrack_E::cov22
float cov22() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:94
MuonCalib::MuonCalibTrack_E::setCov12
void setCov12(float cov12)
sets covariance matrix
Definition: MuonCalibTrack_E.h:123
MuonCalib::MuonCalibTrack_E::m_hits
HitVector m_hits
set of MuonCalib::MuonCalibHit_E s on track
Definition: MuonCalibTrack_E.h:141
MuonCalib::MuonCalibTrack_E::holes
const HoleVector & holes() const
Definition: MuonCalibTrack_E.cxx:24
MuonCalib::MuonCalibTrack_E::MuonCalibTrack_E
MuonCalibTrack_E(const MuonCalibTrack_E &pat)=default
destructor
MuonCalib::MuonCalibTrack_E::defineParams::chi2
float chi2
Definition: MuonCalibTrack_E.h:44
MuonCalib::MuonCalibTrack_E::dummy_chi2
static constexpr float dummy_chi2
Definition: MuonCalibTrack_E.h:34
MuonCalib::MuonCalibTrack_E::MuonCalibTrack_E
MuonCalibTrack_E()=default
default constructor
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
MuonCalib::MuonCalibTrack_E::setCov23
void setCov23(float cov23)
sets covariance matrix
Definition: MuonCalibTrack_E.h:127
MuonCalib::MuonCalibTrack_E::cov01
float cov01() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:86
M_PI
#define M_PI
Definition: ActiveFraction.h:11
MuonCalib::MuonCalibTrack_E::phi
float phi() const
returns trackparameter phi
Definition: MuonCalibTrack_E.cxx:41
MuonCalib::MuonCalibTrack_E::defineParams::ndof
int ndof
Definition: MuonCalibTrack_E.h:45
MuonCalib::MuonCalibTrack_E::y0
float y0() const
returns trackparameter y0
Definition: MuonCalibTrack_E.cxx:39
MuonCalib::MuonCalibTrack_E::SegmentVector
std::vector< CalibSegPtr > SegmentVector
Definition: MuonCalibTrack_E.h:31
MuonCalib::MuonCalibTrack_E::setChi2
void setChi2(float chi2)
sets track chi2
Definition: MuonCalibTrack_E.cxx:35
MuonCalib::MuonCalibTrack_E::cov03
float cov03() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:88
MuonCalib::MuonCalibTrack_E::nrHits
unsigned int nrHits() const
returns number of MuonCalib::MuonCalibHit_E s on track
Definition: MuonCalibTrack_E.h:67
MuonCalib::MuonCalibTrack_E::clear
void clear()
Add a Segment on Track.
MuonCalib::MuonCalibTrack_E::defineParams::phi
float phi
Definition: MuonCalibTrack_E.h:39
MuonCalib::MuonCalibTrack_E::cov34
float cov34() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:98
MuonCalib::MuonCalibTrack_E::cov33
float cov33() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:97
MuonCalib::MuonCalibTrack_E::theta
float theta() const
returns trackparameter theta
Definition: MuonCalibTrack_E.cxx:42
MuonCalib::MuonCalibTrack_E::setCov22
void setCov22(float cov22)
sets covariance matrix
Definition: MuonCalibTrack_E.h:126
MuonCalib::MuonCalibTrack_E
Definition: MuonCalibTrack_E.h:24
MuonCalib::MuonCalibTrack_E::defineParams::AmgSymMatrix
AmgSymMatrix(5) cov
Definition: MuonCalibTrack_E.h:46
MuonCalib::MuonCalibTrack_E::nrHoles
unsigned int nrHoles() const
returns number of MuonCalib::MuonCalibHole_E s on track
Definition: MuonCalibTrack_E.h:68
MuonCalib::MuonCalibTrack_E::defineParams
constructor setting all trackparameters and position
Definition: MuonCalibTrack_E.h:35
MuonCalib::MuonCalibTrack_E::setPhi
void setPhi(float phi)
sets trackparameter phi
Definition: MuonCalibTrack_E.cxx:54
MuonCalib::MuonCalibTrack_E::direction
const Amg::Vector3D & direction() const
direction of perigee of track
Definition: MuonCalibTrack_E.cxx:33
MuonCalib::MuonCalibTrack_E::m_params
defineParams m_params
Definition: MuonCalibTrack_E.h:145
MuonCalib::MuonCalibTrack_E::cov13
float cov13() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:92
MuonCalib::MuonCalibTrack_E::position
const Amg::Vector3D & position() const
position of perigee of track
Definition: MuonCalibTrack_E.cxx:32
MuonCalib::MuonCalibTrack_E::m_segments_on_track
SegmentVector m_segments_on_track
Definition: MuonCalibTrack_E.h:143
MuonCalib::MuonCalibTrack_E::m_pos
Amg::Vector3D m_pos
Definition: MuonCalibTrack_E.h:146
MuonCalib::MuonCalibTrack_E::addHole
void addHole(const CalibHolePtr &hole)
Add a MuonCalib::MuonCalibHole_E to the track.
Definition: MuonCalibTrack_E.cxx:67
MuonCalib::MuonCalibTrack_E::CalibHolePtr
std::shared_ptr< MuonCalibHole_E > CalibHolePtr
Definition: MuonCalibTrack_E.h:27
MuonCalib::MuonCalibTrack_E::setCov14
void setCov14(float cov14)
sets covariance matrix
Definition: MuonCalibTrack_E.h:125
MuonCalib::MuonCalibTrack_E::addSegmentOnTrack
void addSegmentOnTrack(const CalibSegPtr &s)
Definition: MuonCalibTrack_E.cxx:30
MuonCalib::MuonCalibTrack_E::defineParams::y0
float y0
Definition: MuonCalibTrack_E.h:37
MuonCalib::MuonCalibTrack_E::setCov04
void setCov04(float cov04)
sets covariance matrix
Definition: MuonCalibTrack_E.h:121
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::MuonCalibTrack_E::cov24
float cov24() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:96
MuonCalib::MuonCalibTrack_E::setCov34
void setCov34(float cov34)
sets covariance matrix
Definition: MuonCalibTrack_E.h:130
MuonCalibHole_E.h
MuonCalib::MuonCalibTrack_E::setTheta
void setTheta(float theta)
sets trackparameter theta
Definition: MuonCalibTrack_E.cxx:55
MuonCalib::MuonCalibTrack_E::qOverP
float qOverP() const
returns trackparameter q/p
Definition: MuonCalibTrack_E.cxx:43
MuonCalibHit_E.h
dso-stats.pat
pat
Definition: dso-stats.py:39
MuonCalib::MuonCalibTrack_E::setZ0
void setZ0(float z0)
sets trackparameter z0
Definition: MuonCalibTrack_E.cxx:53
MuonCalib::MuonCalibTrack_E::CalibSegPtr
std::shared_ptr< MuonCalibSegment > CalibSegPtr
Definition: MuonCalibTrack_E.h:28
EventPrimitives.h
MuonCalib::MuonCalibTrack_E::operator=
MuonCalibTrack_E & operator=(const MuonCalibTrack_E &rhs)=default
assignment operator
MuonCalib::MuonCalibTrack_E::setCov01
void setCov01(float cov01)
sets covariance matrix
Definition: MuonCalibTrack_E.h:118
MuonCalib::MuonCalibTrack_E::x0
float x0() const
returns trackparameter x0
Definition: MuonCalibTrack_E.cxx:38
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonCalib::MuonCalibTrack_E::defineParams::author
int author
Definition: MuonCalibTrack_E.h:43
MuonCalib::MuonCalibTrack_E::setCov44
void setCov44(float cov44)
sets covariance matrix
Definition: MuonCalibTrack_E.h:131
MuonCalib::MuonCalibTrack_E::defineParams::x0
float x0
Definition: MuonCalibTrack_E.h:36
MuonCalib::MuonCalibTrack_E::z0ip
virtual float z0ip() const
returns trackparameter z0 at IP
Definition: MuonCalibTrack_E.cxx:71
MuonCalib::MuonCalibTrack_E::errInvP
float errInvP() const
returns the error**2 on trackparameter q/p
Definition: MuonCalibTrack_E.cxx:46
MuonCalib::MuonCalibTrack_E::setCov00
void setCov00(float cov00)
sets covariance matrix
Definition: MuonCalibTrack_E.h:117
MuonCalib::MuonCalibTrack_E::cov12
float cov12() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:91
MuonCalib::MuonCalibTrack_E::setQOverP
void setQOverP(float qOverP)
sets trackparameter q/p
Definition: MuonCalibTrack_E.cxx:56
MuonCalib::MuonCalibTrack_E::setY0
void setY0(float y0)
sets trackparameter y0
Definition: MuonCalibTrack_E.cxx:52
MuonCalib::MuonCalibTrack_E::cov23
float cov23() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:95
MuonCalib::MuonCalibTrack_E::cov02
float cov02() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:87
MuonCalib::MuonCalibTrack_E::cov04
float cov04() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:89
MuonCalib::MuonCalibTrack_E::p
float p() const
returns momentum
Definition: MuonCalibTrack_E.cxx:44
MuonCalib::MuonCalibTrack_E::author
int author() const
returns the author
Definition: MuonCalibTrack_E.cxx:47
MuonCalib::MuonCalibTrack_E::defineParams::theta
float theta
Definition: MuonCalibTrack_E.h:40
MuonCalib::MuonCalibTrack_E::HitVector
std::vector< CalibHitPtr > HitVector
typedef of a set of MuonCalib::MuonCalibHit_E s
Definition: MuonCalibTrack_E.h:29
MuonCalib::MuonCalibTrack_E::m_holes
HoleVector m_holes
set of MuonCalib::MuonCalibHole_E s on track
Definition: MuonCalibTrack_E.h:142
MuonCalib::MuonCalibTrack_E::~MuonCalibTrack_E
virtual ~MuonCalibTrack_E()=default
MuonCalib::MuonCalibTrack_E::d0
virtual float d0() const
returns trackparameter d0
Definition: MuonCalibTrack_E.cxx:77
MuonCalib::MuonCalibTrack_E::z0
float z0() const
returns trackparameter z0
Definition: MuonCalibTrack_E.cxx:40
Trk::hole
@ hole
Definition: MeasurementType.h:36
MuonCalib::MuonCalibTrack_E::setCov02
void setCov02(float cov02)
sets covariance matrix
Definition: MuonCalibTrack_E.h:119
MuonCalib::MuonCalibTrack_E::setCov13
void setCov13(float cov13)
sets covariance matrix
Definition: MuonCalibTrack_E.h:124
MuonCalib::MuonCalibTrack_E::setX0
void setX0(float x0)
sets trackparameter x0
Definition: MuonCalibTrack_E.cxx:51
MuonCalib::MuonCalibTrack_E::cov14
float cov14() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:93
MuonCalib::MuonCalibTrack_E::cov44
float cov44() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:99
MuonCalib::MuonCalibTrack_E::defineParams::qOverP
float qOverP
Definition: MuonCalibTrack_E.h:41
MuonCalib::MuonCalibTrack_E::cov00
float cov00() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:85
MuonCalib::MuonCalibTrack_E::CalibHitPtr
std::shared_ptr< const MuonCalibHit_E > CalibHitPtr
Definition: MuonCalibTrack_E.h:26
MuonCalib::MuonCalibTrack_E::HoleVector
std::vector< CalibHolePtr > HoleVector
typedef of a set of MuonCalib::MuonCalibHole_E s
Definition: MuonCalibTrack_E.h:30
MuonCalib::MuonCalibTrack_E::m_dir
Amg::Vector3D m_dir
Definition: MuonCalibTrack_E.h:147
MuonCalib::MuonCalibTrack_E::setNdof
void setNdof(int ndof)
sets ndof
Definition: MuonCalibTrack_E.cxx:36
MuonCalib::MuonCalibTrack_E::cov11
float cov11() const
returns the covariance matrix elements
Definition: MuonCalibTrack_E.h:90
MuonCalib::MuonCalibTrack_E::pt
float pt() const
returns pt
Definition: MuonCalibTrack_E.cxx:45
MuonCalib::MuonCalibTrack_E::setCov03
void setCov03(float cov03)
sets covariance matrix
Definition: MuonCalibTrack_E.h:120