13#include "GaudiKernel/ISvcLocator.h"
14#include "GaudiKernel/Bootstrap.h"
15#include "GaudiKernel/StatusCode.h"
16#include "GaudiKernel/Service.h"
17#include "GaudiKernel/MsgStream.h"
28 log << MSG::INFO <<
"TRT_DriftCircleContainerCnv::initialize()" <<
endmsg;
30 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
31 CHECK( detStore.isValid() );
38 return StatusCode::SUCCESS;
46 std::unique_ptr<InDet::TRT_DriftCircleContainer> trans(std::make_unique<InDet::TRT_DriftCircleContainer>(
m_trtId->straw_layer_hash_max()) );
51 if (not trtDetEleHandle.
isValid() or elements==
nullptr) {
53 return trans.release();
56 for (InDet::TRT_DriftCircleCollection* dcColl : *persObj) {
60 MSG_DEBUG(log,
"Set TRT_DriftCircle detector element to "<< de);
62 InDet::TRT_DriftCircleCollection::iterator itColl = dcColl->begin();
63 InDet::TRT_DriftCircleCollection::iterator lastColl = dcColl->end();
64 for (
int num = 0; itColl != lastColl; ++itColl, ++num) {
66 (*itColl)->m_detEl = de;
69 StatusCode
sc= trans ? trans->addCollection(dcColl, collHash): StatusCode::FAILURE;
71 MSG_VERBOSE(log,
"TRT_DriftCircleContainer successfully added to Container !");
73 log << MSG::ERROR <<
"Failed to add TRT_DriftCircleContainer to container" <<
endmsg;
77 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::TRT_DriftCircle > > TRT_DriftCircleContainer_p0
This is an Identifier helper class for the TRT subdetector.
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
Virtual base class of TRT readout elements.
Class to hold collection of TRT detector elements.
const TRT_BaseElement * getDetectorElement(const IdentifierHash &hash) const
virtual InDet::TRT_DriftCircleContainer * createTransient(const TRT_DriftCircleContainer_p0 *, MsgStream &) override
StatusCode initialize(MsgStream &log)
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleContKey