|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "Identifier/Identifier.h"
18 #include "GaudiKernel/ISvcLocator.h"
19 #include "GaudiKernel/Bootstrap.h"
20 #include "GaudiKernel/StatusCode.h"
21 #include "GaudiKernel/Service.h"
22 #include "GaudiKernel/MsgStream.h"
55 unsigned int idLast(0);
59 TRANS::const_iterator it_Coll = transCont->begin();
60 TRANS::const_iterator it_CollEnd = transCont->end();
61 unsigned int collIndex;
62 unsigned int chanBegin = 0;
63 unsigned int chanEnd = 0;
65 persCont->
m_collections.resize(transCont->numberOfCollections());
70 for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++it_Coll) {
72 totSize+=collection.size();
79 for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
83 chanEnd += collection.size();
85 unsigned int deltaId = (collection.identifyHash()-idLast);
95 idLast = collection.identifyHash();
96 pcollection.
m_size = collection.size();
101 for (
unsigned int i = 0;
i < collection.size(); ++
i) {
106 persCont->
m_prdDeltaId[
i+chanBegin]=
chan->identify().get_identifier32().get_compact()-collection.identify().get_identifier32().get_compact();
132 elements = (*trtDetEleHandle)->getElements();
133 if (not trtDetEleHandle.
isValid() or elements==
nullptr) {
142 unsigned int collBegin(0);
145 unsigned int idLast(0);
147 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
158 coll->setIdentifier(collID);
159 unsigned int nchans = pcoll.
m_size;
160 coll->resize(nchans);
170 std::vector<Identifier> rdoList(1);
184 collBegin += pcoll.
m_size;
187 StatusCode sc = transCont->addCollection(coll, collIDHash);
188 if (
sc.isFailure()) {
189 throw std::runtime_error(
"Failed to add collection to ID Container");
203 if (this->
initialize(log) != StatusCode::SUCCESS) {
208 std::unique_ptr<InDet::TRT_DriftCircleContainer> trans(std::make_unique<InDet::TRT_DriftCircleContainer>(
m_trtId->
straw_layer_hash_max()));
210 return(trans.release());
221 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
229 return StatusCode::SUCCESS;
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
std::vector< InDet::TRT_DriftCircle_p2 > m_rawdata
virtual void transToPers(const InDet::TRT_DriftCircleContainer *transCont, InDet::TRT_DriftCircleContainer_p2 *persCont, MsgStream &log)
void setIdHelper(const TRT_ID *trt_id)
size_type straw_layer_hash_max(void) const
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
StatusCode initialize(MsgStream &log)
value_type get_compact() const
Get the compact id.
virtual void persToTrans(const InDet::TRT_DriftCircleContainer_p2 *persCont, InDet::TRT_DriftCircleContainer *transCont, MsgStream &log)
std::vector< unsigned short > m_prdDeltaId
void transToPers(const InDet::TRT_DriftCircle *transObj, InDet::TRT_DriftCircle_p2 *persObj, MsgStream &log)
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleContKey
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual InDet::TRT_DriftCircleContainer * createTransient(const InDet::TRT_DriftCircleContainer_p2 *persObj, MsgStream &log)
void setUseDetectorElement(const bool useDetectorElement)
Trk::PrepRawDataContainer< TRT_DriftCircleCollection > TRT_DriftCircleContainer
Helpers for checking error return status codes and reporting errors.
Trk::PrepRawDataCollection< TRT_DriftCircle > TRT_DriftCircleCollection
StatusCode initialize(bool used=true)
const TRT_BaseElement * getDetectorElement(const IdentifierHash &hash) const
bool m_useDetectorElement
Class to hold collection of TRT detector elements.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
InDet::TRT_DriftCircle createTRT_DriftCircle(const InDet::TRT_DriftCircle_p2 *persObj, Identifier clusId, std::vector< Identifier > &&rdoList, const InDetDD::TRT_BaseElement *detEl, MsgStream &log)
std::vector< InDet::InDetPRD_Collection_p2 > m_collections