|
ATLAS Offline Software
|
Go to the documentation of this file.
36 #include "CaloEvent/CaloClusterContainer.h"
43 ISvcLocator* pSvcLocator)
64 return StatusCode::SUCCESS;
71 return StatusCode::SUCCESS;
90 cell2ClusterMap->
resize(maxRange);
96 <<
" contains " << clusColl->
size() <<
" clusters");
98 std::vector<double> weightedESum;
99 weightedESum.resize(clusColl->
size());
101 std::vector<int> numberOfCells;
102 numberOfCells.resize(clusColl->
size());
108 unsigned int iClus = 0;
113 for (; cellIter != cellIterEnd; cellIter++) {
123 (*cell2ClusterMap)[myHashId] = theNav;
130 weightedESum[iClus] += (clus->getCellWeight(*cellIter))
131 * ((*cellIter)->energy());
132 numberOfCells[iClus]++;
139 double epsilon = 0.001;
140 unsigned int iClus = 0;
142 if (fabs(weightedESum[iClus] - clus->e())
143 > epsilon * fabs(clus->e()))
147 <<
" MeV, while weighted sum of cells gives E = "
148 << weightedESum[iClus]
149 <<
" MeV! Complain with the creator of the CaloClusterContainer named "
152 ATH_MSG_DEBUG(
"CaloCluster and weighted sum of cell members have E = "
153 << clus->e() <<
" MeV, good!" );
155 if (numberOfCells[iClus] !=
static_cast<int>(clus->getNumberOfCells())) {
158 << clus->getNumberOfCells() <<
" cells, while N = "
159 << numberOfCells[iClus]
160 <<
" cells are in the map! Something is wrong with the creation of the Map!" );
163 << clus->getNumberOfCells() <<
" cells is in the map, good!" );
170 for (
unsigned int iHash = 0; iHash < maxRange; iHash++) {
174 msg(
MSG::VERBOSE) <<
"CaloCell with hashID " << iHash <<
" belongs to";
179 *(pClus->cell_begin()));
186 for (; cellIter != cellIterEnd; cellIter++) {
190 if (((
unsigned int) myHashId) == iHash)
197 msg() <<
" Cluster with E_clus = " << pClus->e()
198 <<
" MeV with weight w_cell = " << pClus->getCellWeight(pCell)
206 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
void putElement(const CONT *objectContainer, const constituent_type *constituentObject, const RPAR &objectParameter=RPAR(), size_t sizeHint=0)
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::string & name() const
Return the StoreGate ID for the referenced object.
SG::ReadHandleKey< CaloClusterContainer > m_clusterKey
Name of the CaloClusterContainer to use.
bool msgLvl(const MSG::Level lvl) const
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::WriteHandleKey< CaloCell2ClusterMap > m_mapOutputKey
Name of the CaloCell2ClusterMap in StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode finalize() override
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
::StatusCode StatusCode
StatusCode definition for legacy code.
Principal data class for CaloCell clusters.
Helper class for offline cell identifiers.
virtual ~CaloCell2ClusterMapper()
virtual StatusCode initialize() override
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
void resize(size_type sz)
Resizes the collection to the specified number of elements.
Helpers for checking error return status codes and reporting errors.
CaloCell2ClusterMapper(const std::string &name, ISvcLocator *pSvcLocator)
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Container class for CaloCell.
Navigable template generalization to handle navigation.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
virtual StatusCode execute(const EventContext &ctx) const override
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
unsigned long long size_type
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
size_type size() const noexcept
Returns the number of elements in the collection.
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size