ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegment.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TrkEvent
7#include "CxxUtils/sincos.h"
15
16#include <cfloat>
17#include <iostream>
18namespace Muon {
19
20const float MuonSegment::kNoValue = FLT_MAX;
21
22MuonSegment::MuonSegment()
23 : Segment()
29{}
30
43
45MuonSegment::operator=(const MuonSegment& seg)
46{
47 if (this != &seg) {
54 }
55 return (*this);
56}
57
58MuonSegment::MuonSegment(Trk::LocalParameters&& locpars,
59 Amg::MatrixX&& locerr,
62 Trk::FitQuality* fqual,
63 Segment::Author author)
64 : Segment(std::move(locpars), std::move(locerr),
65 std::move(cmeas), fqual, author)
71{
74}
75
76MuonSegment::MuonSegment(const Amg::Vector2D& locSegPos,
77 const Trk::LocalDirection& locSegDir,
78 Amg::MatrixX&& locErr,
81 Trk::FitQuality* fqual,
82 Segment::Author author)
83 : Segment(Trk::LocalParameters(), std::move(locErr),
84 std::move(cmeas), fqual, author)
89 , m_localDirection(locSegDir)
90{
92
93 Amg::Vector2D lpos(locSegPos[Trk::locX], locSegPos[Trk::locY]);
95
96 double phi = m_globalDirection.phi();
97 double theta = m_globalDirection.theta();
98 std::array<Trk::DefinedParameter, 4> pars = {
99 {{locSegPos[Trk::locX], Trk::locX},
100 {locSegPos[Trk::locY], Trk::locY},
101 {phi, Trk::phi},
102 {theta, Trk::theta}}};
104}
105
106MuonSegment::~MuonSegment() = default;
107
108void
109MuonSegment::recalculateCache()
110{
111
114
115 double sintheta = sctheta.sn;
116 double costheta = sctheta.cs;
117 double sinphi = scphi.sn;
118 double cosphi = scphi.cs;
120 Amg::Vector3D(cosphi * sintheta, sinphi * sintheta, costheta);
123}
124
125MsgStream&
126MuonSegment::dump(MsgStream& out) const
127{
128 out << "Muon::MuonSegment " << std::endl;
129 out << " - global position : " << std::endl
130 << Amg::toString(globalPosition()) << std::endl;
131 out << std::endl << localDirection() << std::endl;
132 out << " - local parameters : " << std::endl
133 << localParameters() << std::endl;
134 out << " - local Err Matrix : ";
135 out << std::endl << Amg::toString(localCovariance()) << std::endl;
136 if (nullptr != m_fitQuality)
137 out << " - fit Quality : " << std::endl
138 << (*fitQuality()) << std::endl;
139 else
140 out << " - fit Quality : NO " << std::endl;
141 out << " - associated Surface : " << std::endl
142 << associatedSurface() << std::endl;
143 out << " - t0 (error) : " << time() << "(" << errorTime() << ")"
144 << std::endl;
145 out << " - it contains : " << numberOfContainedROTs()
146 << " RIO_OnTrack object" << std::endl;
147 unsigned int numRoT = 1;
149 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(m);
150 if (rot) {
151 out << "RoT " << numRoT++ << std::endl << *rot << std::endl;
152 }
153 }
154 return out;
155}
156
157std::ostream&
158MuonSegment::dump(std::ostream& out) const
159{
160 out << "Muon::MuonSegment " << std::endl;
161 out << " - global position : " << std::endl
162 << Amg::toString(globalPosition()) << std::endl;
163 out << std::endl << localDirection() << std::endl;
164 out << " - local parameters : " << std::endl
165 << localParameters() << std::endl;
166 out << " - local Err Matrix : ";
167 out << std::endl << Amg::toString(localCovariance()) << std::endl;
168 if (nullptr != m_fitQuality)
169 out << " - fit Quality : " << std::endl
170 << (*fitQuality()) << std::endl;
171 else
172 out << " - fit Quality : NO " << std::endl;
173 out << " - associated Surface : " << std::endl
174 << associatedSurface() << std::endl;
175 out << " - t0 (error) : " << time() << "(" << errorTime() << ")"
176 << std::endl;
177 out << " - it contains : " << numberOfContainedROTs()
178 << " RIO_OnTrack object" << std::endl;
179 unsigned int numRoT = 1;
181 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(m);
182 if (rot) {
183 out << "RoT " << numRoT++ << std::endl << *rot << std::endl;
184 }
185 }
186 return out;
187}
188
189}
190
Scalar phi() const
phi method
Scalar theta() const
theta method
Derived DataVector<T>.
Definition DataVector.h:795
static const float kNoValue
define invalid value, used when the segment has no fitted t0
This is the common class for 3D segments used in the muon spectrometer.
void recalculateCache()
recalculate the cache
MuonSegment()
Default Constructor for POOL.
Amg::Vector3D m_globalPosition
The global position the surface can be associated to.
virtual const Amg::Vector3D & globalPosition() const override final
global position
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
static const float kNoValue
define invalid value, used when the segment has no fitted t0
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition FitQuality.h:97
represents the three-dimensional global direction with respect to a planar surface frame.
This class is the pure abstract base class for all fittable tracking measurements.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
LocalParameters m_localParams
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
void localToGlobalDirection(const Trk::LocalDirection &locdir, Amg::Vector3D &globdir) const
This method transforms a local direction wrt the plane to a global direction.
virtual PlaneSurface * clone() const override
Virtual constructor.
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
Author author() const
return segment author
Segment()
Default Constructor for POOL.
std::unique_ptr< FitQuality > m_fitQuality
The fit quality of the Segment.
Segment & operator=(const Segment &seg)
Assignment operator.
const FitQuality * fitQuality() const
return the FitQuality object, returns NULL if no FitQuality is defined
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
SpaceTimePointBase & operator=(const SpaceTimePointBase &stpb)=default
Assignment operator.
float errorTime() const
access to the error on the measured time
SpaceTimePointBase(const float &t, const float &t_error, const float &weight)
constructor taking a time, an error on the time and a weight
float time() const
access to the measured time
SurfacePtrHolderImplDetEl & operator=(const SurfacePtrHolderImplDetEl &other)
copy assingmemnt if surface is free we clone/copy.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Ensure that the ATLAS eigen extensions are properly loaded.
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
@ theta
Definition ParamDefs.h:66
@ phi
Definition ParamDefs.h:75
STL namespace.
Helper to simultaneously calculate sin and cos of the same angle.
Helper to simultaneously calculate sin and cos of the same angle.
Definition sincos.h:39