34 return StatusCode::SUCCESS;
45 CHECK(h_eventInfo.isValid());
49 CHECK(h_gepCellsMap.isValid());
50 auto gepCellsMap = *h_gepCellsMap;
52 ATH_MSG_DEBUG(
"Read in " << gepCellsMap.size() <<
" GEP cells");
57 CHECK(h_outputCaloClusters.
record(std::make_unique<xAOD::CaloClusterContainer>(),
58 std::make_unique<xAOD::CaloClusterAuxContainer>()));
61 std::unique_ptr<Gep::IClusterMaker> clusterMaker{};
74 return StatusCode::FAILURE;
77 ATH_MSG_DEBUG(
"Running " << clusterMaker->getName() <<
" cluster algorithm." );
80 auto pCellMap = gepCellsMap.getCellMap();
81 std::vector<Gep::Cluster> customClusters = clusterMaker->makeClusters(pCellMap);
85 if (!customClusters.empty()){
90 h_outputCaloClusters->
reserve(customClusters.size());
92 for(
const auto& gepclus: customClusters){
95 auto caloCluster = std::make_unique<xAOD::CaloCluster>();
96 auto *
ptr = caloCluster.get();
99 h_outputCaloClusters->
push_back(std::move(caloCluster));
103 ptr->setE(gepclus.vec.E());
104 ptr->setEta(gepclus.vec.Eta());
105 ptr->setPhi(gepclus.vec.Phi());
106 ptr->setTime(gepclus.time);
110 for (
auto cell_id : gepclus.cell_id)
111 cccl->
addCell(pCellMap->at(cell_id).index, 1.0);
113 ptr->addCellLink(std::make_unique<CaloClusterCellLink>(*cccl));
117 return StatusCode::SUCCESS;