26#include "CaloEvent/CaloTowerContainer.h"
27#include "CaloEvent/CaloTower.h"
30#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
59#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
63 m_towerSeg (other.m_towerSeg),
64 m_caloRegions (other.m_caloRegions)
70 Base(other.m_towers.
size(),
SG::VIEW_ELEMENTS),
73 m_towers (other.m_towers)
85#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
88 m_towers = other.m_towers;
101#ifndef CALOTOWERCONTAINER_USES_DATAPOOL
102 m_towers.swap (other.m_towers);
113#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
116 this->m_towers.resize (etaBins * phiBins);
123 double minEta =
m_towerSeg.etamin() + deltaEta / 2.;
127#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
133 for (
index_t etaIndex = 1; etaIndex <= etaBins; ++etaIndex) {
134 double theEta = minEta + (etaIndex-1) * deltaEta;
135 for (
index_t phiIndex = 1; phiIndex <= phiBins; ++phiIndex) {
138#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
152#ifndef CALOTOWERCONTAINER_USES_DATAPOOL
153void CaloTowerContainer::setTowers()
158 for (
size_t i = 0; i < m_towers.size(); i++)
159 Base::operator[](i) = &m_towers[i];
171 unsigned int intCalo = theCalo ;
183 std::vector<unsigned int>::size_type i;
188 return theCalos.size();
205 return t ? t->e() : 0;
211 return t ? t->e() : 0;
218 return t ? t->et() : 0;
226 return t ? t->et() : 0;
239 return aTower !=
nullptr
259#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
262 ? &m_towers[theIndex]
270#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
273 ? &m_towers[theIndex]
299 throw std::runtime_error (
"Bad call to CaloTowerContainer::clear");
310 throw std::runtime_error (
"Bad call to CaloTowerContainer::insert");
312 Base::insert (position.base(), first.base(), last.base());
320 throw std::runtime_error (
"Bad call to CaloTowerContainer::push_back");
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
CaloCell_Base_ID::SUBCALO SUBCALO
void removeCells()
Remove all cells without kinematic update.
static double fix(double phi)
Iterator class for which the reference type is not an lvalue.
Storable container class for CaloTower.
DataVector< CaloTower > Base
double et(double theEta, double thePhi) const
Return the tower transverse energy at a given grid position.
CaloTowerContainer()
Default constructor.
index_t getTowerIndex(const CaloTower *aTower) const
Returns the combined index of a tower on the grid.
CaloTowerContainer & operator=(const CaloTowerContainer &other)
Assignment.
double energy(double theEta, double thePhi) const
Return the tower energy at a given grid position.
CaloTower * getTower(index_t eta, index_t phi)
Returns a pointer to a tower with given indices.
CaloTowerSeg m_towerSeg
Tower grid descriptor.
void setCalo(const CaloCell_ID::SUBCALO &nCalo)
Adds a calorimeter index to the tower.
size_t getCalos(std::vector< CaloCell_ID::SUBCALO > &theCalos) const
Retrieve the list of used calorimeters.
static const index_t m_outOfRange
Index overflow indicator.
void init()
Initializes the CaloTowerContainer.
index_t getTowerEtaIndex(const CaloTower *aTower) const
Returns the index for a given tower.
std::vector< unsigned int > m_caloRegions
Vector of calorimeter regions contributing to the tower signals.
virtual ~CaloTowerContainer()
Destructor.
size_t index_t
Tower map index type.
void swap(CaloTowerContainer &other)
Swap.
index_t getTowerPhiIndex(const CaloTower *aTower) const
Returns the index for a given tower.
void insert(iterator position, iterator first, iterator last)
void push_back(value_type pElem)
bool getTowerIndices(const CaloTower *aTower, index_t &indexEta, index_t &indexPhi) const
Returns both and indices for a given tower.
Data object stores CaloTower segmentation.
index_t nphi() const
Retrieve number of bins.
index_t neta() const
Retrieve number of bins.
Data class for calorimeter cell towers.
virtual double phi() const override final
get phi data member
virtual double eta() const override final
get eta data member
a typed memory pool that saves time spent allocation small object.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
void resize(size_type sz)
const CaloTower * operator[](size_type n) const
void swap(DataVector &rhs)
value_type push_back(value_type pElem)
iterator insert(iterator position, value_type pElem)
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
SG::OwnershipPolicy ownPolicy() const
size_type size() const noexcept
DataVector & operator=(const DataVector &rhs)
virtual void setEta(double theEta)
set eta data member
virtual void setE(double theE)
set energy data member
virtual void setPhi(double thePhi)
set phi data member
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)