#include <RawDataFEDSelector.h>
Public Member Functions | |
RawDataFEDSelector () | |
Constructor. | |
std::auto_ptr < FEDRawDataCollection > | select (const edm::Handle< FEDRawDataCollection > &rawData, const std::vector< int > &list) |
std::auto_ptr < FEDRawDataCollection > | select (const edm::Handle< FEDRawDataCollection > &rawData) |
std::auto_ptr < FEDRawDataCollection > | select (const edm::Handle< FEDRawDataCollection > &rawData, const std::pair< int, int > &range) |
void | setRange (const std::pair< int, int > &range) |
void | setRange (const std::vector< int > &list) |
virtual | ~RawDataFEDSelector () |
Destructor. | |
Private Attributes | |
std::vector< int > | fedList |
std::pair< int, int > | fedRange |
Definition at line 18 of file RawDataFEDSelector.h.
RawDataFEDSelector::RawDataFEDSelector | ( | ) | [inline] |
virtual RawDataFEDSelector::~RawDataFEDSelector | ( | ) | [inline, virtual] |
auto_ptr< FEDRawDataCollection > RawDataFEDSelector::select | ( | const edm::Handle< FEDRawDataCollection > & | rawData | ) |
Definition at line 17 of file RawDataFEDSelector.cc.
References FEDRawData::data(), i, FEDNumbering::lastFEDId(), FEDRawData::resize(), findQualityFiles::size, and FEDRawData::size().
Referenced by RawDataSelector::produce().
{ auto_ptr<FEDRawDataCollection> selectedRawData(new FEDRawDataCollection); // if vector of FED indexes is defined, loop over it if (fedList.size()) { vector<int>::const_iterator it = fedList.begin(); vector<int>::const_iterator itEnd = fedList.end(); for (;it != itEnd; ++it) { const FEDRawData & fedData = rawData->FEDData(*it); size_t size=fedData.size(); FEDRawData & fedDataProd = selectedRawData->FEDData(*it); fedDataProd.resize(size); memcpy(fedDataProd.data(),fedData.data(),size); } } // if vector of FED indexes is NOT defined, loop over it FED range else { // FED range is <0,0> (i.e. neither the list nor the rage are defined) copy the entire payload if (fedRange.second==0) setRange(pair<int,int>(0,FEDNumbering::lastFEDId())); for (int i = fedRange.first; i <= fedRange.second; ++i) { const FEDRawData & fedData = rawData->FEDData(i); size_t size=fedData.size(); FEDRawData & fedDataProd = selectedRawData->FEDData(i); fedDataProd.resize(size); memcpy(fedDataProd.data(),fedData.data(),size); } } return selectedRawData; }
std::auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select | ( | const edm::Handle< FEDRawDataCollection > & | rawData, |
const std::vector< int > & | list | ||
) |
std::auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select | ( | const edm::Handle< FEDRawDataCollection > & | rawData, |
const std::pair< int, int > & | range | ||
) |
void RawDataFEDSelector::setRange | ( | const std::pair< int, int > & | range | ) | [inline] |
void RawDataFEDSelector::setRange | ( | const std::vector< int > & | list | ) | [inline] |
std::vector<int> RawDataFEDSelector::fedList [private] |
Definition at line 39 of file RawDataFEDSelector.h.
Referenced by setRange().
std::pair<int,int> RawDataFEDSelector::fedRange [private] |
Definition at line 38 of file RawDataFEDSelector.h.
Referenced by setRange().