ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
ITkPixelByteStreamCnv
src
ITkPixelTranslatorAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ITkPixelTranslatorAlg.h
"
6
#include "
ITkPixel1RawData.h
"
7
#include <memory>
8
9
10
StatusCode
ITkPixelTranslatorAlg::initialize
(){
11
ATH_CHECK
(
m_pixelRDOKey
.initialize());
12
ATH_CHECK
(
m_itkPixelRDOKey
.initialize());
13
ATH_CHECK
(
detStore
()->retrieve(
m_pixelId
,
"PixelID"
) );
14
return
StatusCode::SUCCESS;
15
16
};
17
22
StatusCode
ITkPixelTranslatorAlg::execute
(
const
EventContext& ctx)
const
{
23
SG::ReadHandle<PixelRDO_Container>
rdoContainerHandle(
m_pixelRDOKey
, ctx);
24
std::unique_ptr<ITkPixelRDO_Container> itkpixelrdocontainer = std::make_unique<ITkPixelRDO_Container>(
m_pixelId
->wafer_hash_max());
25
for
(
const
auto
* coll : *rdoContainerHandle){
26
std::unique_ptr<InDetRawDataCollection< ITkPixelRDORawData >> itkColl = std::make_unique<InDetRawDataCollection< ITkPixelRDORawData >>(coll->identifyHash());
27
for
(
const
PixelRDORawData
* rdo : *coll){
28
std::unique_ptr<ITkPixel1RawData> itkrdo = std::make_unique<ITkPixel1RawData>(rdo->identify(), rdo->getWord());
29
itkColl->push_back(itkrdo.release());
30
}
31
IdentifierHash
hash = itkColl->identifyHash();
32
ATH_CHECK
(itkpixelrdocontainer->addCollection(itkColl.release(), hash));
33
}
34
SG::WriteHandle<ITkPixelRDO_Container>
itkRDOContainerHandle(
m_itkPixelRDOKey
, ctx);
35
ATH_CHECK
(itkRDOContainerHandle.
record
(std::move(itkpixelrdocontainer)));
36
return
StatusCode::SUCCESS;
37
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ITkPixel1RawData.h
ITkPixelTranslatorAlg.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
ITkPixelTranslatorAlg::m_itkPixelRDOKey
SG::WriteHandleKey< ITkPixelRDO_Container > m_itkPixelRDOKey
Definition
ITkPixelTranslatorAlg.h:29
ITkPixelTranslatorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
utility to translate InDet RDO into ITk RDO and record it back to SG
Definition
ITkPixelTranslatorAlg.cxx:22
ITkPixelTranslatorAlg::m_pixelId
const PixelID * m_pixelId
Definition
ITkPixelTranslatorAlg.h:30
ITkPixelTranslatorAlg::initialize
virtual StatusCode initialize() override
Definition
ITkPixelTranslatorAlg.cxx:10
ITkPixelTranslatorAlg::m_pixelRDOKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
Definition
ITkPixelTranslatorAlg.h:28
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
PixelRDORawData
Definition
PixelRDORawData.h:23
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Generated on
for ATLAS Offline Software by
1.17.0