ATLAS Offline Software
Loading...
Searching...
No Matches
Pixel1RawDataCnv_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
6
7// Persistent class and converter header file
10
11// Other stuff
12#include "Identifier/Identifier.h"
14
15#include "MsgUtil.h"
16
17void
18Pixel1RawDataCnv_p1::persToTrans(const InDetRawData_p1* persObj, Pixel1RawData* transObj, MsgStream &log)
19{
20 MSG_VERBOSE(log,"Pixel1RawDataCnv_p1::persToTrans called ");
21
22 if(!m_isInitialized) {
23 if (this->initialize(log) != StatusCode::SUCCESS) {
24 log << MSG::FATAL << "Could not initialize PixelClusterOnTrackCnv_p1 " << endmsg;
25 }
26 }
27
28 // Must ask pixelID helper to contruct channel id. Special
29 // treatment is needed when reading in unsigned int and going to
30 // 64-bit id.
31 *transObj = Pixel1RawData (m_pixId->pixel_id(persObj->m_rdoId),
32 persObj->m_word);
33}
34
35void
36Pixel1RawDataCnv_p1::transToPers(const Pixel1RawData* transObj, InDetRawData_p1* persObj, MsgStream &log)
37{
38 MSG_VERBOSE(log,"Pixel1RawDataCnv_p1::transToPers called ");
39 persObj->m_rdoId = transObj->identify().get_compact();
40 persObj->m_word = transObj->getWord();
41}
42
43StatusCode Pixel1RawDataCnv_p1::initialize(MsgStream &/*log*/) {
44 // Do not initialize again:
45 m_isInitialized=true;
46
47 // get DetectorStore service
48 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
49 CHECK( detStore.isValid() );
50 CHECK( detStore->retrieve(m_pixId, "PixelID") );
51
52 return StatusCode::SUCCESS;
53}
#define endmsg
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
#define MSG_VERBOSE(log, x)
Definition MsgUtil.h:17
value_type get_compact() const
Get the compact id.
unsigned int m_word
Identifier32::value_type m_rdoId
virtual Identifier identify() const override final
unsigned int getWord() const
virtual void persToTrans(const InDetRawData_p1 *persObj, Pixel1RawData *transObj, MsgStream &log)
StatusCode initialize(MsgStream &log)
virtual void transToPers(const Pixel1RawData *transObj, InDetRawData_p1 *persObj, MsgStream &log)
void initialize()