ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_ClusterCnv_p1.cxx
Go to the documentation of this file.
1
10
12#include <algorithm>
13#include <iostream>
14
16 const HGTD_Cluster_p1* pers_obj, HGTD_Cluster* trans_obj,
17 MsgStream& log) {
18 log << MSG::VERBOSE << "In HGTD_ClusterCnv_p1::persToTrans" << endmsg;
19 *trans_obj = createHGTDCluster(pers_obj, nullptr, log);
20}
21
23 const HGTD_Cluster_p1* pers_obj,
24 const InDetDD::SolidStateDetectorElementBase* del_el, MsgStream& log) {
25 log << MSG::VERBOSE << "In HGTD_ClusterCnv_p1::createHGTDCluster" << endmsg;
26 // set the cluster identifier
27 Identifier cluster_id(pers_obj->m_clus_id);
28
29 std::vector<Identifier> rdo_list;
30 size_t rdo_list_size = pers_obj->m_rdo_id_list.size();
31 rdo_list.resize(rdo_list_size);
32
33 for (size_t i = 0; i < rdo_list_size; i++) {
34 rdo_list.at(i) = Identifier(pers_obj->m_rdo_id_list.at(i));
35 }
36
37 // Local Position
38 Amg::Vector2D local_pos;
39 local_pos[Trk::locX] = pers_obj->m_local_pos_x;
40 local_pos[Trk::locY] = pers_obj->m_local_pos_y;
41
43 m_si_width_cnv.persToTrans(&pers_obj->m_width, &width, log);
44
45 // Error matrix
46 auto cmat = Amg::MatrixX(2,2);
47 (cmat)(0, 0) = static_cast<double>(pers_obj->m_mat_00);
48 (cmat)(1, 0) = static_cast<double>(pers_obj->m_mat_01);
49 (cmat)(0, 1) = static_cast<double>(pers_obj->m_mat_01);
50 (cmat)(1, 1) = static_cast<double>(pers_obj->m_mat_11);
51
52 HGTD_Cluster cluster(cluster_id, local_pos, std::move(rdo_list),
53 width,
54 del_el,
55 std::move(cmat),
56 pers_obj->m_time,
57 pers_obj->m_time_resolution,
58 std::vector<int>(pers_obj->m_time_over_threshold));
59
60 return cluster;
61}
62
65
67 HGTD_Cluster_p1* pers_obj,
68 MsgStream& log) {
69 log << MSG::VERBOSE << "In HGTD_ClusterCnv_p1::transToPers" << endmsg;
70 m_si_width_cnv.transToPers(&trans_obj->width(), &pers_obj->m_width, log);
71
72 // Local Position
73 pers_obj->m_local_pos_x = trans_obj->localPosition()[Trk::locX];
74 pers_obj->m_local_pos_y = trans_obj->localPosition()[Trk::locY];
75
76 // Error Matrix
77 pers_obj->m_mat_00 = (trans_obj->localCovariance())(0, 0);
78 pers_obj->m_mat_01 = (trans_obj->localCovariance())(0, 1);
79 pers_obj->m_mat_11 = (trans_obj->localCovariance())(1, 1);
80
81 // Time
82 pers_obj->m_time = trans_obj->time();
83 pers_obj->m_time_resolution = trans_obj->timeResolution();
84 pers_obj->m_time_over_threshold = trans_obj->totList();
85
86 // Identifiers
87 pers_obj->m_clus_id = trans_obj->identify().get_compact();
88
89 size_t rdo_size = trans_obj->rdoList().size();
90 pers_obj->m_rdo_id_list.resize(rdo_size);
91 for (size_t i = 0; i < rdo_size; i++) {
92 pers_obj->m_rdo_id_list.at(i) = trans_obj->rdoList().at(i).get_compact();
93 }
94}
#define endmsg
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
const double width
HGTD_Cluster createHGTDCluster(const HGTD_Cluster_p1 *pers_obj, const InDetDD::SolidStateDetectorElementBase *delEl, MsgStream &log)
void persToTrans(const HGTD_Cluster_p1 *, HGTD_Cluster *, MsgStream &)
void transToPers(const HGTD_Cluster *, HGTD_Cluster_p1 *, MsgStream &)
InDet::SiWidthCnv_p2 m_si_width_cnv
std::vector< int > m_time_over_threshold
InDet::SiWidth_p2 m_width
std::vector< IdType_t > m_rdo_id_list
virtual float time() const
virtual const std::vector< int > & totList() const
virtual const InDet::SiWidth & width() const
virtual float timeResolution() const
value_type get_compact() const
Get the compact id.
Class to hold geometrical description of a solid state detector element.
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)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37