CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RawDataFEDSelector Class Reference

#include <RawDataFEDSelector.h>

Public Member Functions

 RawDataFEDSelector ()
 Constructor. More...
 
std::unique_ptr< FEDRawDataCollectionselect (const edm::Handle< FEDRawDataCollection > &rawData)
 
std::unique_ptr< FEDRawDataCollectionselect (const edm::Handle< FEDRawDataCollection > &rawData, const std::pair< int, int > &range)
 
std::unique_ptr< FEDRawDataCollectionselect (const edm::Handle< FEDRawDataCollection > &rawData, const std::vector< int > &list)
 
void setRange (const std::pair< int, int > &range)
 
void setRange (const std::vector< int > &list)
 
virtual ~RawDataFEDSelector ()
 Destructor. More...
 

Private Attributes

std::vector< int > fedList
 
std::pair< int, int > fedRange
 

Detailed Description

Author
M. Zanetti CERN

Definition at line 17 of file RawDataFEDSelector.h.

Constructor & Destructor Documentation

RawDataFEDSelector::RawDataFEDSelector ( )
inline

Constructor.

Definition at line 20 of file RawDataFEDSelector.h.

20 {};
virtual RawDataFEDSelector::~RawDataFEDSelector ( )
inlinevirtual

Destructor.

Definition at line 23 of file RawDataFEDSelector.h.

23 {};

Member Function Documentation

std::unique_ptr< FEDRawDataCollection > RawDataFEDSelector::select ( const edm::Handle< FEDRawDataCollection > &  rawData)

Definition at line 17 of file RawDataFEDSelector.cc.

References FEDRawData::data(), FEDRawDataCollection::FEDData(), hcaldqm::constants::fedList, mps_fire::i, FEDNumbering::lastFEDId(), FEDRawData::resize(), FEDRawData::size(), and findQualityFiles::size.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), RawDataSelector::produce(), Vispa.Views.AbstractView.AbstractView::restoreSelection(), and setRange().

17  {
18  auto selectedRawData = std::make_unique<FEDRawDataCollection>();
19 
20  // if vector of FED indexes is defined, loop over it
21  if (!fedList.empty()) {
22  vector<int>::const_iterator it = fedList.begin();
23  vector<int>::const_iterator itEnd = fedList.end();
24  for (; it != itEnd; ++it) {
25  const FEDRawData& fedData = rawData->FEDData(*it);
26  size_t size = fedData.size();
27 
28  FEDRawData& fedDataProd = selectedRawData->FEDData(*it);
29  fedDataProd.resize(size);
30 
31  memcpy(fedDataProd.data(), fedData.data(), size);
32  }
33  }
34 
35  // if vector of FED indexes is NOT defined, loop over it FED range
36  else {
37  // FED range is <0,0> (i.e. neither the list nor the rage are defined) copy the entire payload
38  if (fedRange.second == 0)
39  setRange(pair<int, int>(0, FEDNumbering::lastFEDId()));
40 
41  for (int i = fedRange.first; i <= fedRange.second; ++i) {
42  const FEDRawData& fedData = rawData->FEDData(i);
43  size_t size = fedData.size();
44 
45  FEDRawData& fedDataProd = selectedRawData->FEDData(i);
46  fedDataProd.resize(size);
47 
48  memcpy(fedDataProd.data(), fedData.data(), size);
49  }
50  }
51 
52  return selectedRawData;
53 }
size
Write out results.
void setRange(const std::pair< int, int > &range)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
Definition: FEDRawData.cc:28
std::pair< int, int > fedRange
std::vector< int > fedList
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
static constexpr int lastFEDId()
Definition: FEDNumbering.h:19
std::unique_ptr< FEDRawDataCollection > RawDataFEDSelector::select ( const edm::Handle< FEDRawDataCollection > &  rawData,
const std::pair< int, int > &  range 
)
std::unique_ptr< FEDRawDataCollection > RawDataFEDSelector::select ( const edm::Handle< FEDRawDataCollection > &  rawData,
const std::vector< int > &  list 
)

Definition at line 61 of file RawDataFEDSelector.cc.

References singleTopDQM_cfi::select.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

62  {
63  setRange(list);
64  return select(rawData);
65 }
std::unique_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
void setRange(const std::pair< int, int > &range)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void RawDataFEDSelector::setRange ( const std::pair< int, int > &  range)
inline

Definition at line 25 of file RawDataFEDSelector.h.

References fedRange, and FastTimerService_cff::range.

void RawDataFEDSelector::setRange ( const std::vector< int > &  list)
inline

Definition at line 26 of file RawDataFEDSelector.h.

References fedList, list(), FastTimerService_cff::range, l1tstage2_dqm_sourceclient-live_cfg::rawData, and select().

26 { fedList = list; };
std::vector< int > fedList
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Data Documentation

std::vector<int> RawDataFEDSelector::fedList
private

Definition at line 36 of file RawDataFEDSelector.h.

Referenced by setRange().

std::pair<int, int> RawDataFEDSelector::fedRange
private

Definition at line 35 of file RawDataFEDSelector.h.

Referenced by setRange().