CMS 3D CMS Logo

RawDataSelector.cc
Go to the documentation of this file.
1 //
2 // Original Author: Marco ZANETTI
3 // Created: Mon Jan 28 18:22:13 CET 2008
4 
5 #include <memory>
6 #include <utility>
7 
13 
17 
19 
21 public:
22  explicit RawDataSelector(const edm::ParameterSet&);
23 
24  ~RawDataSelector() override;
25 
26 private:
27  void produce(edm::Event&, const edm::EventSetup&) override;
28 
30 
32  std::pair<int, int> fedRange;
33 };
34 
36  : dataLabel(pset.getUntrackedParameter<edm::InputTag>("InputLabel", edm::InputTag("source"))) {
37  fedRange = std::pair<int, int>(pset.getParameter<int>("lowerBound"), pset.getParameter<int>("upperBound"));
38 
40 
41  produces<FEDRawDataCollection>();
42 }
43 
45 
47  using namespace edm;
48  using namespace std;
49 
51  iEvent.getByLabel(dataLabel, rawData);
52 
53  /* here eventually perform some operation to get the list of FED's
54  to be written in the new collection.
55  In this case we simply take the range from the ParameterSet */
56 
57  // the filtered raw data collections
58  std::unique_ptr<FEDRawDataCollection> selectedRawData = selector->select(rawData, fedRange);
59 
60  iEvent.put(std::move(selectedRawData));
61 }
62 
63 //define this as a plug-in
std::unique_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
std::pair< int, int > fedRange
int iEvent
Definition: GenABIO.cc:224
RawDataFEDSelector * selector
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
edm::InputTag dataLabel
HLT enums.
RawDataSelector(const edm::ParameterSet &)
~RawDataSelector() override
def move(src, dest)
Definition: eostools.py:511