ATLAS Offline Software
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
9 #include "Pixel1RawDataCnv_p1.h"
10 
11 // Other stuff
12 #include "Identifier/Identifier.h"
14 
15 #include "MsgUtil.h"
16 
17 void
18 Pixel1RawDataCnv_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 
35 void
36 Pixel1RawDataCnv_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 
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 }
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
Identifier::get_compact
value_type get_compact() const
Get the compact id.
Pixel1RawDataCnv_p1::transToPers
virtual void transToPers(const Pixel1RawData *transObj, InDetRawData_p1 *persObj, MsgStream &log)
Definition: Pixel1RawDataCnv_p1.cxx:36
InDetRawData_p1.h
InDetRawData_p1::m_word
unsigned int m_word
Definition: InDetRawData_p1.h:19
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
Pixel1RawData.h
Pixel1RawData
Definition: Pixel1RawData.h:23
Pixel1RawDataCnv_p1::m_pixId
const PixelID * m_pixId
Definition: Pixel1RawDataCnv_p1.h:33
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
errorcheck.h
Helpers for checking error return status codes and reporting errors.
MSG_VERBOSE
#define MSG_VERBOSE(log, x)
Definition: MsgUtil.h:17
InDetRawData::getWord
unsigned int getWord() const
Definition: InDetRawData.h:47
Pixel1RawDataCnv_p1::persToTrans
virtual void persToTrans(const InDetRawData_p1 *persObj, Pixel1RawData *transObj, MsgStream &log)
Definition: Pixel1RawDataCnv_p1.cxx:18
PixelID::pixel_id
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: PixelID.h:432
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Pixel1RawDataCnv_p1::initialize
StatusCode initialize(MsgStream &log)
Definition: Pixel1RawDataCnv_p1.cxx:43
Pixel1RawDataCnv_p1::m_isInitialized
bool m_isInitialized
Definition: Pixel1RawDataCnv_p1.h:34
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
InDetRawData_p1
Definition: InDetRawData_p1.h:10
Pixel1RawDataCnv_p1.h
InDetRawData_p1::m_rdoId
Identifier32::value_type m_rdoId
Definition: InDetRawData_p1.h:18
MsgUtil.h