CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalRawToRecHitLazyUnpacker.cc
Go to the documentation of this file.
2 
4 
6  const EcalUnpackerWorkerBase & worker,
7  const FEDRawDataCollection& fedcollection):
8  raw_(&fedcollection), cabling_(&cable), worker_(&worker)
9 {
10  LogDebug("EcalRawToRecHit|LazyUnpacker")<<"lazy unpacker created with a max of: "
12  <<" regions";
13 }
14 
16  //clear the cache to avoid memory leak
17 }
18 void EcalRawToRecHitLazyUnpacker::fill(const uint32_t & i, record_type & rec){
19  LogDebug("EcalRawToRecHit|LazyUnpacker")<<"filling for index: "<<i;
20 
21  std::map<uint32_t, std::auto_ptr<EcalRecHitCollection> > ::iterator f= cachedRecHits.find(i);
22  if (f==cachedRecHits.end()){
23  LogDebug("EcalRawToRecHit|LazyUnpacker")<<"needs to be unpacked.";
24  //need to unpack
25 
26  LogDebug("EcalRawToRecHit|LazyUnpacker")<<"calling the worker to work on that index: "<<i;
27  std::auto_ptr< EcalRecHitCollection > rechits = worker_->work(i, *raw_);
28 
29  LogDebug("EcalRawToRecHit|LazyUnpacker")<<"inserting: "<<rechits->size() <<" rechit(s) in the record.";
30  rec.insert(rec.end(), rechits->begin(), rechits->end());
31  }
32 }
33 
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
virtual std::auto_ptr< EcalRecHitCollection > work(const uint32_t &i, const FEDRawDataCollection &) const
virtual void fill(const uint32_t &, record_type &)
std::vector< EcalRecHit > record_type
Definition: LazyGetter.h:213
double f[11][100]
const FEDRawDataCollection * raw_
EcalRawToRecHitLazyUnpacker(const EcalRegionCabling &cable, const EcalUnpackerWorkerBase &worker, const FEDRawDataCollection &fedcollection)
std::map< uint32_t, std::auto_ptr< EcalRecHitCollection > > cachedRecHits
const EcalUnpackerWorkerBase * worker_