ATLAS Offline Software
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 
14 namespace 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)
23  , m_rdoList(rdoList)
24  , m_localCovariance(locerr)
25  , m_indexAndHash()
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))
38  , m_indexAndHash()
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)
50  , m_indexAndHash()
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))
62  , m_indexAndHash()
63 {
64  m_rdoList.push_back(clusId);
65 }
66 
67 // Default constructor:
70  , m_clusId(0)
71  , m_localPos()
72  , m_rdoList()
73  , m_localCovariance{}
74  , m_indexAndHash()
75 {
76 }
77 
78 MsgStream&
79 PrepRawData::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 
106 std::ostream&
107 PrepRawData::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 
130 MsgStream&
131 operator<<(MsgStream& stream, const PrepRawData& prd)
132 {
133  return prd.dump(stream);
134 }
135 
136 std::ostream&
137 operator<<(std::ostream& stream, const PrepRawData& prd)
138 {
139  return prd.dump(stream);
140 }
141 
142 } // end of ns
143 
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::PrepRawData::dump
virtual MsgStream & dump(MsgStream &stream) const
dump information about the PRD object.
Definition: PrepRawData.cxx:79
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Trk::PrepRawData::m_localCovariance
Amg::MatrixX m_localCovariance
See derived classes for definition of ErrorMatrix.
Definition: PrepRawData.h:158
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Trk::PrepRawData::m_clusId
Identifier m_clusId
PrepRawData ID, not const because of DataPool.
Definition: PrepRawData.h:151
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
PrepRawData.h
Trk::ObjectCounter
Helper to enable counting number of instantiations in debug builds.
Definition: TrkObjectCounter.h:18
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trk::PrepRawData::m_rdoList
std::vector< Identifier > m_rdoList
Stores the identifiers of the RDOs.
Definition: PrepRawData.h:156
Trk::PrepRawData::PrepRawData
PrepRawData()
public because of DataPool
Definition: PrepRawData.cxx:68
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
IdentContIndex::objIndex
unsigned short objIndex() const
object index in collection
Definition: IdentContIndex.h:92
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
Trk::PrepRawData::m_indexAndHash
IdentContIndex m_indexAndHash
Stores its own position (index) in collection plus the hash id for the collection (needed for the EL ...
Definition: PrepRawData.h:162
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
GeoPrimitivesToStringConverter.h
IdentContIndex::collHash
unsigned short collHash() const
Accessor to hash, obj index and combined index.
Definition: IdentContIndex.h:85
Identifier
Definition: IdentifierFieldParser.cxx:14