CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EvFFEDSelector.cc
Go to the documentation of this file.
1 #include <memory>
2 
3 #include "EvFFEDSelector.h"
4 
7 
8 namespace evf {
9 
11  : token_(consumes<FEDRawDataCollection>(config.getParameter<edm::InputTag>("inputTag"))),
12  fedlist_(config.getParameter<std::vector<unsigned int> >("fedList")) {
13  produces<FEDRawDataCollection>();
14  }
15 
18  desc.add<edm::InputTag>("inputTag", edm::InputTag("source"));
19  {
20  std::vector<unsigned int> temp1;
21  temp1.reserve(2);
22  temp1.push_back(812);
23  temp1.push_back(1023);
24  desc.add<std::vector<unsigned int> >("fedList", temp1);
25  }
26  descriptions.add("EvFFEDSelector", desc);
27  }
28 
31  event.getByToken(token_, rawdata);
32 
33  std::unique_ptr<FEDRawDataCollection> fedcoll(new FEDRawDataCollection());
34 
35  for (unsigned int i : fedlist_)
36  if (rawdata->FEDData(i).size() > 0)
37  fedcoll->FEDData(i) = rawdata->FEDData(i);
38 
39  event.put(std::move(fedcoll));
40  }
41 
42 } // namespace evf
std::vector< unsigned int > fedlist_
edm::EDGetTokenT< FEDRawDataCollection > token_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
def move
Definition: eostools.py:511
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
EvFFEDSelector(edm::ParameterSet const &)
tuple config
parse the configuration file
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const final