ATLAS Offline Software
Loading...
Searching...
No Matches
PrepRawData.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// PrepRawData.cxx, (c) ATLAS Detector software
8
10#include "GaudiKernel/MsgStream.h"
12#include <new>
13
14namespace Trk {
15
17 const Amg::Vector2D& locpos,
18 const std::vector<Identifier>& rdoList,
19 const Amg::MatrixX& locerr)
21 , m_clusId(clusId)
22 , m_localPos(locpos)
24 , m_localCovariance(locerr)
26{
27}
28
30 const Amg::Vector2D& locpos,
31 std::vector<Identifier>&& rdoList,
32 Amg::MatrixX&& locerr)
34 , m_clusId(clusId)
35 , m_localPos(locpos)
36 , m_rdoList(std::move(rdoList))
37 , m_localCovariance(std::move(locerr))
39{
40}
41
42// Constructor with parameters:
44 const Amg::Vector2D& locpos,
45 const Amg::MatrixX& locerr)
47 , m_clusId(clusId)
48 , m_localPos(locpos)
49 , m_localCovariance(locerr)
51{
52 m_rdoList.push_back(clusId);
53}
54
56 const Amg::Vector2D& locpos,
57 Amg::MatrixX&& locerr)
59 , m_clusId(clusId)
60 , m_localPos(locpos)
61 , m_localCovariance(std::move(locerr))
63{
64 m_rdoList.push_back(clusId);
65}
66
67// Default constructor:
77
78MsgStream&
79PrepRawData::dump(MsgStream& stream) const
80{
81 stream << "PrepRawData object" << endmsg;
82 stream << "Identifier = (" << this->identify().getString() << "), ";
83
84 stream << "Local Position = (";
85 stream << Amg::toString(this->localPosition()) << "), ";
86
87 stream << "Local Covariance = (";
88 if (this->m_localCovariance.size() != 0) {
89 stream << Amg::toString(this->localCovariance()) << "), ";
90 } else {
91 stream << "NULL!), ";
92 }
93
94 stream << "RDO List = [";
95 std::vector<Identifier>::const_iterator rdoIt = this->rdoList().begin();
96 std::vector<Identifier>::const_iterator rdoItEnd = this->rdoList().end();
97 for (; rdoIt != rdoItEnd; ++rdoIt) {
98 stream << rdoIt->getString() << ", ";
99 }
100 stream << "], ";
101
102 stream << "}" << endmsg;
103 return stream;
104}
105
106std::ostream&
107PrepRawData::dump(std::ostream& stream) const
108{
109 stream << "PrepRawData object" << std::endl;
110 stream << "Identifier " << m_clusId << std::endl;
111 stream << "Local Position = (";
112
113 stream << Amg::toString(this->localPosition()) << "), ";
114 stream << "Local Covariance = (";
115 if (this->m_localCovariance.size() != 0) {
116 stream << Amg::toString(this->localCovariance()) << "), ";
117 } else {
118 stream << "NULL!), ";
119 }
120 stream << "Collection Hash: " << m_indexAndHash.collHash()
121 << "\tIndex in collection: " << m_indexAndHash.objIndex() << std::endl;
122 stream << "RDO List = [";
123 for (auto it : m_rdoList) {
124 stream << it << std::endl;
125 }
126 stream << "], ";
127 return stream;
128}
129
130MsgStream&
131operator<<(MsgStream& stream, const PrepRawData& prd)
132{
133 return prd.dump(stream);
134}
135
136std::ostream&
137operator<<(std::ostream& stream, const PrepRawData& prd)
138{
139 return prd.dump(stream);
140}
141
142} // end of ns
143
#define endmsg
std::string getString() const
Provide a string form of the identifier - hexadecimal.
std::vector< Identifier > m_rdoList
Stores the identifiers of the RDOs.
Amg::Vector2D m_localPos
see derived classes for definition of meaning of LocalPosition
Amg::MatrixX m_localCovariance
See derived classes for definition of ErrorMatrix.
virtual MsgStream & dump(MsgStream &stream) const
dump information about the PRD object.
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
IdentContIndex m_indexAndHash
Stores its own position (index) in collection plus the hash id for the collection (needed for the EL ...
PrepRawData()
public because of DataPool
Identifier m_clusId
PrepRawData ID, not const because of DataPool.
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
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
STL namespace.