ATLAS Offline Software
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 
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 
Trk::LocalParameters
Definition: LocalParameters.h:98
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
PixelClusterOnTrackCnv_p1.h
InDet::PixelClusterOnTrack_p1::m_prdLink
ElementLinkInt_p1 m_prdLink
Link to PRD.
Definition: PixelClusterOnTrack_p1.h:32
InDet::PixelClusterOnTrack::energyLoss
float energyLoss() const
returns the energy loss in MeV associated to this cluster.
Definition: PixelClusterOnTrack.h:206
ITPConverterFor< TRANS_BASE >::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
PixelClusterOnTrackCnv_p1::m_scCnv
SiClusterOnTrackCnv_p1 * m_scCnv
Definition: PixelClusterOnTrackCnv_p1.h:45
InDet::PixelClusterOnTrack_p1::m_isFake
bool m_isFake
Definition: PixelClusterOnTrack_p1.h:29
PixelClusterOnTrackCnv_p1::transToPers
void transToPers(const InDet ::PixelClusterOnTrack *transObj, InDet ::PixelClusterOnTrack_p1 *persObj, MsgStream &log)
Definition: PixelClusterOnTrackCnv_p1.cxx:48
InDet::PixelClusterOnTrack::hasClusterAmbiguity
bool hasClusterAmbiguity() const
returns whether there was an ambiguity associated with this pixel cluster.
Definition: PixelClusterOnTrack.h:198
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PixelClusterOnTrackCnv_p1::m_isInitialized
bool m_isInitialized
Definition: PixelClusterOnTrackCnv_p1.h:50
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
ITPConverterFor< TRANS_BASE >::baseToPersistent
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Persistify bass class of a given object and store the persistent represenation in the storage vector ...
Definition: TPConverter.h:97
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDet::PixelClusterOnTrack_p1
Definition: PixelClusterOnTrack_p1.h:20
errorcheck.h
Helpers for checking error return status codes and reporting errors.
InDet::PixelClusterOnTrack_p1::m_RIO
TPObjRef m_RIO
Definition: PixelClusterOnTrack_p1.h:25
PixelClusterOnTrackCnv_p1::persToTrans
void persToTrans(const InDet ::PixelClusterOnTrack_p1 *persObj, InDet ::PixelClusterOnTrack *transObj, MsgStream &log)
Definition: PixelClusterOnTrackCnv_p1.cxx:17
PixelClusterOnTrackCnv_p1::m_elCnv
ElementLinkCnv_p1< ElementLinkToIDCPixelClusterContainer > m_elCnv
Definition: PixelClusterOnTrackCnv_p1.h:46
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
InDet::PixelClusterOnTrack::isFake
bool isFake() const
returns whether this cluster is likely to be the fake mirror image of a ganged pixel.
Definition: PixelClusterOnTrack.h:202
InDet::PixelClusterOnTrack_p1::m_energyLoss
float m_energyLoss
Definition: PixelClusterOnTrack_p1.h:30
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
PixelClusterOnTrackCnv_p1::m_pixId
const PixelID * m_pixId
Definition: PixelClusterOnTrackCnv_p1.h:49
InDet::PixelClusterOnTrack::prepRawDataLink
const ElementLinkToIDCPixelClusterContainer & prepRawDataLink() const
Definition: PixelClusterOnTrack.h:189
PixelClusterOnTrack.h
InDet::PixelClusterOnTrack_p1::m_hasClusterAmbiguity
bool m_hasClusterAmbiguity
Definition: PixelClusterOnTrack_p1.h:28
PixelClusterOnTrackCnv_p1::initialize
StatusCode initialize(MsgStream &log)
Definition: PixelClusterOnTrackCnv_p1.cxx:64
Identifier
Definition: IdentifierFieldParser.cxx:14