 |
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "GaudiKernel/EventContext.h"
39 return StatusCode::SUCCESS;
50 CHECK(h_eventInfo.isValid());
55 CHECK(h_caloClusters.isValid());
56 ATH_MSG_DEBUG(
"Read in " << h_caloClusters->size() <<
" clusters");
59 CHECK(h_caloCells.isValid());
64 CHECK(h_outputCaloClusters.
record(std::make_unique<xAOD::CaloClusterContainer>(),
65 std::make_unique<xAOD::CaloClusterAuxContainer>()));
68 std::unique_ptr<Gep::ITowerMaker> towerMaker{};
79 return StatusCode::FAILURE;
82 ATH_MSG_DEBUG(
"Running " << towerMaker->getName() <<
" tower algorithm." );
87 std::vector<Gep::Cluster> customTowers = towerMaker->makeTowers(
clusters,
cells);
91 if (!customTowers.empty()){
96 h_outputCaloClusters->
reserve(customTowers.size());
98 for(
const auto& gepclus: customTowers){
101 auto *
ptr = h_outputCaloClusters->
push_back(std::make_unique<xAOD::CaloCluster>());
104 ptr->setE(gepclus.vec.E());
105 ptr->setEta(gepclus.vec.Eta());
106 ptr->setPhi(gepclus.vec.Phi());
107 ptr->setTime(gepclus.time);
110 return StatusCode::SUCCESS;
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClustersKey
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputCaloClustersKey
GepTowersAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
std::vector< size_t > vec
virtual StatusCode initialize() override
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())
virtual StatusCode execute(const EventContext &) const override
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::string > m_towerAlg
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< Gep::GepCellMap > m_gepCellsKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Container class for CaloCell.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.