CMS 3D CMS Logo

Public Member Functions

LTCRawToDigi Class Reference

#include <EventFilter/LTCRawToDigi/src/LTCRawToDigi.cc>

Inheritance diagram for LTCRawToDigi:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 LTCRawToDigi (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~LTCRawToDigi ()

Detailed Description

Description: Unpack FED data to LTC bank. LTCs are FED id 816-823.

Implementation: No comments

Definition at line 43 of file LTCRawToDigi.cc.


Constructor & Destructor Documentation

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.)

}

Member Function Documentation

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(), 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);
}