#include <EventFilter/LTCRawToDigi/src/LTCRawToDigi.cc>
Public Member Functions | |
LTCRawToDigi (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~LTCRawToDigi () |
Description: Unpack FED data to LTC bank. LTCs are FED id 816-823.
Implementation: No comments
Definition at line 43 of file LTCRawToDigi.cc.
LTCRawToDigi::LTCRawToDigi | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 65 of file LTCRawToDigi.cc.
{
//register your products
produces<LTCDigiCollection>();
}
LTCRawToDigi::~LTCRawToDigi | ( | ) |
Definition at line 72 of file LTCRawToDigi.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void LTCRawToDigi::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Take a reference to this FED's data
Implements edm::EDProducer.
Definition at line 87 of file LTCRawToDigi.cc.
References FEDRawData::data(), edm::Event::getByLabel(), edm::Event::put(), lumiPlot::rawdata, and FEDRawData::size().
{ using namespace edm; const int LTCFedIDLo = 815; const int LTCFedIDHi = 823; // Get a handle to the FED data collection edm::Handle<FEDRawDataCollection> rawdata; iEvent.getByLabel("source" , rawdata); // create collection we'll save in the event record std::auto_ptr<LTCDigiCollection> pOut(new LTCDigiCollection()); // Loop over all possible FED's with the appropriate FED ID for ( int id = LTCFedIDLo; id <= LTCFedIDHi; ++id ) { const FEDRawData & fedData = rawdata->FEDData(id); unsigned short int length = fedData.size(); if ( ! length ) continue; // bank does not exist LTCDigi ltcDigi(fedData.data()); pOut->push_back(ltcDigi); } iEvent.put(pOut); }