16#include "GaudiKernel/Bootstrap.h"
17#include "GaudiKernel/ISvcLocator.h"
18#include "GaudiKernel/MsgStream.h"
19#include "GaudiKernel/Service.h"
20#include "GaudiKernel/StatusCode.h"
35 log << MSG::INFO <<
"PixelClusterContainerCnv::initialize()" <<
endmsg;
37 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
38 CHECK( detStore.isValid() );
44 return StatusCode::SUCCESS;
52 std::unique_ptr<InDet::PixelClusterContainer> trans(std::make_unique<InDet::PixelClusterContainer>(
m_pixId->wafer_hash_max()) );
57 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
59 return trans.release();
62 for (InDet::PixelClusterCollection* dcColl : *persObj) {
66 MSG_DEBUG(log,
"Set PixelCluster detector element to "<< de);
68 InDet::PixelClusterCollection::iterator itColl = dcColl->begin();
69 InDet::PixelClusterCollection::iterator lastColl = dcColl->end();
70 for (
int num = 0; itColl != lastColl; ++itColl, ++num) {
72 (*itColl)->m_detEl = de;
75 StatusCode
sc= trans? trans->addCollection(dcColl, collHash): StatusCode::FAILURE;
77 MSG_VERBOSE(log,
"PixelClusterContainer successfully added to Container !");
79 log << MSG::ERROR <<
"Failed to add PixelClusterContainer to container" <<
endmsg;
83 return trans.release();
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
#define MSG_VERBOSE(log, x)
#define MSG_DEBUG(log, x)
DataVector< Trk::PrepRawDataCollection< InDet::PixelCluster > > PixelClusterContainer_p0
This is an Identifier helper class for the Pixel subdetector.
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
Class to hold the SiDetectorElement objects to be put in the detector store.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Class to hold geometrical description of a silicon detector element.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
virtual InDet::PixelClusterContainer * createTransient(const PixelClusterContainer_p0 *, MsgStream &) override
PixelClusterContainerCnv_p0()
StatusCode initialize(MsgStream &log)