|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "Identifier/Identifier.h"
20 #include "GaudiKernel/ISvcLocator.h"
21 #include "GaudiKernel/Bootstrap.h"
22 #include "GaudiKernel/StatusCode.h"
23 #include "GaudiKernel/Service.h"
24 #include "GaudiKernel/MsgStream.h"
47 unsigned int idLast(0);
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());
58 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
62 chanEnd += collection.size();
64 unsigned int deltaId = (collection.identifyHash()-idLast);
74 idLast=collection.identifyHash();
75 pcollection.
m_size = collection.size();
79 for (
unsigned int i = 0;
i < collection.size(); ++
i) {
108 elements = *pixelDetEleHandle;
109 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
118 unsigned int collBegin(0);
121 unsigned int idLast(0);
123 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
134 unsigned int nchans = pcoll.
m_size;
135 coll->resize(nchans);
145 chan->setDetectorElement(de);
147 chan->setHashAndIndex(collIDHash,
ichan);
150 collBegin += pcoll.
m_size;
153 StatusCode sc = transCont->addCollection(coll, collIDHash);
154 if (
sc.isFailure()) {
155 throw std::runtime_error(
"Failed to add collection to ID Container");
170 if (this->
initialize(log) != StatusCode::SUCCESS) {
175 log <<
MSG::FATAL <<
"nullptr for m_pixId in PixelClusterContainerCnv_p2::createTransient" <<
endmsg;
178 std::unique_ptr<InDet::PixelClusterContainer> trans(std::make_unique<InDet::PixelClusterContainer>(
m_pixId->
wafer_hash_max()));
180 return(trans.release());
189 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
197 return StatusCode::SUCCESS;
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
void transToPers(const InDet::PixelCluster *, InDet::PixelCluster_p2 *, MsgStream &)
bool m_useDetectorElement
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
std::vector< InDet::InDetPRD_Collection_p2 > m_collections
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
virtual InDet::PixelClusterContainer * createTransient(const InDet::PixelClusterContainer_p2 *persObj, MsgStream &log)
virtual void transToPers(const InDet::PixelClusterContainer *transCont, InDet::PixelClusterContainer_p2 *persCont, MsgStream &log)
std::vector< InDet::PixelCluster_p2 > m_rawdata
void setUseDetectorElement(const bool useDetectorElement)
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
void persToTrans(const InDet::PixelCluster_p2 *, InDet::PixelCluster *, MsgStream &)
virtual void persToTrans(const InDet::PixelClusterContainer_p2 *persCont, InDet::PixelClusterContainer *transCont, MsgStream &log)
StatusCode initialize(MsgStream &log)
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(bool used=true)
size_type wafer_hash_max(void) const
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
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection