ATLAS Offline Software
Loading...
Searching...
No Matches
MuonClusterOnTrack.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include <iostream>
8
9namespace Muon {
10
11// Default constructor:
17
18// copy constructor:
20 Trk::RIO_OnTrack(rot),
22{
24 if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
25}
26
27
28// Constructor with parameters
30 Trk::LocalParameters&& locpos,
31 Amg::MatrixX&& locerr,
32 const Identifier& id,
33 const double positionAlongStrip)
34 : RIO_OnTrack(std::move(locpos), std::move(locerr), id), // call base class constructor
37
38// Destructor:
40
41// assignment operator:
43 if ( &rot != this) {
44 Trk::RIO_OnTrack::operator=(rot);//base class ass. op.
46 if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
47 else if (m_globalPosition) m_globalPosition.release().reset();
48 }
49 return *this;
50}
51
52MsgStream& MuonClusterOnTrack::dump( MsgStream& stream) const
53{
54 stream << MSG::INFO<<"MuonClusterOnTrack {"<<std::endl;
55
57
58 stream << "Global position (x,y,z) = "<<Amg::toString(globalPosition())<<std::endl;
59 stream << "Position along strip: "<<m_positionAlongStrip<<std::endl;
60 stream<<"}"<<endmsg;
61 return stream;
62}
63
64std::ostream& MuonClusterOnTrack::dump( std::ostream& stream) const
65{
66 stream << "MuonClusterOnTrack {"<<std::endl;
67 std::ios_base::fmtflags originalFormat = stream.flags();
68
70
71 stream << std::setiosflags(std::ios::fixed)<< std::setprecision(3);
72 stream << "Position along strip: "<<m_positionAlongStrip<<std::endl;
73 stream << "Global position (x,y,z) = "<<Amg::toString(globalPosition())<<std::endl;
74
75 stream<<"}"<<std::endl;
76 stream.flags( originalFormat );
77
78 return stream;
79}
80
82 if (detectorElement()==nullptr){
83 // Not much we can do here - no detelement, so just return 0,0,0
84 m_globalPosition.set(std::make_unique<const Amg::Vector3D>(0.0,0.0,0.0));
85 }
86
87 if (not m_globalPosition) {
88 // calculate global position from the position of the strip and the position along the strip
89 Amg::Vector2D lpos{Amg::Vector2D::Zero()};
92 else
94
95 Amg::Vector3D gpos{Amg::Vector3D::Zero()};
96 detectorElement()->surface( identify() ).localToGlobal(lpos, gpos, gpos);
97
98 m_globalPosition.set(std::make_unique<const Amg::Vector3D>(gpos));
99 }
100
101 return *m_globalPosition;
102}
103
104}
105
106
#define endmsg
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
virtual ~MuonClusterOnTrack()
Destructor.
virtual double positionAlongStrip() const
MuonClusterOnTrack()
Pool constructor.
double m_positionAlongStrip
The position along the strip - used to calculate the GlobalPosition.
MuonClusterOnTrack & operator=(const MuonClusterOnTrack &)
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
cache global position, the global position has to be calculated in the inheriting classes
virtual const MuonGM::MuonClusterReadoutElement * detectorElement() const override=0
Returns the detector element, associated with the PRD of this class.
virtual MsgStream & dump(MsgStream &stream) const override
Dumps information about the PRD.
virtual const Amg::Vector3D & globalPosition() const override
Returns global position.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
virtual MsgStream & dump(MsgStream &out) const override
returns the some information about this RIO_OnTrack.
RIO_OnTrack & operator=(const RIO_OnTrack &rot)=default
Assignment operator.
RIO_OnTrack(LocalParameters &&locpars, Amg::MatrixX &&loccov, const Identifier &id)
Constructor with parameters and without externalPrediction.
Identifier identify() const
return the identifier -extends MeasurementBase
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
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
STL namespace.