ATLAS Offline Software
PixelClusterCnv_p2.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: PixelClusterCnv_p2.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
14 
15 #include <memory>
16 
19  const InDetDD::SiDetectorElement* detEl,
20  MsgStream &log)
21 {
22  // Local Position
23  Amg::Vector2D localPos;
24  localPos[Trk::locX] = persObj->m_localPosX;
25  localPos[Trk::locY] = persObj->m_localPosY;
26 
27  std::vector<Identifier> rdoList;
28  rdoList.resize( persObj->m_rdoList.size() );
29  Identifier id (persObj->m_clusId);
30  Identifier::value_type id32 = id.get_compact();
31  std::vector<Identifier>::iterator tit = rdoList.begin();
32  for (const InDet::PixelCluster_p2::rdo_diff_type& rdo : persObj->m_rdoList)
33  {
34  *tit = Identifier((Identifier::value_type) rdo + id32);
35  ++tit;
36  }
37 
39  m_swCnv.persToTrans(&persObj->m_width, &width, log);
40 
41  // Error matrix
42  auto cmat = Amg::MatrixX(2,2);
43  (cmat)(0,0) = static_cast<double>(persObj->m_mat00);
44  (cmat)(1,0) = static_cast<double>(persObj->m_mat01);
45  (cmat)(0,1) = static_cast<double>(persObj->m_mat01);
46  (cmat)(1,1) = static_cast<double>(persObj->m_mat11);
47 
48  InDet::PixelCluster clus (id,
49  localPos,
50  std::move(rdoList),
51  0, // lvl1a
52  0, // totalToT
53  std::vector<float>(), // chargeList
54  0, // totalCharge
55  width,
56  detEl,
57  std::move(cmat),
58  persObj->m_omX,
59  persObj->m_omY,
60  0 //splitInfo
61  );
62  return clus;
63 }
64 
65 
67 persToTrans( const InDet::PixelCluster_p2 *persObj, InDet::PixelCluster *transObj, MsgStream &log)
68 {
69  *transObj = createPixelCluster (persObj, nullptr, log);
70 }
71 
72 
74 {
75 // log << MSG::VERBOSE << "In PixelCluster::transToPers" << endmsg;
76  m_swCnv.transToPers(&transObj->width(), &persObj->m_width, log);
77 
78  persObj->m_omX = transObj->omegax();
79  persObj->m_omY = transObj->omegay();
80 
81  // base class:
82  //
83 
84  // Local Position
85  persObj->m_localPosX = transObj->localPosition()[Trk::locX];
86  persObj->m_localPosY = transObj->localPosition()[Trk::locY];
87 
88  // Error Matrix
89  persObj->m_mat00 = (transObj->localCovariance())(0,0);
90  persObj->m_mat01 = (transObj->localCovariance())(0,1);
91  persObj->m_mat11 = (transObj->localCovariance())(1,1);
92 
93  // List of Id of the cluster
94  persObj->m_clusId = transObj->identify().get_compact();
95  persObj->m_rdoList.resize( transObj->rdoList().size() );
96  // convert the list of ID saved for the cluster
97  persObj->m_rdoList.resize(transObj->rdoList().size() );
98 
99 
101  for (const Identifier& id : transObj->rdoList()) {
102  *pit = (InDet::PixelCluster_p2::rdo_diff_type) (id.get_compact()) - persObj->m_clusId ;
103  ++pit;
104  }
105 
106 }
107 
108 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Identifier::value_type
IDENTIFIER_TYPE value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:39
PixelClusterCnv_p2::m_swCnv
InDet::SiWidthCnv_p2 m_swCnv
Definition: PixelClusterCnv_p2.h:40
PixelClusterCnv_p2::transToPers
void transToPers(const InDet::PixelCluster *, InDet::PixelCluster_p2 *, MsgStream &)
Definition: PixelClusterCnv_p2.cxx:73
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
InDet::PixelCluster::omegay
float omegay() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:197
Trk::locX
@ locX
Definition: ParamDefs.h:43
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
PixelCluster.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
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)
InDet::PixelCluster_p2::m_rdoList
std::vector< rdo_diff_type > m_rdoList
Definition: PixelCluster_p2.h:26
InDet::PixelCluster_p2::m_localPosY
float m_localPosY
Definition: PixelCluster_p2.h:28
InDet::PixelCluster_p2::m_clusId
Identifier::value_type m_clusId
Definition: PixelCluster_p2.h:25
TileDCSDataPlotter.tit
tit
Definition: TileDCSDataPlotter.py:890
InDet::PixelCluster_p2::m_localPosX
float m_localPosX
Definition: PixelCluster_p2.h:27
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDet::PixelCluster_p2::rdo_diff_type
Identifier::diff_type rdo_diff_type
Definition: PixelCluster_p2.h:20
InDet::PixelCluster_p2::m_omY
float m_omY
Definition: PixelCluster_p2.h:33
PixelClusterCnv_p2::persToTrans
void persToTrans(const InDet::PixelCluster_p2 *, InDet::PixelCluster *, MsgStream &)
Definition: PixelClusterCnv_p2.cxx:67
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
EventPrimitives.h
InDet::PixelCluster_p2::m_mat01
float m_mat01
Definition: PixelCluster_p2.h:30
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDet::PixelCluster_p2::m_width
InDet::SiWidth_p2 m_width
Definition: PixelCluster_p2.h:36
InDet::PixelCluster_p2::m_mat00
float m_mat00
Definition: PixelCluster_p2.h:29
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
InDet::SiCluster::width
const InDet::SiWidth & width() const
return width class reference
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
InDet::PixelCluster::omegax
float omegax() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:193
InDet::PixelCluster_p2::m_mat11
float m_mat11
Definition: PixelCluster_p2.h:31
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDet::SiWidth
Definition: SiWidth.h:25
InDet::SiWidthCnv_p2::persToTrans
void persToTrans(const InDet::SiWidth_p2 *, InDet::SiWidth *, MsgStream &)
Definition: SiWidthCnv_p2.cxx:15
InDet::PixelCluster_p2
Definition: PixelCluster_p2.h:17
PixelClusterCnv_p2.h
InDet::PixelCluster_p2::m_omX
float m_omX
Definition: PixelCluster_p2.h:32
PixelClusterCnv_p2::createPixelCluster
InDet::PixelCluster createPixelCluster(const InDet::PixelCluster_p2 *persObj, const InDetDD::SiDetectorElement *delEl, MsgStream &log)
Definition: PixelClusterCnv_p2.cxx:18