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 
6 
7 #include <memory>
8 #include <utility>
9 
15 
19 
21 
23 
24 public:
25 
26  explicit RawDataSelector(const edm::ParameterSet&);
27 
28  ~RawDataSelector() override;
29 
30 private:
31 
32  void produce(edm::Event&, const edm::EventSetup&) override;
33 
35 
37  std::pair<int,int> fedRange;
38 
39 };
40 
42  dataLabel(pset.getUntrackedParameter<edm::InputTag>("InputLabel",edm::InputTag("source"))) {
43 
44  fedRange = std::pair<int,int>(pset.getParameter<int>("lowerBound"), pset.getParameter<int>("upperBound"));
45 
47 
48  produces<FEDRawDataCollection>();
49 
50 }
51 
52 
54  delete selector;
55 }
56 
57 
59 
60  using namespace edm;
61  using namespace std;
62 
64  iEvent.getByLabel( dataLabel, rawData);
65 
66  /* here eventually perform some operation to get the list of FED's
67  to be written in the new collection.
68  In this case we simply take the range from the ParameterSet */
69 
70 
71  // the filtered raw data collections
72  std::unique_ptr<FEDRawDataCollection> selectedRawData = selector->select(rawData, fedRange);
73 
74 
75  iEvent.put(std::move(selectedRawData));
76 
77 }
78 
79 
80 //define this as a plug-in
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
std::unique_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::pair< int, int > fedRange
RawDataFEDSelector * selector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
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