CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
std::unique_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::pair< int, int > fedRange
int iEvent
Definition: GenABIO.cc:224
def move
Definition: eostools.py:511
RawDataFEDSelector * selector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void produce(edm::Event &, const edm::EventSetup &) override
edm::InputTag dataLabel
RawDataSelector(const edm::ParameterSet &)
~RawDataSelector() override