16#include "GaudiKernel/ISvcLocator.h"
17#include "GaudiKernel/Bootstrap.h"
18#include "GaudiKernel/StatusCode.h"
19#include "GaudiKernel/Service.h"
20#include "GaudiKernel/MsgStream.h"
47 using TRANS = InDet::TRT_DriftCircleContainer;
51 TRANS::const_iterator it_Coll = transCont->begin();
52 TRANS::const_iterator it_CollEnd = transCont->end();
53 unsigned int collIndex;
54 unsigned int chanBegin = 0;
55 unsigned int chanEnd = 0;
56 persCont->
m_collections.resize(transCont->numberOfCollections());
59 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
61 const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
63 chanEnd += collection.
size();
65 pcollection.
m_id = collection.identify().get_compact();
66 pcollection.
m_hashId = (
unsigned int) collection.identifyHash();
67 pcollection.
m_begin = chanBegin;
68 pcollection.
m_end = chanEnd;
70 persCont->
m_PRD.resize(chanEnd);
71 for (
unsigned int i = 0; i < collection.size(); ++i) {
97 InDet::TRT_DriftCircleCollection* coll =
nullptr;
103 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
110 coll =
new InDet::TRT_DriftCircleCollection(collIDHash);
113 coll->resize(nchans);
116 for (
unsigned int ichan = 0; ichan < nchans; ++ ichan) {
121 (*coll)[ichan] = chan;
126 StatusCode
sc = transCont->addCollection(coll, collIDHash);
127 if (
sc.isFailure()) {
128 throw std::runtime_error(
"Failed to add collection to ID Container");
144 if (this->
initialize(log) != StatusCode::SUCCESS) {
145 log << MSG::FATAL <<
"Could not initialize TRT_DriftCircleContainerCnv_p1 " <<
endmsg;
148 std::unique_ptr<InDet::TRT_DriftCircleContainer> trans(std::make_unique<InDet::TRT_DriftCircleContainer>(
m_trtId->module_hash_max()));
150 return(trans.release());
157 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
158 CHECK( detStore.isValid() );
161 return StatusCode::SUCCESS;
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
This is an Identifier helper class for the TRT subdetector.
size_type size() const noexcept
Common base class for all TP converters, specialized for a given transient type.
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
This is a "hash" representation of an Identifier.
Virtual base class of TRT readout elements.
std::vector< TPObjRef > m_PRD
std::vector< InDet::InDetPRD_Collection_p1 > m_collections
const InDetDD::TRT_DetectorManager * m_trtMgr
virtual InDet::TRT_DriftCircleContainer * createTransient(const InDet::InDetPRD_Container_p1 *persObj, MsgStream &log)
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
StatusCode initialize(MsgStream &log)
InDet::TRT_DriftCircleContainer TRANS
This class is an object reference used in Athena persistent data model.