CMS 3D CMS Logo

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  {
14  produces<FEDRawDataCollection>();
15  }
16 
19  desc.add<edm::InputTag>("inputTag",edm::InputTag("source"));
20  {
21  std::vector<unsigned int> temp1;
22  temp1.reserve(2);
23  temp1.push_back(812);
24  temp1.push_back(1023);
25  desc.add<std::vector<unsigned int> >("fedList",temp1);
26  }
27  descriptions.add("EvFFEDSelector",desc);
28  }
29 
31  {
33  event.getByToken(token_, rawdata);
34 
35  std::unique_ptr<FEDRawDataCollection> fedcoll( new FEDRawDataCollection() );
36 
37  for (unsigned int i : fedlist_)
38  if (rawdata->FEDData(i).size() > 0)
39  fedcoll->FEDData(i) = rawdata->FEDData(i);
40 
41  event.put(std::move(fedcoll));
42  }
43 
44 } // namespace evf
std::vector< unsigned int > fedlist_
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const final
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
Definition: config.py:1
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::EDGetTokenT< FEDRawDataCollection > token_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
EvFFEDSelector(edm::ParameterSet const &)
HLT enums.
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1