#include <RawDataCollectorModule.h>
Public Member Functions | |
void | produce (edm::Event &e, const edm::EventSetup &c) |
RawDataCollectorModule (const edm::ParameterSet &pset) | |
Constructor. | |
virtual | ~RawDataCollectorModule () |
Destructor. | |
Private Attributes | |
bool | useCurrentProcessOnly_ |
Definition at line 12 of file RawDataCollectorModule.h.
RawDataCollectorModule::RawDataCollectorModule | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 23 of file RawDataCollectorModule.cc.
References edm::ParameterSet::getParameter().
{ useCurrentProcessOnly_ = pset.getParameter<bool>("currentProcessOnly") ; produces<FEDRawDataCollection>(); }
RawDataCollectorModule::~RawDataCollectorModule | ( | ) | [virtual] |
void RawDataCollectorModule::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Get Data from all FEDs
Implements edm::EDProducer.
Definition at line 35 of file RawDataCollectorModule.cc.
References gather_cfg::cout, FEDRawData::data(), data, FEDRawDataCollection::FEDData(), edm::Event::getManyByType(), i, j, gen::k, FEDNumbering::MAXFEDID, edm::Event::processHistory(), edm::Event::put(), edm::ProcessHistory::rbegin(), FEDRawData::resize(), findQualityFiles::size, and FEDRawData::size().
{ std::vector< Handle<FEDRawDataCollection> > rawData; e.getManyByType(rawData); std::auto_ptr<FEDRawDataCollection> producedData(new FEDRawDataCollection); for (unsigned int i=0; i< rawData.size(); ++i ) { const FEDRawDataCollection *rdc=rawData[i].product(); if ( useCurrentProcessOnly_ && ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) ) continue ; // skip all raw collections not produced by the current process for ( int j=0; j< FEDNumbering::MAXFEDID; ++j ) { const FEDRawData & fedData = rdc->FEDData(j); size_t size=fedData.size(); if ( size > 0 ) { // this fed has data -- lets copy it FEDRawData & fedDataProd = producedData->FEDData(j); if ( fedDataProd.size() != 0 ) { std::cout << " More than one FEDRawDataCollection with data in FED "; std::cout << j << " Skipping the 2nd\n"; continue; } fedDataProd.resize(size); unsigned char *dataProd=fedDataProd.data(); const unsigned char *data=fedData.data(); for ( unsigned int k=0; k<size; ++k ) { dataProd[k]=data[k]; } } } } // Insert the new product in the event e.put(producedData); }
bool RawDataCollectorModule::useCurrentProcessOnly_ [private] |
Definition at line 25 of file RawDataCollectorModule.h.