ATLAS Offline Software
Loading...
Searching...
No Matches
ITkPixelTranslatorAlg.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#include "ITkPixel1RawData.h"
7#include <memory>
8
9
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
22StatusCode ITkPixelTranslatorAlg::execute(const EventContext& ctx) const {
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 auto& 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 }
35 ATH_CHECK(itkRDOContainerHandle.record(std::move(itkpixelrdocontainer)));
36 return StatusCode::SUCCESS;
37}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
SG::WriteHandleKey< ITkPixelRDO_Container > m_itkPixelRDOKey
virtual StatusCode execute(const EventContext &ctx) const override
utility to translate InDet RDO into ITk RDO and record it back to SG
virtual StatusCode initialize() override
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
This is a "hash" representation of an Identifier.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.