CMS 3D CMS Logo

Public Member Functions | Private Attributes

ESUnpackerWorker Class Reference

#include <ESUnpackerWorker.h>

Inheritance diagram for ESUnpackerWorker:
EcalUnpackerWorkerBase

List of all members.

Public Member Functions

 ESUnpackerWorker (const edm::ParameterSet &conf)
unsigned int maxElementIndex () const
void set (const edm::EventSetup &es) const
void setHandles (const EcalUnpackerWorkerRecord &iRecord)
void update (const edm::Event &e) const
std::auto_ptr
< EcalRecHitCollection
work (const uint32_t &i, const FEDRawDataCollection &) const
void write (edm::Event &e) const
 ~ESUnpackerWorker ()

Private Attributes

ESUnpackerESUnpacker_
ESRecHitWorkerBaseClassRHWorker_

Detailed Description

Definition at line 24 of file ESUnpackerWorker.h.


Constructor & Destructor Documentation

ESUnpackerWorker::ESUnpackerWorker ( const edm::ParameterSet conf)

Definition at line 6 of file ESUnpackerWorker.cc.

References ESUnpacker_, reco::get(), edm::ParameterSet::getParameter(), RHWorker_, and AlCaHLTBitMon_QueryRunRegistry::string.

                                                              {
  
  edm::ParameterSet DCCpset = conf.getParameter<edm::ParameterSet>("DCCDataUnpacker");
  ESUnpacker_ = new ESUnpacker(DCCpset);
  
  edm::ParameterSet  RH = conf.getParameter<edm::ParameterSet>("RHAlgo");
  std::string componentType =  RH.getParameter<std::string>("Type");
  RHWorker_ = ESRecHitWorkerFactory::get()->create(componentType, RH);

}
ESUnpackerWorker::~ESUnpackerWorker ( )

Definition at line 17 of file ESUnpackerWorker.cc.

References ESUnpacker_, and RHWorker_.

                                   {
  delete ESUnpacker_;
  delete RHWorker_;
}

Member Function Documentation

unsigned int ESUnpackerWorker::maxElementIndex ( ) const [inline, virtual]

Reimplemented from EcalUnpackerWorkerBase.

Definition at line 42 of file ESUnpackerWorker.h.

References EcalRegionCabling::maxESElementIndex().

void ESUnpackerWorker::set ( const edm::EventSetup es) const [virtual]

Reimplemented from EcalUnpackerWorkerBase.

Definition at line 26 of file ESUnpackerWorker.cc.

References RHWorker_, and ESRecHitWorkerBaseClass::set().

                                                         {
  RHWorker_->set(es);
}
void ESUnpackerWorker::setHandles ( const EcalUnpackerWorkerRecord iRecord) [virtual]

Reimplemented from EcalUnpackerWorkerBase.

Definition at line 22 of file ESUnpackerWorker.cc.

                                                                          {

}
void ESUnpackerWorker::update ( const edm::Event e) const [virtual]

Reimplemented from EcalUnpackerWorkerBase.

Definition at line 34 of file ESUnpackerWorker.cc.

                                                    {
}
std::auto_ptr< EcalRecHitCollection > ESUnpackerWorker::work ( const uint32_t &  i,
const FEDRawDataCollection rawdata 
) const [virtual]

Reimplemented from EcalUnpackerWorkerBase.

Definition at line 38 of file ESUnpackerWorker.cc.

References edm::DataFrameContainer::begin(), edm::DataFrameContainer::end(), EcalRegionCabling::esFedIndex(), ESUnpacker_, FEDRawDataCollection::FEDData(), getHLTprescales::index, ESUnpacker::interpretRawData(), LogDebug, RHWorker_, ESRecHitWorkerBaseClass::run(), and edm::DataFrameContainer::size().

                                                                                                                           {
//  MyWatcher watcher("Worker");
  LogDebug("ESRawToRecHit|Worker")<<"is going to work on index: "<<index ;
//                                <<watcher.lap();

  int fedIndex = EcalRegionCabling::esFedIndex(index);


  const FEDRawData & fedData = rawdata.FEDData(fedIndex);

  //###### get the digi #######
  ESRawDataCollection productDCC;
  ESLocalRawDataCollection productKCHIP;
  ESDigiCollection productdigis;

  ESUnpacker_->interpretRawData(fedIndex, fedData, productDCC, productKCHIP, productdigis);
  
  LogDebug("ESRawToRecHit|Worker")<<"unpacked "<<productdigis.size()<<" digis" ;
//                                <<watcher.lap();


  //then make rechits
  ESDigiCollection::const_iterator beginDigiES = productdigis.begin();
  ESDigiCollection::const_iterator endDigiES = productdigis.end();

  std::auto_ptr< EcalRecHitCollection > ecalrechits( new EcalRecHitCollection );

  ecalrechits->reserve(productdigis.size());
  
  ESDigiCollection::const_iterator esIt=beginDigiES;
  for (;esIt!=endDigiES;++esIt){
    RHWorker_->run( esIt, *ecalrechits );
  }

  LogDebug("ESRawToRecHit|Worker")<<" made : "<<ecalrechits->size()<<" es rechits" ;
//                                <<watcher.lap();

  return ecalrechits;
}
void ESUnpackerWorker::write ( edm::Event e) const [virtual]

Reimplemented from EcalUnpackerWorkerBase.

Definition at line 30 of file ESUnpackerWorker.cc.

                                              {

}

Member Data Documentation

Definition at line 46 of file ESUnpackerWorker.h.

Referenced by ESUnpackerWorker(), work(), and ~ESUnpackerWorker().

Definition at line 47 of file ESUnpackerWorker.h.

Referenced by ESUnpackerWorker(), set(), work(), and ~ESUnpackerWorker().