ATLAS Offline Software
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 
8 #include "CaloEvent/CaloCell.h"
9 #include "CaloEvent/CaloClusterContainer.h"
10 
11 
12 #include "StoreGate/StoreGateSvc.h"
13 
14 
15 //###############################################################################
17  ISvcLocator* pSvcLocator)
18  : AthAlgorithm(name, pSvcLocator)
19 {
20  declareProperty("ClusterContainerNames",m_clusterContainerNames);
21 }
22 
23 //###############################################################################
24 
26 { }
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 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloClusterNavTest::m_clusterContainerNames
std::vector< std::string > m_clusterContainerNames
Definition: CaloClusterNavTest.h:23
CaloClusterContainer
Storable container for CaloCluster.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h:37
CaloClusterNavTest.h
CaloClusterNavTest::finalize
virtual StatusCode finalize()
Definition: CaloClusterNavTest.cxx:38
skel.it
it
Definition: skel.GENtoEVGEN.py:423
CaloCell.h
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CaloCluster::cell_iterator
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:115
CaloClusterNavTest::~CaloClusterNavTest
virtual ~CaloClusterNavTest()
Definition: CaloClusterNavTest.cxx:25
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloClusterNavTest::CaloClusterNavTest
CaloClusterNavTest(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CaloClusterNavTest.cxx:16
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloCellContainer.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
CaloClusterNavTest::initialize
virtual StatusCode initialize()
Definition: CaloClusterNavTest.cxx:30
CaloClusterNavTest::execute
virtual StatusCode execute()
Definition: CaloClusterNavTest.cxx:45
StoreGateSvc.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.