ATLAS Offline Software
CompetingMuonClustersOnTrack.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // CompetingMuonClustersOnTrack.cxx, (c) ATLAS Detector software
8 
9 // Trk
10 #include "GaudiKernel/MsgStream.h"
11 // Muon
13 // std
14 #include <cmath>
15 
16 namespace Muon {
17 // default constructor
21  , m_globalPosition()
22  , m_containedChildRots()
23 {
24 }
25 
26 // copy constructor
28  const CompetingMuonClustersOnTrack& compROT)
29  : Trk::CompetingRIOsOnTrack(compROT)
30  , Trk::SurfacePtrHolderDetEl(compROT)
31  , m_globalPosition()
32  , m_containedChildRots()
33 {
34  if (compROT.m_globalPosition) {
35  m_globalPosition.store(
36  std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
37  }
38 
39  std::vector<const MuonClusterOnTrack*>::const_iterator rotIter =
40  compROT.m_containedChildRots.begin();
41 
42  for (; rotIter != compROT.m_containedChildRots.end(); ++rotIter) {
43  m_containedChildRots.push_back((*rotIter)->clone());
44  }
45 }
46 
47 // explicit constructor
49  std::vector<const MuonClusterOnTrack*>&& childrots,
50  std::vector<AssignmentProb>&& assgnProb)
51  : Trk::CompetingRIOsOnTrack(std::move(assgnProb))
53  , m_globalPosition()
54  , m_containedChildRots(std::move(childrots))
55 {
57 }
58 
60  Trk::LocalParameters&& locPars,
62  const Trk::Surface* assSurf,
63  std::vector<const MuonClusterOnTrack*>&& childrots,
64  std::vector<AssignmentProb>&& assgnProb)
65  : Trk::CompetingRIOsOnTrack(std::move(assgnProb))
66  , Trk::SurfacePtrHolderDetEl(assSurf)
67  , m_globalPosition()
68  , m_containedChildRots(std::move(childrots))
69 {
70  Trk::MeasurementBase::m_localParams = std::move(locPars);
72 }
73 
76  const CompetingMuonClustersOnTrack& compROT)
77 {
78  if (this != &compROT) {
79  // assingment operator of base class
82  // clear rots
84  m_containedChildRots.clear();
85  std::vector<const MuonClusterOnTrack*>::const_iterator rotIter =
86  compROT.m_containedChildRots.begin();
87 
88  for (; rotIter != compROT.m_containedChildRots.end(); ++rotIter) {
89  m_containedChildRots.push_back((*rotIter)->clone());
90  }
91  if (compROT.m_globalPosition) {
92  m_globalPosition.store(
93  std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
94  } else if (m_globalPosition) {
95  m_globalPosition.release().reset();
96  }
97  }
98  return (*this);
99 }
100 
103  CompetingMuonClustersOnTrack&& compROT) noexcept
104 {
105  if (this != &compROT) {
108  clearChildRotVector();
109  m_containedChildRots.clear();
110  m_containedChildRots = std::move(compROT.m_containedChildRots);
111  m_globalPosition = std::move(compROT.m_globalPosition);
112  }
113  return (*this);
114 }
115 
117 {
119 }
120 
121 void
123 {
125  delete cl;
126  }
127 }
128 
129 MsgStream&
131 {
132  out << "Muon::CompetingMuonClustersOnTrack (Muon competingROTs) "
133  << std::endl;
134  out << " - it contains : " << m_containedChildRots.size()
135  << " RIO_OnTrack objects" << std::endl;
136  out << " - parameters : " << std::endl;
137  out << " - parameter key : " << std::endl;
138  return out;
139 }
140 
141 std::ostream&
143 {
144  out << "Muon::CompetingMuonClustersOnTrack (Muon competingROTs) "
145  << std::endl;
146  out << " - it contains : " << m_containedChildRots.size()
147  << " RIO_OnTrack objects" << std::endl;
148  out << " - it contains : " << numberOfContainedROTs()
149  << " RIO_OnTrack objects" << std::endl;
150  out << " - parameters : " << std::endl;
151  out << " - parameter key : " << std::endl;
152  return out;
153 }
154 
155 // Have all the contained ROTs a common associated surface?
156 bool
158 {
159  return true;
160 }
161 
162 }
Trk::LocalParameters
Definition: LocalParameters.h:98
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::SurfacePtrHolderImplDetEl::operator=
SurfacePtrHolderImplDetEl & operator=(const SurfacePtrHolderImplDetEl &other)
copy assingmemnt if surface is free we clone/copy.
Definition: SurfaceHolderImpl.h:192
Muon::CompetingMuonClustersOnTrack::m_containedChildRots
std::vector< const MuonClusterOnTrack * > m_containedChildRots
The vector of contained Muon::MuonClusterOnTrack objects.
Definition: CompetingMuonClustersOnTrack.h:144
Muon::CompetingMuonClustersOnTrack::ROTsHaveCommonSurface
bool ROTsHaveCommonSurface(const bool withNonVanishingAssignProb=true) const
Have all the contained ROTs a common associated surface? If withNonVanishingAssignProb==true just the...
Definition: CompetingMuonClustersOnTrack.cxx:157
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CompetingMuonClustersOnTrack.h
Trk::SurfacePtrHolderDetEl
Trk::SurfacePtrHolderImplDetEl< Surface > SurfacePtrHolderDetEl
Definition: SurfaceHolders.h:36
Muon::CompetingMuonClustersOnTrack::clearChildRotVector
void clearChildRotVector()
private method to clear the Trk::RIO_OnTrack vector
Definition: CompetingMuonClustersOnTrack.cxx:122
Muon::CompetingMuonClustersOnTrack
Definition: CompetingMuonClustersOnTrack.h:54
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Trk::CompetingRIOsOnTrack::setLocalParametersAndErrorMatrix
virtual void setLocalParametersAndErrorMatrix()
recalculate the LocalParameters and ErrorMatrix
Definition: CompetingRIOsOnTrack.cxx:34
Trk::CompetingRIOsOnTrack::operator=
CompetingRIOsOnTrack & operator=(const CompetingRIOsOnTrack &compROT)=default
Assignment operator.
Trk::MeasurementBaseType::CompetingRIOsOnTrack
@ CompetingRIOsOnTrack
Definition: MeasurementBase.h:50
Muon::CompetingMuonClustersOnTrack::~CompetingMuonClustersOnTrack
virtual ~CompetingMuonClustersOnTrack()
Destructor.
Definition: CompetingMuonClustersOnTrack.cxx:116
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
Muon::CompetingMuonClustersOnTrack::numberOfContainedROTs
unsigned int numberOfContainedROTs() const
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
Definition: CompetingMuonClustersOnTrack.h:178
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::MeasurementBase::m_localCovariance
Amg::MatrixX m_localCovariance
Definition: MeasurementBase.h:112
Muon::CompetingMuonClustersOnTrack::CompetingMuonClustersOnTrack
CompetingMuonClustersOnTrack()
Default Constructor for POOL.
Definition: CompetingMuonClustersOnTrack.cxx:18
Muon::CompetingMuonClustersOnTrack::dump
MsgStream & dump(MsgStream &out) const
returns some information about this MeasurementBase/CompetingMuonClustersOnTrack.
Definition: CompetingMuonClustersOnTrack.cxx:130
Muon::CompetingMuonClustersOnTrack::operator=
CompetingMuonClustersOnTrack & operator=(const CompetingMuonClustersOnTrack &compROT)
Assignment operator.
Definition: CompetingMuonClustersOnTrack.cxx:75
Muon::CompetingMuonClustersOnTrack::m_globalPosition
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
The global Position.
Definition: CompetingMuonClustersOnTrack.h:141
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
error
Definition: IImpactPoint3dEstimator.h:70
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34