CMS 3D CMS Logo

EcalRawToRecHitLazyUnpacker Class Reference

#include <EventFilter/EcalRawToDigi/interface/EcalRawToRecHitLazyUnpacker.h>

Inheritance diagram for EcalRawToRecHitLazyUnpacker:

edm::LazyUnpacker< EcalRecHit >

List of all members.

Public Types

typedef edm::LazyUnpacker
< EcalRecHit
Base
typedef edm::DetSet< EcalRecHitDetSet

Public Member Functions

 EcalRawToRecHitLazyUnpacker (const EcalRegionCabling &cable, const EcalUnpackerWorker &worker, const FEDRawDataCollection &fedcollection)
virtual void fill (const uint32_t &, record_type &)
virtual ~EcalRawToRecHitLazyUnpacker ()

Private Attributes

const EcalRegionCablingcabling_
std::map< uint32_t,
std::auto_ptr
< EcalRecHitCollection > > 
cachedRecHits
const FEDRawDataCollectionraw_
const EcalUnpackerWorkerworker_


Detailed Description

Definition at line 12 of file EcalRawToRecHitLazyUnpacker.h.


Member Typedef Documentation

typedef edm::LazyUnpacker<EcalRecHit> EcalRawToRecHitLazyUnpacker::Base

Definition at line 16 of file EcalRawToRecHitLazyUnpacker.h.

typedef edm::DetSet<EcalRecHit> EcalRawToRecHitLazyUnpacker::DetSet

Definition at line 15 of file EcalRawToRecHitLazyUnpacker.h.


Constructor & Destructor Documentation

EcalRawToRecHitLazyUnpacker::EcalRawToRecHitLazyUnpacker ( const EcalRegionCabling cable,
const EcalUnpackerWorker worker,
const FEDRawDataCollection fedcollection 
)

Definition at line 5 of file EcalRawToRecHitLazyUnpacker.cc.

References FEDNumbering::getEcalFEDIds(), and LogDebug.

00007                                                                                                    :
00008   raw_(&fedcollection), cabling_(&cable), worker_(&worker)
00009 {
00010   LogDebug("EcalRawToRecHit|LazyUnpacker")<<"lazy unpacker created with a max of: "
00011                                           <<FEDNumbering::getEcalFEDIds().second-FEDNumbering::getEcalFEDIds().first+1
00012                                           <<" regions";
00013 }

EcalRawToRecHitLazyUnpacker::~EcalRawToRecHitLazyUnpacker (  )  [virtual]

Definition at line 15 of file EcalRawToRecHitLazyUnpacker.cc.

00015                                                          {
00016   //clear the cache to avoid memory leak
00017 }


Member Function Documentation

void EcalRawToRecHitLazyUnpacker::fill ( const uint32_t &  i,
record_type rec 
) [virtual]

Definition at line 18 of file EcalRawToRecHitLazyUnpacker.cc.

References cachedRecHits, f, LogDebug, raw_, EcalUnpackerWorker::work(), and worker_.

00018                                                                            {
00019   LogDebug("EcalRawToRecHit|LazyUnpacker")<<"filling for index: "<<i;
00020 
00021   std::map<uint32_t, std::auto_ptr<EcalRecHitCollection> > ::iterator f= cachedRecHits.find(i);
00022   if (f==cachedRecHits.end()){
00023     LogDebug("EcalRawToRecHit|LazyUnpacker")<<"needs to be unpacked.";
00024     //need to unpack
00025 
00026     LogDebug("EcalRawToRecHit|LazyUnpacker")<<"calling the worker to work on that index: "<<i;
00027     std::auto_ptr< EcalRecHitCollection > rechits = worker_->work(i, *raw_);
00028 
00029     LogDebug("EcalRawToRecHit|LazyUnpacker")<<"inserting: "<<rechits->size() <<" rechit(s) in the record.";
00030     rec.insert(rec.end(), rechits->begin(), rechits->end());
00031   }
00032 }


Member Data Documentation

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 EcalUnpackerWorker* EcalRawToRecHitLazyUnpacker::worker_ [private]

Definition at line 33 of file EcalRawToRecHitLazyUnpacker.h.

Referenced by fill().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:50 2009 for CMSSW by  doxygen 1.5.4