7#ifndef CALOEVENT_CALOTOWERCONTAINER_H
8#define CALOEVENT_CALOTOWERCONTAINER_H
58#define CALOTOWERCONTAINER_USES_DATAPOOL
66#include "CaloEvent/CaloTower.h"
71#include "boost/iterator/iterator_adaptor.hpp"
151 size_t getCalos(std::vector<CaloCell_ID::SUBCALO>& theCalos)
const;
182 double et(
double theEta,
double thePhi)
const;
195 double et(
int etaIndex,
int phiIndex)
const
205 double e(
double theEta,
double thePhi)
const
206 {
return this->
energy(theEta,thePhi); }
215 {
return this->
energy(etaIndex,phiIndex); }
220 double e(
int etaIndex,
int phiIndex)
const
221 {
return this->
energy(etaIndex,phiIndex); }
230 double energy(
double theEta,
double thePhi)
const;
243 double energy(
int etaIndex,
int phiIndex)
const
405 return theIndex < this->
size()
406 ? (this->operator[])(theIndex)
415 return theIndex < this->
size()
416 ? (this->operator[])(theIndex)
437 using Base::operator[];
460 :
public boost::iterator_adaptor<iterator,
463 Base::iterator::iterator_category,
469 typedef boost::iterator_adaptor<
iterator,
472 Base::iterator::iterator_category,
522#ifndef CALOTOWERCONTAINER_USES_DATAPOOL
524 std::vector<CaloTower> m_towers;
535 template <
class InputIterator>
536 void assign(InputIterator first, InputIterator last);
538 template <
class InputIterator>
543 template <
class COMPARE>
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define SG_BASE(D, B)
Declare that class D derives from class B.
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
CaloCell_Base_ID::SUBCALO SUBCALO
Iterator class for which the reference type is not an lvalue.
boost::iterator_adaptor< iterator, Base::iterator, Base::value_type, Base::iterator::iterator_category, Base::value_type > iterator_adaptor_
iterator(Base::iterator it)
Storable container class for CaloTower.
double e(double theEta, double thePhi) const
Return the tower energy at a given grid position.
DataVector< CaloTower > Base
double et(double theEta, double thePhi) const
Return the tower transverse energy at a given grid position.
double et(int etaIndex, int phiIndex) const
Return the tower transverse energy at a given grid position.
CaloTowerContainer()
Default constructor.
CaloTower * at(size_type n)
const CaloTower * getTower(index_t theIndex) const
Returns a const pointer to a tower with a given combined index.
size_t nphi() const
Return number of bins.
size_t getNumberOfCalos() const
Returns the number of included calorimeters.
void assign(InputIterator first, InputIterator last)
double deta() const
Return bin size .
double e(index_t etaIndex, index_t phiIndex) const
Return the tower energy at a given grid position.
double dphi() const
Return bin size .
void resize(size_type sz)
index_t getTowerIndex(const CaloTower *aTower) const
Returns the combined index of a tower on the grid.
void swapElement(size_type index, value_type newElem, reference oldElem)
CaloTowerContainer & operator=(const CaloTowerContainer &other)
Assignment.
void insert(iterator position, InputIterator first, InputIterator last)
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.
const CaloTower * getTower(int eta, int phi) const
Returns a const pointer to a tower with given indices.
CaloTower * getTower(int eta, int phi)
Returns a pointer to a tower with given indices.
bool isOutOfRange(index_t anIndex) const
Checks if an index is out of range.
double phimin() const
Return lower value range boundary.
CaloTower * getTower(index_t theIndex)
Returns a pointer to a tower with a given combined index.
CaloTowerSeg m_towerSeg
Tower grid descriptor.
size_t neta() const
Return number of bins.
reverse_iterator rbegin()
double etamin() const
Return lower value range boundary.
void setCalo(const CaloCell_ID::SUBCALO &nCalo)
Adds a calorimeter index to the tower.
iterator erase(iterator position)
size_t getCalos(std::vector< CaloCell_ID::SUBCALO > &theCalos) const
Retrieve the list of used calorimeters.
iterator insert(iterator position, value_type pElem)
double energy(int etaIndex, int phiIndex) const
Return the tower energy at a given grid position.
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.
friend class CaloTowerContainerCnv_p1
std::vector< unsigned int > m_caloRegions
Vector of calorimeter regions contributing to the tower signals.
virtual ~CaloTowerContainer()
Destructor.
double e(int etaIndex, int phiIndex) const
Return the tower energy at a given grid position.
size_t index_t
Tower map index type.
CaloTower * operator[](size_type n)
void reserve(size_type n)
index_t flagOutOfRange() const
Returns the index out-of-range indicator.
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)
iterator erase(iterator first, iterator last)
void push_back(value_type pElem)
std::reverse_iterator< iterator > reverse_iterator
bool getTowerIndices(const CaloTower *aTower, index_t &indexEta, index_t &indexPhi) const
Returns both and indices for a given tower.
const CaloTowerSeg & towerseg() const
Return a copy of the attached CaloTowerSeg.
Data object stores CaloTower segmentation.
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
DataModel_detail::const_iterator< DataVector > const_iterator
const CaloTower * operator[](size_type n) const
const CaloTower * back() const
typename DataVectorBase< CaloTower >::Base::size_type size_type
const_reverse_iterator rend() const noexcept
const CaloTower * at(size_type n) const
DataModel_detail::iterator< DataVector > iterator
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
const_iterator end() const noexcept
const_reverse_iterator rbegin() const noexcept
const_iterator begin() const noexcept
const CaloTower * front() const
size_type size() const noexcept