ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEventCnv
TrkEventTPCnv
src
TrkPrepRawData
PrepRawDataCnv_p1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrkPrepRawData/PrepRawData.h
"
6
#include "
TrkEventTPCnv/TrkPrepRawData/PrepRawDataCnv_p1.h
"
7
#include <algorithm>
8
#include "
AthLinks/tools/IdentContIndex.h
"
9
#include "
EventPrimitives/EventPrimitives.h
"
10
#include "
TrkEventTPCnv/helpers/EigenHelpers.h
"
11
12
void
PrepRawDataCnv_p1::persToTrans
(
const
Trk::PrepRawData_p1
*persObj,
Trk::PrepRawData
*transObj, MsgStream &log )
13
{
14
bool
id32 =
false
;
15
if
((persObj->
m_clusId
& 0XFFFFFFFF00000000LL) == 0 &&
16
(persObj->
m_clusId
& 0X00000000FFFFFFFFLL) != 0) {
17
transObj->
m_clusId
=
Identifier32
(persObj->
m_clusId
);
18
id32 =
true
;
19
}
20
else
21
transObj->
m_clusId
= persObj->
m_clusId
;
22
fillTransFromPStore
( &
m_localPosCnv
, persObj->
m_localPos
, &transObj->
m_localPos
,log );
23
Trk::ErrorMatrix
dummy;
24
fillTransFromPStore
( &
m_errorMxCnv
, persObj->
m_localErrMat
, &dummy, log );
25
Amg::MatrixX
tempMat{};
26
EigenHelpers::vectorToEigenMatrix(dummy.values, tempMat,
"PrepRawDataCnv_p1"
);
27
transObj->
m_localCovariance
=std::move(tempMat);
28
29
transObj->
m_rdoList
.resize( persObj->
m_rdoList
.size() );
30
31
if
(id32) {
32
for
(
size_t
i = 0; i < persObj->
m_rdoList
.size(); i++)
33
transObj->
m_rdoList
[i] =
Identifier32
(persObj->
m_rdoList
[i]);
34
}
35
else
36
std::copy( persObj->
m_rdoList
.begin(), persObj->
m_rdoList
.end(), transObj->
m_rdoList
.begin() );
37
38
transObj->
m_indexAndHash
.
setHashAndIndex
(persObj->
m_indexAndHash
);
39
}
40
41
void
PrepRawDataCnv_p1::transToPers
(
const
Trk::PrepRawData
*transObj,
Trk::PrepRawData_p1
*persObj, MsgStream & log )
42
{
43
persObj->
m_clusId
= transObj->
m_clusId
.
get_identifier32
().
get_compact
();
44
persObj->
m_localPos
=
toPersistent
( &
m_localPosCnv
, &transObj->
m_localPos
, log );
45
46
if
(transObj->
hasLocalCovariance
()){
47
Trk::ErrorMatrix
pMat;
48
EigenHelpers::eigenMatrixToVector
(pMat.
values
, transObj->
m_localCovariance
,
"PrepRawDataCnv_p1"
);
49
persObj->
m_localErrMat
=
toPersistent
( &
m_errorMxCnv
, &pMat, log );
50
}
51
52
persObj->
m_rdoList
.resize( transObj->
m_rdoList
.size() );
53
unsigned
int
i=0;
54
for
( std::vector<Identifier>::const_iterator it = transObj->
m_rdoList
.begin();
55
it != transObj->
m_rdoList
.end();++it,++i) {
56
persObj->
m_rdoList
[i] =it->get_identifier32().get_compact();
57
}
58
59
persObj->
m_indexAndHash
=transObj->
m_indexAndHash
.
hashAndIndex
();
60
}
EigenHelpers.h
EventPrimitives.h
IdentContIndex.h
PrepRawDataCnv_p1.h
PrepRawData.h
ITPConverterFor< TRANS_BASE >::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Definition
TPConverter.h:145
ITPConverterFor< TRANS_BASE >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Definition
TPConverter.h:119
IdentContIndex::setHashAndIndex
void setHashAndIndex(unsigned int hashAndIndex)
Setters of hash, obj index and combined index.
Definition
IdentContIndex.h:117
IdentContIndex::hashAndIndex
unsigned int hashAndIndex() const
combined index
Definition
IdentContIndex.h:99
Identifier32
Definition
Identifier32.h:28
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition
Identifier32.h:47
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
PrepRawDataCnv_p1::persToTrans
void persToTrans(const Trk::PrepRawData_p1 *, Trk::PrepRawData *, MsgStream &)
Definition
PrepRawDataCnv_p1.cxx:12
PrepRawDataCnv_p1::m_localPosCnv
LocalPositionCnv_p1 * m_localPosCnv
Definition
PrepRawDataCnv_p1.h:34
PrepRawDataCnv_p1::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition
PrepRawDataCnv_p1.h:35
PrepRawDataCnv_p1::transToPers
void transToPers(const Trk::PrepRawData *, Trk::PrepRawData_p1 *, MsgStream &)
Definition
PrepRawDataCnv_p1.cxx:41
Trk::ErrorMatrix
Definition
ErrorMatrixCnv_p1.h:25
Trk::ErrorMatrix::values
std::vector< float > values
Definition
ErrorMatrixCnv_p1.h:27
Trk::PrepRawData_p1
Definition
PrepRawData_p1.h:21
Trk::PrepRawData_p1::m_rdoList
std::vector< Identifier::value_type > m_rdoList
Definition
PrepRawData_p1.h:26
Trk::PrepRawData_p1::m_localErrMat
TPObjRef m_localErrMat
Definition
PrepRawData_p1.h:31
Trk::PrepRawData_p1::m_indexAndHash
unsigned int m_indexAndHash
Definition
PrepRawData_p1.h:33
Trk::PrepRawData_p1::m_clusId
Identifier::value_type m_clusId
Definition
PrepRawData_p1.h:25
Trk::PrepRawData_p1::m_localPos
TPObjRef m_localPos
Definition
PrepRawData_p1.h:29
Trk::PrepRawData
Definition
PrepRawData.h:62
Trk::PrepRawData::m_rdoList
std::vector< Identifier > m_rdoList
Stores the identifiers of the RDOs.
Definition
PrepRawData.h:161
Trk::PrepRawData::m_localPos
Amg::Vector2D m_localPos
see derived classes for definition of meaning of LocalPosition
Definition
PrepRawData.h:159
Trk::PrepRawData::m_localCovariance
Amg::MatrixX m_localCovariance
See derived classes for definition of ErrorMatrix.
Definition
PrepRawData.h:163
Trk::PrepRawData::hasLocalCovariance
bool hasLocalCovariance() const
returns localCovariance().size()!=0
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:167
Trk::PrepRawData::m_clusId
Identifier m_clusId
PrepRawData ID, not const because of DataPool.
Definition
PrepRawData.h:156
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition
EventPrimitives.h:27
EigenHelpers::eigenMatrixToVector
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Definition
EFTrackingSmearingAlg.cxx:87
Generated on
for ATLAS Offline Software by
1.17.0