|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "Identifier/Identifier.h"
21 #include "GaudiKernel/Bootstrap.h"
22 #include "GaudiKernel/ISvcLocator.h"
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/Service.h"
25 #include "GaudiKernel/StatusCode.h"
48 unsigned int idLast(0);
53 if (this->
initialize(log) != StatusCode::SUCCESS) {
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;
64 persCont->
m_collections.resize(transCont->numberOfCollections());
66 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
70 chanEnd += collection.size();
72 unsigned int deltaId = (collection.identifyHash()-idLast);
82 idLast=collection.identifyHash();
83 pcollection.
m_size = collection.size();
87 for (
unsigned int i = 0;
i < collection.size(); ++
i) {
117 elements = pixelDetEleHandle1.
cptr();
123 elements = pixelDetEleHandle2.
cptr();
125 log <<
MSG::FATAL <<
"No valid Pixel detector element collection keys available." <<
endmsg;
135 unsigned int collBegin(0);
138 unsigned int idLast(0);
140 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
151 unsigned int nchans = pcoll.
m_size;
152 coll->resize(nchans);
166 chan->setHashAndIndex(collIDHash,
ichan);
169 collBegin += pcoll.
m_size;
172 StatusCode sc = transCont->addCollection(coll, collIDHash);
173 if (
sc.isFailure()) {
174 throw std::runtime_error(
"Failed to add collection to ID Container");
190 if (this->
initialize(log) != StatusCode::SUCCESS) {
195 log <<
MSG::FATAL <<
"nullptr for m_pixId in PixelClusterContainerCnv_p3::createTransient" <<
endmsg;
198 std::unique_ptr<InDet::PixelClusterContainer> trans(std::make_unique<InDet::PixelClusterContainer>(
m_pixId->
wafer_hash_max()));
200 return(trans.release());
209 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
218 return StatusCode::SUCCESS;
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
std::vector< InDet::InDetPRD_Collection_p2 > m_collections
void transToPers(const InDet::PixelCluster *, InDet::PixelCluster_p3 *, MsgStream &)
virtual void persToTrans(const InDet::PixelClusterContainer_p3 *persCont, InDet::PixelClusterContainer *transCont, MsgStream &log)
InDet::PixelCluster createPixelCluster(const InDet::PixelCluster_p3 *persObj, const Identifier &waferId, const InDetDD::SiDetectorElement *delEl, MsgStream &log)
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
std::vector< InDet::PixelCluster_p3 > m_rawdata
Exception — Can't retrieve CondCont from ReadCondHandle.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(MsgStream &log)
#define CHECK(...)
Evaluate an expression and check for errors.
bool m_useDetectorElement
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 InDet::PixelClusterContainer * createTransient(const InDet::PixelClusterContainer_p3 *persObj, MsgStream &log)
virtual void transToPers(const InDet::PixelClusterContainer *transCont, InDet::PixelClusterContainer_p3 *persCont, MsgStream &log)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelITkEleCollKey
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
void setUseDetectorElement(const bool useDetectorElement)
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
const_pointer_type cptr()