ATLAS Offline Software
Loading...
Searching...
No Matches
PixelClusterOnTrackCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5//-----------------------------------------------------------------------------
6//
7// file: PixelClusterOnTrackCnv_p1.cxx
8//
9//-----------------------------------------------------------------------------
10
14
15
18 InDet::PixelClusterOnTrack *transObj, MsgStream &log )
19{
20 if(!m_isInitialized) {
21 if (this->initialize(log) != StatusCode::SUCCESS) {
22 log << MSG::FATAL << "Could not initialize PixelClusterOnTrackCnv_p1 " << endmsg;
23 }
24 }
25
26 Trk::LocalParameters localParams;
27 Amg::MatrixX localCovariance;
28 localCovariance.setZero();
29
31 m_elCnv.persToTrans(&persObj->m_prdLink,&rio,log);
32 *transObj = InDet::PixelClusterOnTrack(rio,
33 localParams,
34 localCovariance,
35 0, //idDE
36 Identifier(),
37 persObj->m_energyLoss,
38 persObj->m_isFake,
39 persObj->m_hasClusterAmbiguity,
40 false
41 );
42
43 fillTransFromPStore( &m_scCnv, persObj->m_RIO, transObj, log );
44}
45
46
49 InDet::PixelClusterOnTrack_p1 *persObj, MsgStream &log )
50{
51 persObj->m_RIO = baseToPersistent( &m_scCnv, transObj, log );
52// persObj->m_idDE = transObj->m_idDE;
53
54 persObj->m_hasClusterAmbiguity = transObj->hasClusterAmbiguity();
55 persObj->m_isFake = transObj->isFake();
56 persObj->m_energyLoss = transObj->energyLoss();
57// m_elementLinkConverter.resetForCnv(persObj->m_elementLinkToIDCPixelClusterContainerNames);
58// m_elementLinkConverter.transToPers(&transObj->m_rio,&persObj->m_elementLinkToIDCPixelClusterContainer,log);
59 // m_elCnv.transToPers(&transObj->m_rio,&persObj->m_prdLink,log);
60 persObj->m_prdLink.m_contName = transObj->prepRawDataLink().dataID();// New suggestion from RD - above crashes
61 persObj->m_prdLink.m_elementIndex = transObj->prepRawDataLink().index();
62}
63
64StatusCode PixelClusterOnTrackCnv_p1::initialize(MsgStream &/*log*/) {
65 // Do not initialize again:
66 m_isInitialized=true;
67
68 // Get Storegate, ID helpers, and so on
69 ISvcLocator* svcLocator = Gaudi::svcLocator();
70 SmartIF<StoreGateSvc> detStore (svcLocator->service("DetectorStore"));
71 CHECK( detStore.isValid() );
72 CHECK( detStore->retrieve(m_pixId, "PixelID") );
73
74 return StatusCode::SUCCESS;
75}
76
#define endmsg
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
ElementLink< InDet::PixelClusterContainer > ElementLinkToIDCPixelClusterContainer
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Definition TPConverter.h:97
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
ElementLinkInt_p1 m_prdLink
Link to PRD.
Specific class to represent the pixel measurements.
const ElementLinkToIDCPixelClusterContainer & prepRawDataLink() const
bool isFake() const
returns whether this cluster is likely to be the fake mirror image of a ganged pixel.
bool hasClusterAmbiguity() const
returns whether there was an ambiguity associated with this pixel cluster.
float energyLoss() const
returns the energy loss in MeV associated to this cluster.
ElementLinkCnv_p1< ElementLinkToIDCPixelClusterContainer > m_elCnv
SiClusterOnTrackCnv_p1 * m_scCnv
StatusCode initialize(MsgStream &log)
void persToTrans(const InDet ::PixelClusterOnTrack_p1 *persObj, InDet ::PixelClusterOnTrack *transObj, MsgStream &log)
void transToPers(const InDet ::PixelClusterOnTrack *transObj, InDet ::PixelClusterOnTrack_p1 *persObj, MsgStream &log)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
void initialize()