|
ATLAS Offline Software
|
Go to the documentation of this file.
36 return StatusCode::SUCCESS;
49 CHECK(h_eventInfo.isValid());
56 CHECK(h_caloCells.isValid());
57 auto cells = *h_caloCells;
62 CHECK(h_outputCaloClusters.
record(std::make_unique<xAOD::CaloClusterContainer>(),
63 std::make_unique<xAOD::CaloClusterAuxContainer>()));
68 std::unique_ptr<Gep::IClusterMaker> clusterMaker{};
77 return StatusCode::FAILURE;
80 ATH_MSG_DEBUG(
"Running " << clusterMaker->getName() <<
" cluster algorithm." );
84 auto cell_map = std::make_unique<GepCellMap>();
88 std::vector<Gep::Cluster> customClusters =
89 clusterMaker->makeClusters(cell_map);
93 if (!customClusters.empty()){
99 h_outputCaloClusters->
reserve(customClusters.size());
101 for(
const auto& gepclus: customClusters){
104 auto caloCluster = std::make_unique<xAOD::CaloCluster>();
105 auto *
ptr = caloCluster.get();
108 h_outputCaloClusters->
push_back(std::move(caloCluster));
112 ptr->setE(gepclus.vec.E());
113 ptr->setEta(gepclus.vec.Eta());
114 ptr->setPhi(gepclus.vec.Phi());
115 ptr->setTime(gepclus.time);
118 for (
auto cell_id : gepclus.cell_id)
119 cccl->
addCell(cell_map->at(cell_id).index, 1.0);
121 ptr->addCellLink(cccl);
125 return StatusCode::SUCCESS;
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
GepClusteringAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< CaloCellsHandlerTool > m_caloCellsTool
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::vector< size_t > vec
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputCaloClustersKey
Definition of CaloDetDescrManager.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_clusterAlg
::StatusCode StatusCode
StatusCode definition for legacy code.
bool addCell(const unsigned cellIdx, const weight_t weight=1.0)
Method to add a cell to the cluster.
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
virtual StatusCode execute(const EventContext &) const override
std::string to_string(const DetectorType &type)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.