ATLAS Offline Software
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 
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 }
InDet::SiWidthCnv_p2::transToPers
void transToPers(const InDet::SiWidth *, InDet::SiWidth_p2 *, MsgStream &)
Definition: SiWidthCnv_p2.cxx:27
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
Trk::locX
@ locX
Definition: ParamDefs.h:43
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
InDetDD::SolidStateDetectorElementBase
Definition: SolidStateDetectorElementBase.h:132
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
HGTD_Cluster_p1::m_clus_id
IdType_t m_clus_id
Definition: HGTD_Cluster_p1.h:25
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)
HGTD_Cluster::width
virtual const InDet::SiWidth & width() const
Definition: HGTD_Cluster.h:92
HGTD_ClusterCnv_p1::m_si_width_cnv
InDet::SiWidthCnv_p2 m_si_width_cnv
Definition: HGTD_ClusterCnv_p1.h:43
HGTD_Cluster_p1::m_rdo_id_list
std::vector< IdType_t > m_rdo_id_list
Definition: HGTD_Cluster_p1.h:26
HGTD_ClusterCnv_p1.h
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
HGTD_ClusterCnv_p1::createHGTDCluster
HGTD_Cluster createHGTDCluster(const HGTD_Cluster_p1 *pers_obj, const InDetDD::SolidStateDetectorElementBase *delEl, MsgStream &log)
Definition: HGTD_ClusterCnv_p1.cxx:22
HGTD_Cluster
Definition: HGTD_Cluster.h:35
HGTD_Cluster_p1::m_time
float m_time
Definition: HGTD_Cluster_p1.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
HGTD_Cluster_p1::m_mat_11
float m_mat_11
Definition: HGTD_Cluster_p1.h:31
HGTD_Cluster_p1
Definition: HGTD_Cluster_p1.h:17
HGTD_ClusterCnv_p1::transToPers
void transToPers(const HGTD_Cluster *, HGTD_Cluster_p1 *, MsgStream &)
Definition: HGTD_ClusterCnv_p1.cxx:66
HGTD_Cluster::timeResolution
virtual float timeResolution() const
Definition: HGTD_Cluster.h:117
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
EventPrimitives.h
HGTD_Cluster_p1::m_local_pos_x
float m_local_pos_x
Definition: HGTD_Cluster_p1.h:27
HGTD_Cluster_p1::m_local_pos_y
float m_local_pos_y
Definition: HGTD_Cluster_p1.h:28
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
HGTD_Cluster_p1::m_mat_00
float m_mat_00
Definition: HGTD_Cluster_p1.h:29
HGTD_Cluster_p1::m_mat_01
float m_mat_01
Definition: HGTD_Cluster_p1.h:30
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
HGTD_Cluster::totList
virtual const std::vector< int > & totList() const
Definition: HGTD_Cluster.h:119
InDet::SiWidth
Definition: SiWidth.h:25
InDet::SiWidthCnv_p2::persToTrans
void persToTrans(const InDet::SiWidth_p2 *, InDet::SiWidth *, MsgStream &)
Definition: SiWidthCnv_p2.cxx:15
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
HGTD_Cluster_p1::m_width
InDet::SiWidth_p2 m_width
Definition: HGTD_Cluster_p1.h:35
HGTD_ClusterCnv_p1::persToTrans
void persToTrans(const HGTD_Cluster_p1 *, HGTD_Cluster *, MsgStream &)
Definition: HGTD_ClusterCnv_p1.cxx:15
HGTD_Cluster::time
virtual float time() const
Definition: HGTD_Cluster.h:115
HGTD_Cluster_p1::m_time_over_threshold
std::vector< int > m_time_over_threshold
Definition: HGTD_Cluster_p1.h:34
HGTD_Cluster_p1::m_time_resolution
float m_time_resolution
Definition: HGTD_Cluster_p1.h:33