Commit b191d921 authored by Tadej Novak's avatar Tadej Novak
Browse files

Merge branch 'set_detelem_in_hgtd_converters_21p9' into '21.9'

Setting of the HGTD_DetectorElement during P to T conversion

See merge request !46074
parents 86a1fe4f ea4e8d94
......@@ -28,7 +28,7 @@ class HGTD_ClusterContainerCnv_p1
: public T_AthenaPoolTPCnvBase<HGTD::HGTD_ClusterContainer,
HGTD::HGTD_ClusterContainer_p1> {
public:
HGTD_ClusterContainerCnv_p1() : m_is_initialized(false){};
HGTD_ClusterContainerCnv_p1() : m_is_initialized(false) {}
typedef HGTD::HGTD_ClusterContainer_p1 Pers_t;
typedef HGTD::HGTD_ClusterContainer Trans_t;
......@@ -45,6 +45,7 @@ private:
StatusCode initialize(MsgStream& log);
const HGTD_ID* m_hgtd_idhelper;
const HGTD_DetectorManager* m_hgtd_det_mgr;
bool m_is_initialized;
};
......
......@@ -30,7 +30,6 @@ StatusCode HGTD::HGTD_ClusterContainerCnv_p1::initialize(MsgStream& log) {
// Get Storegate, ID helpers, and so on
ISvcLocator* svcLocator = Gaudi::svcLocator();
StoreGateSvc* detStore;
// get StoreGate service
StatusCode sc = svcLocator->service("StoreGateSvc", detStore);
......@@ -51,6 +50,12 @@ StatusCode HGTD::HGTD_ClusterContainerCnv_p1::initialize(MsgStream& log) {
return StatusCode::FAILURE;
}
sc = detStore->retrieve(m_hgtd_det_mgr, "HGTD");
if (sc.isFailure()) {
log << MSG::FATAL << "Could not get HGTD_DetectorManager!" << endreq;
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
......@@ -154,6 +159,9 @@ void HGTD::HGTD_ClusterContainerCnv_p1::persToTrans(
IdentifierHash coll_idhash = IdentifierHash(prd_coll.m_hash_id);
Identifier coll_id = m_hgtd_idhelper->wafer_id(coll_idhash);
InDetDD::HGTD_DetectorElement* det_elem =
m_hgtd_det_mgr->getDetectorElement(coll_idhash);
collection = new HGTD::HGTD_ClusterCollection(coll_idhash);
collection->setIdentifier(coll_id);
......@@ -167,7 +175,7 @@ void HGTD::HGTD_ClusterContainerCnv_p1::persToTrans(
// NOTE the cluster is created without setting the detector element!
// NOTE if this is needed down the road, it has to be added here!
HGTD::HGTD_Cluster* trans_cluster = new HGTD::HGTD_Cluster(
cluster_converter.createHGTDCluster(pers_cluster, nullptr, log));
cluster_converter.createHGTDCluster(pers_cluster, det_elem, log));
trans_cluster->setHashAndIndex(coll_idhash, clus_i);
(*collection).at(clus_i) = trans_cluster;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment