#include <EcalRawToRecHitLazyUnpacker.h>
Public Types | |
typedef edm::LazyUnpacker < EcalRecHit > | Base |
typedef edm::DetSet< EcalRecHit > | DetSet |
Public Member Functions | |
EcalRawToRecHitLazyUnpacker (const EcalRegionCabling &cable, const EcalUnpackerWorkerBase &worker, const FEDRawDataCollection &fedcollection) | |
virtual void | fill (const uint32_t &, record_type &) |
virtual | ~EcalRawToRecHitLazyUnpacker () |
Private Attributes | |
const EcalRegionCabling * | cabling_ |
std::map< uint32_t, std::auto_ptr < EcalRecHitCollection > > | cachedRecHits |
const FEDRawDataCollection * | raw_ |
const EcalUnpackerWorkerBase * | worker_ |
Definition at line 12 of file EcalRawToRecHitLazyUnpacker.h.
Definition at line 16 of file EcalRawToRecHitLazyUnpacker.h.
Definition at line 15 of file EcalRawToRecHitLazyUnpacker.h.
EcalRawToRecHitLazyUnpacker::EcalRawToRecHitLazyUnpacker | ( | const EcalRegionCabling & | cable, |
const EcalUnpackerWorkerBase & | worker, | ||
const FEDRawDataCollection & | fedcollection | ||
) |
Definition at line 5 of file EcalRawToRecHitLazyUnpacker.cc.
References LogDebug, FEDNumbering::MAXECALFEDID, and FEDNumbering::MINECALFEDID.
: raw_(&fedcollection), cabling_(&cable), worker_(&worker) { LogDebug("EcalRawToRecHit|LazyUnpacker")<<"lazy unpacker created with a max of: " <<FEDNumbering::MAXECALFEDID-FEDNumbering::MINECALFEDID+1 <<" regions"; }
EcalRawToRecHitLazyUnpacker::~EcalRawToRecHitLazyUnpacker | ( | ) | [virtual] |
Definition at line 15 of file EcalRawToRecHitLazyUnpacker.cc.
{
//clear the cache to avoid memory leak
}
void EcalRawToRecHitLazyUnpacker::fill | ( | const uint32_t & | i, |
record_type & | rec | ||
) | [virtual] |
Implements edm::LazyUnpacker< EcalRecHit >.
Definition at line 18 of file EcalRawToRecHitLazyUnpacker.cc.
References cachedRecHits, f, i, LogDebug, raw_, EcalUnpackerWorkerBase::work(), and worker_.
{ LogDebug("EcalRawToRecHit|LazyUnpacker")<<"filling for index: "<<i; std::map<uint32_t, std::auto_ptr<EcalRecHitCollection> > ::iterator f= cachedRecHits.find(i); if (f==cachedRecHits.end()){ LogDebug("EcalRawToRecHit|LazyUnpacker")<<"needs to be unpacked."; //need to unpack LogDebug("EcalRawToRecHit|LazyUnpacker")<<"calling the worker to work on that index: "<<i; std::auto_ptr< EcalRecHitCollection > rechits = worker_->work(i, *raw_); LogDebug("EcalRawToRecHit|LazyUnpacker")<<"inserting: "<<rechits->size() <<" rechit(s) in the record."; rec.insert(rec.end(), rechits->begin(), rechits->end()); } }
const EcalRegionCabling* EcalRawToRecHitLazyUnpacker::cabling_ [private] |
Definition at line 31 of file EcalRawToRecHitLazyUnpacker.h.
std::map<uint32_t, std::auto_ptr<EcalRecHitCollection> > EcalRawToRecHitLazyUnpacker::cachedRecHits [private] |
Definition at line 36 of file EcalRawToRecHitLazyUnpacker.h.
Referenced by fill().
const FEDRawDataCollection* EcalRawToRecHitLazyUnpacker::raw_ [private] |
Definition at line 29 of file EcalRawToRecHitLazyUnpacker.h.
Referenced by fill().
const EcalUnpackerWorkerBase* EcalRawToRecHitLazyUnpacker::worker_ [private] |
Definition at line 33 of file EcalRawToRecHitLazyUnpacker.h.
Referenced by fill().