CMS 3D CMS Logo

HcalUMNioTableProducer.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 
4 // user include files
8 
11 
15 
18 
20 private:
23 
24 public:
25  explicit HcalUMNioTableProducer(const edm::ParameterSet& iConfig)
26  : tagUMNio_(iConfig.getUntrackedParameter<edm::InputTag>("tagUMNio", edm::InputTag("hcalDigis"))) {
27  tokenUMNio_ = consumes<HcalUMNioDigi>(tagUMNio_);
28 
29  produces<nanoaod::FlatTable>("uMNioTable");
30  }
31 
33 
34  /*
35  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
36  edm::ParameterSetDescription desc;
37  desc.add<edm::InputTag>("tagUMNio")->setComment("Input uMNio digi collection");
38  descriptions.add("HcalUMNioTable", desc);
39  }
40  */
41 
42 private:
43  void produce(edm::Event&, edm::EventSetup const&) override;
44 };
45 
48  iEvent.getByToken(tokenUMNio_, uMNioDigi);
49  uint8_t eventType = uMNioDigi->eventType();
50 
51  auto uMNioNanoTable = std::make_unique<nanoaod::FlatTable>(1, "uMNio", true);
52  uMNioNanoTable->addColumnValue<uint8_t>("EventType", eventType, "EventType");
53  for (int iWord = 0; iWord < uMNioDigi->numberUserWords(); ++iWord) {
54  uint32_t thisWord = uMNioDigi->valueUserWord(iWord);
55  uMNioNanoTable->addColumnValue<uint32_t>(
56  "UserWord" + std::to_string(iWord), thisWord, "UserWord" + std::to_string(iWord));
57  }
58  iEvent.put(std::move(uMNioNanoTable), "uMNioTable");
59 }
60 
62 //define this as a plug-in
edm::EDGetTokenT< HcalUMNioDigi > tokenUMNio_
void produce(edm::Event &, edm::EventSetup const &) override
int numberUserWords() const
static std::string to_string(const XMLCh *ch)
uint32_t valueUserWord(int iword) const
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
uint8_t eventType() const
HLT enums.
HcalUMNioTableProducer(const edm::ParameterSet &iConfig)
def move(src, dest)
Definition: eostools.py:511