ATLAS Offline Software
MuonCalibTrack_E.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <algorithm>
8 #include <utility>
9 
15 
16 namespace {
17  constexpr float qOverP_cutOff = 1.e-9;
18 }
19 namespace MuonCalib {
20 
23 
26 
29 
31 
32  const Amg::Vector3D& MuonCalibTrack_E::position() const { return m_pos; }
33  const Amg::Vector3D& MuonCalibTrack_E::direction() const { return m_dir; }
34 
37 
38  float MuonCalibTrack_E::x0() const { return m_params.x0; }
39  float MuonCalibTrack_E::y0() const { return m_params.y0; }
40  float MuonCalibTrack_E::z0() const { return m_params.z0; }
41  float MuonCalibTrack_E::phi() const { return m_params.phi; }
42  float MuonCalibTrack_E::theta() const { return m_params.theta; }
43  float MuonCalibTrack_E::qOverP() const { return m_params.qOverP; }
44  float MuonCalibTrack_E::p() const { return 1. / std::max(qOverP_cutOff, std::abs(qOverP())); }
45  float MuonCalibTrack_E::pt() const { return std::sin(theta()) * p(); }
46  float MuonCalibTrack_E::errInvP() const { return m_params.cov(4, 4); }
47  int MuonCalibTrack_E::author() const { return m_params.author; }
48  float MuonCalibTrack_E::chi2() const { return m_params.chi2; }
49  int MuonCalibTrack_E::ndof() const { return m_params.ndof; }
50 
51  void MuonCalibTrack_E::setX0(float x0) { m_params.x0 = x0; }
52  void MuonCalibTrack_E::setY0(float y0) { m_params.y0 = y0; }
54  void MuonCalibTrack_E::setPhi(float phi) { m_params.phi = phi; }
58 
59  MuonCalibTrack_E::MuonCalibTrack_E(defineParams pars) : m_params{std::move(pars)}, m_pos{x0(), y0(), z0()} {
60  Amg::setThetaPhi(m_dir, theta(), phi());
61  }
62 
64  if (hit) m_hits.emplace_back(hit);
65  }
66 
68  if (hole) m_holes.emplace_back(hole);
69  }
70 
72  // extrapolate z to IP
74  Amg::Vector3D posAtIp = slProp.propagateToPerigee(m_pos, m_dir);
75  return posAtIp.z();
76  }
77  float MuonCalib::MuonCalibTrack_E::d0() const { return -x0() * std::sin(phi()) + y0() * std::cos(phi()); }
78 
79 } // namespace MuonCalib
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
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:132
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::MuonCalibSLPropagator::propagateToPerigee
Amg::Vector3D propagateToPerigee(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Propagator track parameters to the perigee.
Definition: MuonCalibSLPropagator.cxx:48
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
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
m_dir
TDirectory & m_dir
The directory we need to return to.
Definition: OutputStreamData.cxx:41
max
#define max(a, b)
Definition: cfImp.cxx:41
MuonCalib::MuonCalibTrack_E::setAuthor
void setAuthor(int author)
sets author
Definition: MuonCalibTrack_E.cxx:57
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::defineParams::chi2
float chi2
Definition: MuonCalibTrack_E.h:44
MuonCalib::MuonCalibTrack_E::MuonCalibTrack_E
MuonCalibTrack_E()=default
default constructor
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
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
MuonCalib::MuonCalibTrack_E::defineParams::phi
float phi
Definition: MuonCalibTrack_E.h:39
MuonCalibTrack_E.h
MuonCalib::MuonCalibTrack_E::theta
float theta() const
returns trackparameter theta
Definition: MuonCalibTrack_E.cxx:42
GeoPrimitives.h
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::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::addSegmentOnTrack
void addSegmentOnTrack(const CalibSegPtr &s)
Definition: MuonCalibTrack_E.cxx:30
MuonCalib::MuonCalibTrack_E::defineParams::y0
float y0
Definition: MuonCalibTrack_E.h:37
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
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
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
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::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::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
MuonCalibSLPropagator.h
GeoPrimitivesHelpers.h
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
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
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::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::setX0
void setX0(float x0)
sets trackparameter x0
Definition: MuonCalibTrack_E.cxx:51
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
MuonCalib::MuonCalibTrack_E::defineParams::qOverP
float qOverP
Definition: MuonCalibTrack_E.h:41
MuonCalib::MuonCalibSLPropagator
straight line propagator
Definition: MuonCalibSLPropagator.h:17
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
Amg::setThetaPhi
void setThetaPhi(Amg::Vector3D &v, double theta, double phi)
sets the theta and phi angle of a vector without changing the magnitude
Definition: GeoPrimitivesHelpers.h:70
MuonCalib::MuonCalibTrack_E::pt
float pt() const
returns pt
Definition: MuonCalibTrack_E.cxx:45