CMS 3D CMS Logo

Public Member Functions | Private Attributes

evf::EvFFEDSelector Class Reference

#include <EvFFEDSelector.h>

Inheritance diagram for evf::EvFFEDSelector:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 EvFFEDSelector (const edm::ParameterSet &)
void produce (edm::Event &e, const edm::EventSetup &c)
 ~EvFFEDSelector ()

Private Attributes

std::vector< unsigned int > fedlist_
edm::InputTag label_

Detailed Description

Definition at line 13 of file EvFFEDSelector.h.


Constructor & Destructor Documentation

data doxygen doxygen gen CMSSW_4_2_8 src EventFilter FEDInterface plugins EvFFEDSelector cc evf::EvFFEDSelector::EvFFEDSelector ( const edm::ParameterSet ps) [explicit]

Definition at line 8 of file EvFFEDSelector.cc.

    : label_(ps.getParameter<edm::InputTag>("inputTag"))
    , fedlist_(ps.getParameter<std::vector<unsigned int> >("fedList")) 
  {
    
    produces<FEDRawDataCollection>();
  }
  void EvFFEDSelector::produce(edm::Event & e, const edm::EventSetup& c)
evf::EvFFEDSelector::~EvFFEDSelector ( ) [inline]

Definition at line 18 of file EvFFEDSelector.h.

{};

Member Function Documentation

void evf::EvFFEDSelector::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 15 of file EvFFEDSelector.cc.

References FEDRawData::data(), runTheMatrix::data, FEDRawDataCollection::FEDData(), fedlist_, edm::Event::getByLabel(), label_, edm::Event::put(), FEDRawData::resize(), and FEDRawData::size().

  {
    edm::Handle<FEDRawDataCollection> rawdata;
    FEDRawDataCollection *fedcoll = new FEDRawDataCollection();
    e.getByLabel(label_,rawdata);
    std::vector<unsigned int>::iterator it = fedlist_.begin();
    for(;it!=fedlist_.end();it++)
      {
        const FEDRawData& data = rawdata->FEDData(*it);
        if(data.size()>0){
          FEDRawData& fedData=fedcoll->FEDData(*it);
          fedData.resize(data.size());
          memcpy(fedData.data(),data.data(),data.size());
        } 
      }
    std::auto_ptr<FEDRawDataCollection> bare_product(fedcoll);
    e.put(bare_product);
  }
}

Member Data Documentation

std::vector<unsigned int> evf::EvFFEDSelector::fedlist_ [private]

Definition at line 24 of file EvFFEDSelector.h.

Referenced by produce().

Definition at line 23 of file EvFFEDSelector.h.

Referenced by produce().