ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterNavTest.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9#include "CaloEvent/CaloClusterContainer.h"
10
11
13
14
15//###############################################################################
17 ISvcLocator* pSvcLocator)
18 : AthAlgorithm(name, pSvcLocator)
19{
20 declareProperty("ClusterContainerNames",m_clusterContainerNames);
21}
22
23//###############################################################################
24
27
28//###############################################################################
29
31{
32 ATH_MSG_DEBUG ( " initialized " );
33 return StatusCode::SUCCESS;
34}
35
36//###############################################################################
37
39{
40 return StatusCode::SUCCESS;
41}
42
43//###############################################################################
44
46
47 std::vector<std::string>::const_iterator it =
49 std::vector<std::string>::const_iterator it_e =
51
52 for (; it!=it_e;++it)
53 {
54
55 const std::string & clusterName = *it;
56 const CaloClusterContainer * clusterColl ;
57 ATH_CHECK( evtStore()->retrieve(clusterColl,clusterName) );
58
59 //Got ClusterContainer, loop over clusters;
60 CaloClusterContainer::const_iterator it_cluster=clusterColl->begin();
61 CaloClusterContainer::const_iterator it_cluster_e=clusterColl->end();
62 unsigned clusterCounter=0;
63 for(;it_cluster!=it_cluster_e;++it_cluster) {
64
65 CaloCluster::cell_iterator it_cell=(*it_cluster)->cell_begin();
66 CaloCluster::cell_iterator it_cell_e=(*it_cluster)->cell_end();
67 for(;it_cell!=it_cell_e;++it_cell) {
68 double weight = it_cell.getParameter();
69 Identifier id=(*it_cell)->ID();
70 std::cout << "NavTest: " << clusterName << "[" << clusterCounter << "]: Cell "
71 << id.get_compact() <<", Weight:" << weight << std::endl;
72 }
73 clusterCounter++;
74 }
75
76 }
77
78 return StatusCode::SUCCESS;
79}
80
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
CaloClusterNavTest(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize()
virtual StatusCode finalize()
virtual StatusCode execute()
std::vector< std::string > m_clusterContainerNames
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
RPAR getParameter() const