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&);
33  void beginRun(const edm::Run&, const edm::EventSetup&);
34 
36 
38  std::pair<int,int> fedRange;
39 
40 };
41 
43  dataLabel(pset.getUntrackedParameter<edm::InputTag>("InputLabel",edm::InputTag("source"))) {
44 
45  fedRange = std::pair<int,int>(pset.getParameter<int>("lowerBound"), pset.getParameter<int>("upperBound"));
46 
48 
49  produces<FEDRawDataCollection>();
50 
51 }
52 
53 
55  delete selector;
56 }
57 
58 
60 
61  using namespace edm;
62  using namespace std;
63 
65  iEvent.getByLabel( dataLabel, rawData);
66 
67  /* here eventually perform some operation to get the list of FED's
68  to be written in the new collection.
69  In this case we simply take the range from the ParameterSet */
70 
71 
72  // the filtered raw data collections
73  auto_ptr<FEDRawDataCollection> selectedRawData = selector->select(rawData, fedRange);
74 
75 
76  iEvent.put(selectedRawData);
77 
78 }
79 
80 
81 //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:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::pair< int, int > fedRange
RawDataFEDSelector * selector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::auto_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag dataLabel
void beginRun(const edm::Run &, const edm::EventSetup &)
RawDataSelector(const edm::ParameterSet &)
Definition: Run.h:33