|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "Identifier/Identifier.h"
19 #include "GaudiKernel/Bootstrap.h"
20 #include "GaudiKernel/ISvcLocator.h"
21 #include "GaudiKernel/MsgStream.h"
22 #include "GaudiKernel/Service.h"
23 #include "GaudiKernel/StatusCode.h"
46 unsigned int idLast(0);
50 TRANS::const_iterator it_Coll = transCont->begin();
51 TRANS::const_iterator it_CollEnd = transCont->end();
52 unsigned int collIndex;
53 unsigned int chanBegin = 0;
54 unsigned int chanEnd = 0;
58 if (this->
initialize(log) != StatusCode::SUCCESS) {
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) {
132 elements = *sctDetEleHandle;
133 if (not sctDetEleHandle.
isValid() or elements==
nullptr) {
143 unsigned int collBegin(0);
146 unsigned int idLast(0);
148 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
159 unsigned int nchans = pcoll.
m_size;
160 coll->resize(nchans);
177 collBegin += pcoll.
m_size;
180 StatusCode sc = transCont->addCollection(coll, collIDHash);
181 if (
sc.isFailure()) {
182 throw std::runtime_error(
"Failed to add collection to ID Container");
198 if (this->
initialize(log) != StatusCode::SUCCESS) {
202 std::unique_ptr<InDet::SCT_ClusterContainer> trans(std::make_unique<InDet::SCT_ClusterContainer>(
m_sctId->
wafer_hash_max()));
204 return(trans.release());
213 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
221 return StatusCode::SUCCESS;
StatusCode initialize(MsgStream &log)
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
void setIdHelper(const SCT_ID *sct_id)
virtual void persToTrans(const InDet::SCT_ClusterContainer_p2 *persCont, InDet::SCT_ClusterContainer *transCont, MsgStream &log)
virtual void transToPers(const InDet::SCT_ClusterContainer *transCont, InDet::SCT_ClusterContainer_p2 *persCont, MsgStream &log)
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
std::vector< InDet::InDetPRD_Collection_p2 > m_collections
bool m_useDetectorElement
Identifier::diff_type calc_offset(const Identifier &base, const Identifier &target) const
Calculate a channel offset between the two identifiers.
void transToPers(const InDet::SCT_Cluster *, InDet::SCT_Cluster_p2 *, MsgStream &)
InDet::SCT_Cluster createSCT_Cluster(const InDet::SCT_Cluster_p2 *persObj, Identifier clusId, const InDetDD::SiDetectorElement *detEl, MsgStream &log)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< Identifier::diff_type > m_prdDeltaId
#define CHECK(...)
Evaluate an expression and check for errors.
size_type wafer_hash_max(void) const
Helpers for checking error return status codes and reporting errors.
std::vector< InDet::SCT_Cluster_p2 > m_rawdata
StatusCode initialize(bool used=true)
virtual InDet::SCT_ClusterContainer * createTransient(const InDet::SCT_ClusterContainer_p2 *persObj, MsgStream &log)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Trk::PrepRawDataCollection< SCT_Cluster > SCT_ClusterCollection
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
void setUseDetectorElement(const bool useDetectorElement)
Identifier strip_id_offset(const Identifier &base, Identifier::diff_type offset) const
Create an identifier with a given base and channel offset.