|
ATLAS Offline Software
|
Go to the documentation of this file.
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"
46 TRANS::const_iterator it_Coll = transCont->begin();
47 TRANS::const_iterator it_CollEnd = transCont->end();
48 unsigned int collIndex;
49 unsigned int chanBegin = 0;
50 unsigned int chanEnd = 0;
51 persCont->
m_collections.resize(transCont->numberOfCollections());
53 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
57 chanEnd += collection.size();
59 pcollection.
m_id = collection.identify().get_compact();
60 pcollection.
m_hashId = (
unsigned int) collection.identifyHash();
61 pcollection.
m_begin = chanBegin;
62 pcollection.
m_end = chanEnd;
64 persCont->
m_PRD.resize(chanEnd);
65 for (
unsigned int i = 0;
i < collection.size(); ++
i) {
93 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
104 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
113 coll->resize(nchans);
123 log << MSG::WARNING <<
"Cast to InDet::PixelCluster* failed in PixelClusterContainerCnv_p1" <<
endmsg;
128 StatusCode sc = transCont->addCollection(coll, collIDHash);
129 if (
sc.isFailure()) {
130 throw std::runtime_error(
"Failed to add collection to ID Container");
143 if (this->
initialize(log) != StatusCode::SUCCESS) {
149 log <<
MSG::FATAL <<
"PixelID helper is null in PixelClusterContainerCnv_p1::createTransient" <<
endmsg;
152 std::unique_ptr<InDet::PixelClusterContainer> trans(std::make_unique<InDet::PixelClusterContainer>(
m_pixId->
wafer_hash_max()));
154 return(trans.release());
165 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
173 return StatusCode::SUCCESS;
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
std::vector< TPObjRef > m_PRD
InDet::PixelClusterContainer TRANS
virtual InDet::PixelClusterContainer * createTransient(const InDet::InDetPRD_Container_p1 *persObj, MsgStream &log)
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
ServiceHandle< StoreGateSvc > m_storeGate
std::vector< InDet::InDetPRD_Collection_p1 > m_collections
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
StatusCode initialize(MsgStream &log)
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(bool used=true)
size_type wafer_hash_max(void) const
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
bool m_useDetectorElement
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
void setUseDetectorElement(const bool useDetectorElement)
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...