Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
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 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  }
34  SG::WriteHandle<ITkPixelRDO_Container> itkRDOContainerHandle(m_itkPixelRDOKey, ctx);
35  ATH_CHECK(itkRDOContainerHandle.record(std::move(itkpixelrdocontainer)));
36  return StatusCode::SUCCESS;
37 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
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
IdentifiableContainerMT::addCollection
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
Definition: IdentifiableContainerMT.h:297
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
ITkPixel1RawData.h
ITkPixelTranslatorAlg::m_pixelRDOKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
Definition: ITkPixelTranslatorAlg.h:28
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
ITkPixelTranslatorAlg::m_pixelId
const PixelID * m_pixelId
Definition: ITkPixelTranslatorAlg.h:30
ITkPixelTranslatorAlg.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ITkPixelTranslatorAlg::initialize
virtual StatusCode initialize() override
Definition: ITkPixelTranslatorAlg.cxx:10
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
ITkPixelTranslatorAlg::m_itkPixelRDOKey
SG::WriteHandleKey< ITkPixelRDO_Container > m_itkPixelRDOKey
Definition: ITkPixelTranslatorAlg.h:29
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:831
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.
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25