|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/ISvcLocator.h"
13 #include "GaudiKernel/MsgStream.h"
14 #include "GaudiKernel/StatusCode.h"
23 #include "Identifier/Identifier.h"
32 ISvcLocator* svcLocator = Gaudi::svcLocator();
35 SmartIF<StoreGateSvc>
detStore{svcLocator->service(
"DetectorStore")};
41 return StatusCode::SUCCESS;
45 const Trans_t* transient_container,
Pers_t* persistent_container,
64 if (this->
initialize(log) != StatusCode::SUCCESS) {
65 log <<
MSG::FATAL <<
"Could not initialize HGTD_ClusterContainerCnv_p1 "
71 size_t n_collections = transient_container->numberOfCollections();
72 Trans_t::const_iterator container_itr = transient_container->begin();
76 size_t collection_separator_index_begin = 0;
77 size_t total_n_clusters = 0;
79 for (
size_t coll_i = 0; coll_i < n_collections; coll_i++, ++container_itr) {
82 size_t collection_size = collection.
size();
91 total_n_clusters += collection_size;
99 for (
size_t clus_i = 0; clus_i < collection_size; clus_i++) {
103 .at(clus_i + collection_separator_index_begin));
111 collection_separator_index_begin += collection.
size();
116 <<
"Writing HGTD_ClusterContainer to HGTD_ClusterContainer_p1 done"
125 const Pers_t* persistent_container,
Trans_t* transient_container,
132 size_t collection_separator_index_begin = 0;
134 for (
size_t coll_i = 0;
147 unsigned short n_clusters = prd_coll.
m_size;
148 collection->
resize(n_clusters);
150 for (
unsigned short clus_i = 0; clus_i < n_clusters; ++clus_i) {
153 .at(clus_i + collection_separator_index_begin));
160 (*collection).at(clus_i) = trans_cluster;
162 collection_separator_index_begin += n_clusters;
164 StatusCode sc = transient_container->addCollection(collection, coll_idhash);
165 if (
sc.isFailure()) {
166 throw std::runtime_error(
"Failed to add collection to ID Container");
175 const Pers_t* persistent_container, MsgStream&
log) {
178 if (this->
initialize(log) != StatusCode::SUCCESS) {
179 log <<
MSG::FATAL <<
"Could not initialize HGTD_ClusterContainerCnv_p1 "
184 std::unique_ptr<Trans_t> transient_container =
187 persToTrans(persistent_container, transient_container.get(),
log);
189 return (transient_container.release());
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
unsigned int value() const
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
HGTD_Cluster createHGTDCluster(const HGTD_Cluster_p1 *pers_obj, const InDetDD::SolidStateDetectorElementBase *delEl, MsgStream &log)
const HGTD_ID * m_hgtd_idhelper
Identifier wafer_id(int endcap, int layer, int phi_module, int eta_module) const
For a single crystal.
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual IdentifierHash identifyHash() const override final
virtual Trans_t * createTransient(const Pers_t *persistent_container, MsgStream &log)
Trk::PrepRawDataCollection< HGTD_Cluster > HGTD_ClusterCollection
void transToPers(const HGTD_Cluster *, HGTD_Cluster_p1 *, MsgStream &)
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< HGTD_Cluster_p1 > m_cluster_list
size_type wafer_hash_max(void) const
void resize(size_type sz)
Resizes the collection to the specified number of elements.
Helpers for checking error return status codes and reporting errors.
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
StatusCode initialize(MsgStream &log)
const T * at(size_type n) const
Access an element, as an rvalue.
std::vector< HGTD_PRD_Collection_p1 > m_collection_separator
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
size_type size() const noexcept
Returns the number of elements in the collection.
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
virtual void persToTrans(const Pers_t *persistent_container, Trans_t *transient_container, MsgStream &log)
void setIdentifier(Identifier id)
virtual void transToPers(const Trans_t *transient_container, Pers_t *persistent_container, MsgStream &log)