test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
6 
7 #include <memory>
8 #include <utility>
9 
15 
19 
21 
23 
24 public:
25 
26  explicit RawDataSelector(const edm::ParameterSet&);
27 
29 
30 private:
31 
32  virtual 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  auto_ptr<FEDRawDataCollection> selectedRawData = selector->select(rawData, fedRange);
73 
74 
75  iEvent.put(selectedRawData);
76 
77 }
78 
79 
80 //define this as a plug-in
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::pair< int, int > fedRange
RawDataFEDSelector * selector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
std::auto_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
virtual void produce(edm::Event &, const edm::EventSetup &) override
edm::InputTag dataLabel
RawDataSelector(const edm::ParameterSet &)