ATLAS Offline Software
Loading...
Searching...
No Matches
CompetingPixelClustersOnTrack.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// CompetingPixelClustersOnTrack.cxx, (c) ATLAS Detector software
8
10#include "GaudiKernel/MsgStream.h"
11#include "TrkSurfaces/Surface.h"
12#include <cmath>
13#include <ostream>
14
15// default constructor
22
23// copy constructor
26 : Trk::CompetingRIOsOnTrack(compROT)
29{
30 std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter =
31 compROT.m_containedChildRots.begin();
32 for (; rotIter != compROT.m_containedChildRots.end(); ++rotIter) {
33 m_containedChildRots.push_back((*rotIter)->clone());
34 }
35 if (compROT.m_globalPosition) {
36 m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
37 }
38}
39
40// explicit constructor
42 std::vector<const InDet::PixelClusterOnTrack*>&& childrots,
43 std::vector<AssignmentProb>&& assgnProb)
44 : Trk::CompetingRIOsOnTrack(std::move(assgnProb))
46 , m_containedChildRots(std::move(childrots))
47{
48 // initialize local position and error matrix
50}
51
55{
56 if (this != &compROT) {
57 // assignment operator of base class
59 // clear rots
62 if (compROT.m_globalPosition) {
63 m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
64 } else if (m_globalPosition) {
65 m_globalPosition.release().reset();
66 }
67 std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter =
68 compROT.m_containedChildRots.begin();
69 for (; rotIter != compROT.m_containedChildRots.end(); ++rotIter)
70 m_containedChildRots.push_back((*rotIter)->clone());
71 }
72 return (*this);
73}
74
77 InDet::CompetingPixelClustersOnTrack&& compROT) noexcept
78{
79 if (this != &compROT) {
80 // move operator of base class
82 // clear rots
84 m_containedChildRots = std::move(compROT.m_containedChildRots);
85 m_globalPosition = std::move(compROT.m_globalPosition);
86 }
87 return (*this);
88}
89
94
95void
97{
98 std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter =
100 for (; rotIter != m_containedChildRots.end(); ++rotIter)
101 delete (*rotIter);
102}
103
104MsgStream&
106{
107 using std::ios;
108 out << "Trk::CompetingPixelClustersOnTrack with [" << numberOfContainedROTs()
109 << "] competing Pixel RIO_OnTrack objects" << std::endl;
111 out << " - GlobalPosition : ";
112 if (not m_globalPosition)
113 out << "null pointer" << std::endl;
114 else
115 out << *m_globalPosition << endmsg;
116 return out;
117}
118
119std::ostream&
121{
122 using std::ios;
123 out << "Trk::CompetingPixelClustersOnTrack with [" << numberOfContainedROTs()
124 << "] competing Pixel RIO_OnTrack objects" << std::endl;
126 out << " - GlobalPosition : ";
127 if (not m_globalPosition)
128 out << "null pointer" << std::endl;
129 else
130 out << *m_globalPosition << std::endl;
131 return out;
132}
133
134// Have all the contained ROTs a common associated surface?
135bool
137{
138 return true;
139}
140
141const Amg::Vector3D&
143{
144 if (not m_globalPosition) {
145 m_globalPosition.set(std::make_unique<const Amg::Vector3D>(
146 associatedSurface().localToGlobal(localParameters())));
147 }
148 return *m_globalPosition;
149}
#define endmsg
Class for competing PixelClusters, it extends the Trk::CompetingRIOsOnTrack base class.
bool ROTsHaveCommonSurface(const bool withNonVanishingAssignProb=true) const
Have all the contained ROTs a common associated surface?
const Trk::Surface & associatedSurface() const
returns the surface for the local to global transformation .
const Amg::Vector3D & globalPosition() const
Interface method to get the global Position.
void clearChildRotVector()
private method to clear the Trk::RIO_OnTrack vector
unsigned int numberOfContainedROTs() const
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
CompetingPixelClustersOnTrack & operator=(const CompetingPixelClustersOnTrack &compROT)
Assignment operator.
MsgStream & dump(MsgStream &out) const
returns some information about this MeasurementBase/CompetingPixelClustersOnTrack.
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
The global Position.
CompetingPixelClustersOnTrack()
Default Constructor for POOL.
std::vector< const InDet::PixelClusterOnTrack * > m_containedChildRots
The vector of contained InDet::PixelClusterOnTrack objects.
virtual void setLocalParametersAndErrorMatrix()
recalculate the LocalParameters and ErrorMatrix
CompetingRIOsOnTrack & operator=(const CompetingRIOsOnTrack &compROT)=default
Assignment operator.
virtual MsgStream & dump(MsgStream &out) const override
returns the some information about the base class members (avoid code duplication)
CompetingRIOsOnTrack()
Default Constructor for POOL.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.