CMS 3D CMS Logo

LTCRawToDigi Class Reference

Description: Unpack FED data to LTC bank. More...

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

00066 {
00067    //register your products
00068    produces<LTCDigiCollection>();
00069 }

LTCRawToDigi::~LTCRawToDigi (  ) 

Definition at line 72 of file LTCRawToDigi.cc.

00073 {
00074  
00075    // do anything here that needs to be done at desctruction time
00076    // (e.g. close files, deallocate resources etc.)
00077 
00078 }


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(), id, edm::Event::put(), and FEDRawData::size().

00088 {
00089   using namespace edm;
00090   const int LTCFedIDLo = 815;
00091   const int LTCFedIDHi = 823;
00092 
00093   // Get a handle to the FED data collection
00094   edm::Handle<FEDRawDataCollection> rawdata;
00095   iEvent.getByLabel("source" , rawdata);
00096 
00097   // create collection we'll save in the event record
00098   std::auto_ptr<LTCDigiCollection> pOut(new LTCDigiCollection());
00099 
00100   // Loop over all possible FED's with the appropriate FED ID
00101   for ( int id = LTCFedIDLo; id <= LTCFedIDHi; ++id ) {
00103     const FEDRawData & fedData = rawdata->FEDData(id);
00104     unsigned short int length =  fedData.size();
00105     if ( ! length ) 
00106       continue; // bank does not exist
00107     LTCDigi ltcDigi(fedData.data());
00108     pOut->push_back(ltcDigi);
00109   }
00110   iEvent.put(pOut);
00111 }


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:27:56 2009 for CMSSW by  doxygen 1.5.4