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"
26 log << MSG::INFO <<
"TRT_DriftCircleContainerCnv::initialize()" <<
endmsg;
28 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
29 CHECK( detStore.isValid() );
36 return StatusCode::SUCCESS;
44 auto trans = std::make_unique<InDet::TRT_DriftCircleContainer>(
m_trtId->straw_layer_hash_max());
49 if (not trtDetEleHandle.
isValid() or elements==
nullptr) {
51 return trans.release();
54 for (InDet::TRT_DriftCircleCollection* dcColl : *persObj) {
58 MSG_DEBUG(log,
"Set TRT_DriftCircle detector element to "<< de);
60 InDet::TRT_DriftCircleCollection::iterator itColl = dcColl->begin();
61 InDet::TRT_DriftCircleCollection::iterator lastColl = dcColl->end();
62 for (
int num = 0; itColl != lastColl; ++itColl, ++num) {
64 (*itColl)->m_detEl = de;
67 StatusCode
sc = trans->addCollection(dcColl, collHash);
69 MSG_VERBOSE(log,
"TRT_DriftCircleContainer successfully added to Container !");
71 log << MSG::ERROR <<
"Failed to add TRT_DriftCircleContainer to container" <<
endmsg;
75 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