#include <HcalHistogramRawToDigi.h>
Public Member Functions | |
HcalHistogramRawToDigi (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~HcalHistogramRawToDigi () |
Private Attributes | |
edm::InputTag | dataTag_ |
std::vector< int > | fedUnpackList_ |
int | firstFED_ |
HcalUnpacker | unpacker_ |
HcalHistogramRawToDigi is the EDProducer subclass which runs the Hcal Unpack algorithm for calibration-mode histograms.
Definition at line 26 of file HcalHistogramRawToDigi.h.
HcalHistogramRawToDigi::HcalHistogramRawToDigi | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 13 of file HcalHistogramRawToDigi.cc.
References fedUnpackList_, and i.
: dataTag_(conf.getParameter<edm::InputTag>("InputLabel")), unpacker_(conf.getUntrackedParameter<int>("HcalFirstFED",FEDNumbering::MINHCALFEDID)), fedUnpackList_(conf.getUntrackedParameter<std::vector<int> >("FEDs")), firstFED_(conf.getUntrackedParameter<int>("HcalFirstFED",FEDNumbering::MINHCALFEDID)) { std::ostringstream ss; for (unsigned int i=0; i<fedUnpackList_.size(); i++) ss << fedUnpackList_[i] << " "; edm::LogInfo("HCAL") << "HcalHistogramRawToDigi will unpack FEDs ( " << ss.str() << ")"; // products produced... produces<HcalHistogramDigiCollection>(); }
HcalHistogramRawToDigi::~HcalHistogramRawToDigi | ( | ) | [virtual] |
Definition at line 29 of file HcalHistogramRawToDigi.cc.
{ }
void HcalHistogramRawToDigi::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 32 of file HcalHistogramRawToDigi.cc.
References dataTag_, fedUnpackList_, edm::EventSetup::get(), edm::Event::getByLabel(), i, CrabTask::prod, edm::Event::put(), HcalUnpacker::unpack(), and unpacker_.
{ // Step A: Get Inputs edm::Handle<FEDRawDataCollection> rawraw; e.getByLabel(dataTag_,rawraw); // get the mapping edm::ESHandle<HcalDbService> pSetup; es.get<HcalDbRecord>().get( pSetup ); const HcalElectronicsMap* readoutMap=pSetup->getHcalMapping(); // Step B: Create empty output std::auto_ptr<HcalHistogramDigiCollection> prod(new HcalHistogramDigiCollection()); std::vector<HcalHistogramDigi> digis; // Step C: unpack all requested FEDs for (std::vector<int>::const_iterator i=fedUnpackList_.begin(); i!=fedUnpackList_.end(); i++) { const FEDRawData& fed = rawraw->FEDData(*i); unpacker_.unpack(fed,*readoutMap,digis); } // Step B2: encapsulate vectors in actual collections prod->swap_contents(digis); // Step D: Put outputs into event prod->sort(); e.put(prod); }
Definition at line 33 of file HcalHistogramRawToDigi.h.
Referenced by produce().
std::vector<int> HcalHistogramRawToDigi::fedUnpackList_ [private] |
Definition at line 35 of file HcalHistogramRawToDigi.h.
Referenced by HcalHistogramRawToDigi(), and produce().
int HcalHistogramRawToDigi::firstFED_ [private] |
Definition at line 36 of file HcalHistogramRawToDigi.h.
Definition at line 34 of file HcalHistogramRawToDigi.h.
Referenced by produce().