ATLAS Offline Software
Loading...
Searching...
No Matches
MuonClusterOnTrack.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// MuonClusterOnTrack.cxx
7// Implementation file for class MuonClusterOnTrack
9// (c) ATLAS Detector software
11// Version 1.0 06/07/2004 Ketevi A. Assamagan
12// adapted from Veronique Boisvert
14
15#include <new>
17#include <iostream>
18
19namespace Muon {
20
21// Default constructor:
27
28// copy constructor:
30 Trk::RIO_OnTrack(rot),
32{
34 if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
35}
36
37
38// Constructor with parameters
40 Trk::LocalParameters&& locpos,
41 Amg::MatrixX&& locerr,
42 const Identifier& id,
43 const double positionAlongStrip)
44 : RIO_OnTrack(std::move(locpos), std::move(locerr), id), // call base class constructor
47
48// Destructor:
50
51// assignment operator:
53 if ( &rot != this) {
54 Trk::RIO_OnTrack::operator=(rot);//base class ass. op.
56 if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
57 else if (m_globalPosition) m_globalPosition.release().reset();
58 }
59 return *this;
60}
61
62MsgStream& MuonClusterOnTrack::dump( MsgStream& stream) const
63{
64 stream << MSG::INFO<<"MuonClusterOnTrack {"<<std::endl;
65
67
68 stream << "Global position (x,y,z) = (";
69 stream <<this->globalPosition().x()<<", "
70 <<this->globalPosition().y()<<", "
71 <<this->globalPosition().z()<<")"<<std::endl;
72 stream << "Position along strip: "<<m_positionAlongStrip<<std::endl;
73 stream<<"}"<<endmsg;
74 return stream;
75}
76
77std::ostream& MuonClusterOnTrack::dump( std::ostream& stream) const
78{
79 stream << "MuonClusterOnTrack {"<<std::endl;
80 std::ios_base::fmtflags originalFormat = stream.flags();
81
83
84 stream << std::setiosflags(std::ios::fixed)<< std::setprecision(3);
85
86 stream << "Position along strip: "<<m_positionAlongStrip<<std::endl;
87 stream<<"}"<<std::endl;
88 stream.flags( originalFormat );
89
90 return stream;
91}
92
94 if (detectorElement()==nullptr){
95 // Not much we can do here - no detelement, so just return 0,0,0
96 m_globalPosition.set(std::make_unique<const Amg::Vector3D>(0.0,0.0,0.0));
97 }
98
99 if (not m_globalPosition) {
100 // calculate global position from the position of the strip and the position along the strip
101 Amg::Vector2D lpos{Amg::Vector2D::Zero()};
104 else
106
107 Amg::Vector3D gpos{Amg::Vector3D::Zero()};
108 detectorElement()->surface( identify() ).localToGlobal(lpos, gpos, gpos);
109
110 m_globalPosition.set(std::make_unique<const Amg::Vector3D>(gpos));
111 }
112
113 return *m_globalPosition;
114}
115
116}
117
118
#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:130
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
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.