ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
InDetEventTPCnv
src
InDetPrepRawData
SCT_ClusterCnv_p3.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//-----------------------------------------------------------------------------
6
//
7
// file: SCT_ClusterCnv_p3.cxx
8
//
9
//-----------------------------------------------------------------------------
10
11
#include "
InDetPrepRawData/SCT_Cluster.h
"
12
13
#include "
EventPrimitives/EventPrimitives.h
"
14
15
#include "
InDetEventTPCnv/InDetPrepRawData/SCT_ClusterCnv_p3.h
"
16
17
#include <memory>
18
19
SCT_ClusterCnv_p3::SCT_ClusterCnv_p3
(
const
SCT_ID
* sctid )
20
:
21
m_sctId2
(sctid)
22
{}
23
24
25
InDet::SCT_Cluster
26
SCT_ClusterCnv_p3::createSCT_Cluster
(
const
InDet::SCT_Cluster_p3
* persObj,
27
Identifier
clusId,
28
const
InDetDD::SiDetectorElement
* detEl,
29
MsgStream& log)
30
{
31
// Local Position
32
Amg::Vector2D
localPos;
33
localPos[
Trk::locX
] = persObj->
m_localPos
;
34
localPos[
Trk::locY
] = 0;
35
36
// List of Id of the cluster
37
std::vector<Identifier> rdoList;
38
rdoList.resize( persObj->
m_rdoList
.size() );
39
//Identifier::value_type id32 = transObj->identify().get_compact();
40
//Identifier id32 = transObj->identify();
41
std::vector<Identifier>::iterator tit = rdoList.begin();
42
for
(
const
InDet::SCT_Cluster_p3::rdo_diff_type
& rdo : persObj->
m_rdoList
) {
43
*tit =
Identifier
(
m_sctId2
->strip_id_offset(clusId,rdo) );
44
++tit;
45
}
46
47
InDet::SiWidth
sw;
48
m_swCnv
.persToTrans(&persObj->
m_width
, &sw, log);
49
50
// Error matrix
51
auto
cmat =
Amg::MatrixX
(2,2);
52
(cmat)(0,0) =
static_cast<
double
>
(persObj->
m_mat00
);
53
(cmat)(1,0) =
static_cast<
double
>
(persObj->
m_mat01
);
54
(cmat)(0,1) =
static_cast<
double
>
(persObj->
m_mat01
);
55
(cmat)(1,1) =
static_cast<
double
>
(persObj->
m_mat11
);
56
57
InDet::SCT_Cluster
clus (clusId,
58
localPos,
59
std::move(rdoList),
60
sw,
61
detEl,
62
std::move(cmat));
63
clus.
setHitsInThirdTimeBin
( persObj->
m_hitsInThirdTimeBin
) ;
64
return
clus;
65
}
66
67
68
void
SCT_ClusterCnv_p3::
69
persToTrans
(
const
InDet::SCT_Cluster_p3
*persObj,
InDet::SCT_Cluster
*transObj, MsgStream &log)
70
{
71
Identifier
clusId = transObj->
identify
();
72
*transObj =
createSCT_Cluster
(persObj, clusId,
nullptr
, log);
73
}
74
75
76
void
SCT_ClusterCnv_p3::transToPers
(
const
InDet::SCT_Cluster
*transObj,
InDet::SCT_Cluster_p3
*persObj, MsgStream &log )
77
{
78
// if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "In SCT_Cluster::transToPers" << endmsg;
79
const
InDet::SiWidth
*sw = &transObj->
width
();
80
m_swCnv
.transToPers(sw, &persObj->
m_width
, log);
81
82
// Local Position
83
persObj->
m_localPos
= transObj->
localPosition
()[
Trk::locX
];
84
85
// cluster weight
86
persObj->
m_hitsInThirdTimeBin
= transObj->
hitsInThirdTimeBin
();
87
88
89
// Error Matrix
90
persObj->
m_mat00
= (transObj->
localCovariance
())(0,0);
91
persObj->
m_mat01
= (transObj->
localCovariance
())(0,1);
92
persObj->
m_mat11
= (transObj->
localCovariance
())(1,1);
93
94
persObj->
m_rdoList
.resize( transObj->
rdoList
().size() );
95
//Identifier::value_type id32 = transObj->identify().get_compact();
96
const
Identifier
id32 = transObj->
identify
();
97
98
std::vector<InDet::SCT_Cluster_p3::rdo_diff_type>::iterator pit = persObj->
m_rdoList
.begin();
99
for
(
const
Identifier
&
id
: transObj->
rdoList
()) {
100
*pit =
static_cast<
InDet::SCT_Cluster_p3::rdo_diff_type
>
(
m_sctId2
->calc_offset(id32,
id
) );
101
++pit;
102
}
103
104
}
105
106
EventPrimitives.h
SCT_ClusterCnv_p3.h
SCT_Cluster.h
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDet::SCT_Cluster_p3
Definition
SCT_Cluster_p3.h:18
InDet::SCT_Cluster_p3::m_mat01
float m_mat01
Definition
SCT_Cluster_p3.h:30
InDet::SCT_Cluster_p3::rdo_diff_type
short rdo_diff_type
Definition
SCT_Cluster_p3.h:22
InDet::SCT_Cluster_p3::m_rdoList
std::vector< rdo_diff_type > m_rdoList
Definition
SCT_Cluster_p3.h:27
InDet::SCT_Cluster_p3::m_localPos
float m_localPos
Definition
SCT_Cluster_p3.h:28
InDet::SCT_Cluster_p3::m_hitsInThirdTimeBin
uint16_t m_hitsInThirdTimeBin
Definition
SCT_Cluster_p3.h:32
InDet::SCT_Cluster_p3::m_mat00
float m_mat00
Definition
SCT_Cluster_p3.h:29
InDet::SCT_Cluster_p3::m_width
InDet::SiWidth_p2 m_width
Definition
SCT_Cluster_p3.h:35
InDet::SCT_Cluster_p3::m_mat11
float m_mat11
Definition
SCT_Cluster_p3.h:31
InDet::SCT_Cluster
Definition
SCT_Cluster.h:34
InDet::SCT_Cluster::setHitsInThirdTimeBin
void setHitsInThirdTimeBin(uint16_t hitsInThirdTimeBin)
Setter method of timing.
Definition
SCT_Cluster.h:99
InDet::SCT_Cluster::hitsInThirdTimeBin
uint16_t hitsInThirdTimeBin() const
Getter method of timing.
Definition
SCT_Cluster.h:94
InDet::SiCluster::width
const InDet::SiWidth & width() const
return width class reference
InDet::SiWidth
Definition
SiWidth.h:25
SCT_ClusterCnv_p3::transToPers
void transToPers(const InDet::SCT_Cluster *, InDet::SCT_Cluster_p3 *, MsgStream &)
Definition
SCT_ClusterCnv_p3.cxx:76
SCT_ClusterCnv_p3::persToTrans
void persToTrans(const InDet::SCT_Cluster_p3 *, InDet::SCT_Cluster *, MsgStream &)
Definition
SCT_ClusterCnv_p3.cxx:69
SCT_ClusterCnv_p3::m_sctId2
const SCT_ID * m_sctId2
Definition
SCT_ClusterCnv_p3.h:44
SCT_ClusterCnv_p3::m_swCnv
InDet::SiWidthCnv_p2 m_swCnv
Definition
SCT_ClusterCnv_p3.h:45
SCT_ClusterCnv_p3::SCT_ClusterCnv_p3
SCT_ClusterCnv_p3()
Definition
SCT_ClusterCnv_p3.h:31
SCT_ClusterCnv_p3::createSCT_Cluster
InDet::SCT_Cluster createSCT_Cluster(const InDet::SCT_Cluster_p3 *persObj, Identifier clusId, const InDetDD::SiDetectorElement *detEl, MsgStream &log)
Definition
SCT_ClusterCnv_p3.cxx:26
SCT_ID
This is an Identifier helper class for the SCT subdetector.
Definition
SCT_ID.h:68
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
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
Identifier
Definition
IdentifierFieldParser.cxx:14
Trk::locY
@ locY
local cartesian
Definition
ParamDefs.h:38
Trk::locX
@ locX
Definition
ParamDefs.h:37
Generated on
for ATLAS Offline Software by
1.17.0