#include <CaloRecHitMetaCollectionFast.h>
Public Types | |
typedef CaloRecHitMetaCollectionV::Iterator | const_iterator |
Public Member Functions | |
void | add (const CaloRecHit *hit) |
add an item to the collection | |
virtual const CaloRecHit * | at (const_iterator::offset_type i) const |
get an item by index | |
CaloRecHitMetaCollectionFast () | |
create an empty collection | |
CaloRecHitMetaCollectionFast (const CaloRecHitMetaCollectionFast &c) | |
copy constructor | |
virtual const_iterator | find (const DetId &id) const |
find by id (default version is very slow unsorted find) | |
virtual | ~CaloRecHitMetaCollectionFast () |
destructor | |
Private Member Functions | |
void | sort () const |
Private Attributes | |
bool | dirty_ |
std::vector< const CaloRecHit * > | hits_ |
Implementation of CaloRecHitMetaCollectionV which internally stores a vector of const CaloRecHit pointers. Fast for access and relatively fast to build, but uses more memory than CaloRecHitMetaCollectionCompact.
Appropriate class for subcollections produced by selection algorithms.
Definition at line 20 of file CaloRecHitMetaCollectionFast.h.
Reimplemented from CaloRecHitMetaCollectionV.
Definition at line 22 of file CaloRecHitMetaCollectionFast.h.
CaloRecHitMetaCollectionFast::CaloRecHitMetaCollectionFast | ( | ) |
create an empty collection
Definition at line 4 of file CaloRecHitMetaCollectionFast.cc.
References dirty_.
{ dirty_=false; }
CaloRecHitMetaCollectionFast::CaloRecHitMetaCollectionFast | ( | const CaloRecHitMetaCollectionFast & | c | ) |
copy constructor
virtual CaloRecHitMetaCollectionFast::~CaloRecHitMetaCollectionFast | ( | ) | [inline, virtual] |
void CaloRecHitMetaCollectionFast::add | ( | const CaloRecHit * | hit | ) |
add an item to the collection
Definition at line 8 of file CaloRecHitMetaCollectionFast.cc.
References dirty_, hits_, and CaloRecHitMetaCollectionV::size_.
Referenced by CaloConeSelector::select(), and CaloDualConeSelector::select().
const CaloRecHit * CaloRecHitMetaCollectionFast::at | ( | const_iterator::offset_type | i | ) | const [virtual] |
get an item by index
Implements CaloRecHitMetaCollectionV.
Definition at line 40 of file CaloRecHitMetaCollectionFast.cc.
References dirty_, hits_, CaloRecHitMetaCollectionV::size_, and sort().
CaloRecHitMetaCollectionV::const_iterator CaloRecHitMetaCollectionFast::find | ( | const DetId & | id | ) | const [virtual] |
find by id (default version is very slow unsorted find)
Reimplemented from CaloRecHitMetaCollectionV.
Definition at line 25 of file CaloRecHitMetaCollectionFast.cc.
References dirty_, CaloRecHitMetaCollectionV::end(), first, hits_, prof2calltree::last, and sort().
{ if (dirty_) sort(); CRHMCVComp comp; std::vector<const CaloRecHit*>::const_iterator last=hits_.end(); std::vector<const CaloRecHit*>::const_iterator first=hits_.begin(); std::vector<const CaloRecHit*>::const_iterator loc =std::lower_bound(first, last, id, comp); return loc == last || comp(id, *loc) ? end() : const_iterator(this,loc - hits_.begin()); }
void CaloRecHitMetaCollectionFast::sort | ( | ) | const [private] |
bool CaloRecHitMetaCollectionFast::dirty_ [mutable, private] |
Definition at line 42 of file CaloRecHitMetaCollectionFast.h.
Referenced by add(), at(), CaloRecHitMetaCollectionFast(), find(), and sort().
std::vector<const CaloRecHit*> CaloRecHitMetaCollectionFast::hits_ [mutable, private] |