CMS 3D CMS Logo

SimpleFlatTableProducer.h
Go to the documentation of this file.
13 
16 
17 #include <memory>
18 #include <vector>
19 
20 // Base class for dumped variables
21 class VariableBase {
22 public:
24  : name_(aname),
25  doc_(cfg.getParameter<std::string>("doc")),
26  precision_(cfg.existsAs<int>("precision") ? cfg.getParameter<int>("precision")
27  : (cfg.existsAs<std::string>("precision") ? -2 : -1)) {}
28  virtual ~VariableBase() {}
29  const std::string &name() const { return name_; }
30 
31 protected:
34 };
35 
36 // Object member variables and methods
37 template <typename ObjType>
38 class Variable : public VariableBase {
39 public:
40  Variable(const std::string &aname, const edm::ParameterSet &cfg) : VariableBase(aname, cfg) {}
41  virtual void fill(std::vector<const ObjType *> &selobjs, nanoaod::FlatTable &out) const = 0;
42 };
43 
44 template <typename ObjType, typename StringFunctor, typename ValType>
45 class FuncVariable : public Variable<ObjType> {
46 public:
48  : Variable<ObjType>(aname, cfg),
49  func_(cfg.getParameter<std::string>("expr"), true),
50  precisionFunc_(cfg.existsAs<std::string>("precision") ? cfg.getParameter<std::string>("precision") : "23",
51  true) {}
52  ~FuncVariable() override {}
53  void fill(std::vector<const ObjType *> &selobjs, nanoaod::FlatTable &out) const override {
54  std::vector<ValType> vals(selobjs.size());
55  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
56  ValType val = func_(*selobjs[i]);
57  if constexpr (std::is_same<ValType, float>()) {
58  if (this->precision_ == -2) {
59  auto prec = precisionFunc_(*selobjs[i]);
60  vals[i] = prec > 0 ? MiniFloatConverter::reduceMantissaToNbitsRounding(val, prec) : val;
61  } else
62  vals[i] = val;
63  } else {
64  vals[i] = val;
65  }
66  }
67  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
68  }
69 
70 protected:
71  StringFunctor func_;
72  StringFunctor precisionFunc_;
73 };
74 
75 // External variables: i.e. variables that are not member or methods of the object
76 template <typename ObjType>
77 class ExtVariable : public VariableBase {
78 public:
79  ExtVariable(const std::string &aname, const edm::ParameterSet &cfg) : VariableBase(aname, cfg) {}
80  virtual void fill(const edm::Event &iEvent,
82  nanoaod::FlatTable &out) const = 0;
83 };
84 template <typename ObjType, typename TIn, typename ValType = TIn>
85 class ValueMapVariable : public ExtVariable<ObjType> {
86 public:
88  const edm::ParameterSet &cfg,
90  bool skipNonExistingSrc = false)
91  : ExtVariable<ObjType>(aname, cfg),
93  token_(cc.consumes<edm::ValueMap<TIn>>(cfg.getParameter<edm::InputTag>("src"))) {}
94  void fill(const edm::Event &iEvent, std::vector<edm::Ptr<ObjType>> selptrs, nanoaod::FlatTable &out) const override {
96  iEvent.getByToken(token_, vmap);
97  std::vector<ValType> vals;
98  if (vmap.isValid() || !skipNonExistingSrc_) {
99  vals.resize(selptrs.size());
100  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
101  vals[i] = (*vmap)[selptrs[i]];
102  }
103  }
104  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
105  }
106 
107 protected:
110 };
111 
112 // Event producers
113 // - ABC
114 // - Singleton
115 // - Collection
116 template <typename T, typename TProd>
118 public:
120  : name_(params.getParameter<std::string>("name")),
121  doc_(params.getParameter<std::string>("doc")),
122  extension_(params.getParameter<bool>("extension")),
123  skipNonExistingSrc_(params.getParameter<bool>("skipNonExistingSrc")),
124  src_(consumes<TProd>(params.getParameter<edm::InputTag>("src"))) {
125  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
126  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
127  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
128  const std::string &type = varPSet.getParameter<std::string>("type");
129  if (type == "int")
130  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
131  else if (type == "uint")
132  vars_.push_back(std::make_unique<UIntVar>(vname, varPSet));
133  else if (type == "float")
134  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
135  else if (type == "double")
136  vars_.push_back(std::make_unique<DoubleVar>(vname, varPSet));
137  else if (type == "int8")
138  vars_.push_back(std::make_unique<Int8Var>(vname, varPSet));
139  else if (type == "uint8")
140  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
141  else if (type == "int16")
142  vars_.push_back(std::make_unique<Int16Var>(vname, varPSet));
143  else if (type == "uint16")
144  vars_.push_back(std::make_unique<UInt16Var>(vname, varPSet));
145  else if (type == "bool")
146  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
147  else
148  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
149  }
150 
151  produces<nanoaod::FlatTable>();
152  }
153 
155 
159  desc.add<std::string>("name")->setComment("name of the branch in the flat table output for " + classname);
160  desc.add<std::string>("doc", "")->setComment("few words of self documentation");
161  desc.add<bool>("extension", false)->setComment("whether or not to extend an existing same table");
162  desc.add<bool>("skipNonExistingSrc", false)
163  ->setComment("whether or not to skip producing the table on absent input product");
164  desc.add<edm::InputTag>("src")->setComment("input collection to fill the flat table");
165 
167  variable.add<std::string>("expr")->setComment("a function to define the content of the branch in the flat table");
168  variable.add<std::string>("doc")->setComment("few words description of the branch content");
169  variable.ifValue(
171  "type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
172  edm::allowedValues<std::string>("int", "uint", "float", "double", "int8", "uint8", "int16", "uint16", "bool"));
173  variable.addOptionalNode(
175  "precision", true, edm::Comment("the precision with which to store the value in the flat table")) xor
177  "precision", true, edm::Comment("the precision with which to store the value in the flat table")),
178  false);
179 
181  variables.setComment("a parameters set to define all variable to fill the flat table");
182  variables.addNode(
184  desc.add<edm::ParameterSetDescription>("variables", variables);
185 
186  return desc;
187  }
188  // this is to be overriden by the child class
189  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
190  const edm::Handle<TProd> &prod) const = 0;
191 
192  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
194  iEvent.getByToken(src_, src);
195 
196  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iEvent, src);
197  out->setDoc(doc_);
198 
199  iEvent.put(std::move(out));
200  }
201 
202 protected:
205  const bool extension_;
208 
218  std::vector<std::unique_ptr<Variable<T>>> vars_;
219 };
220 
221 template <typename T>
222 class SimpleFlatTableProducer : public SimpleFlatTableProducerBase<T, edm::View<T>> {
223 public:
226  singleton_(params.getParameter<bool>("singleton")),
227  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
228  : std::numeric_limits<unsigned int>::max()),
229  cut_(!singleton_ ? params.getParameter<std::string>("cut") : "", true) {
230  if (params.existsAs<edm::ParameterSet>("externalVariables")) {
231  edm::ParameterSet const &extvarsPSet = params.getParameter<edm::ParameterSet>("externalVariables");
232  for (const std::string &vname : extvarsPSet.getParameterNamesForType<edm::ParameterSet>()) {
233  const auto &varPSet = extvarsPSet.getParameter<edm::ParameterSet>(vname);
234  const std::string &type = varPSet.getParameter<std::string>("type");
235  if (type == "int")
236  extvars_.push_back(
237  std::make_unique<IntExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
238  else if (type == "uint")
239  extvars_.push_back(
240  std::make_unique<UIntExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
241  else if (type == "float")
242  extvars_.push_back(
243  std::make_unique<FloatExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
244  else if (type == "double")
245  extvars_.push_back(
246  std::make_unique<DoubleExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
247  else if (type == "int8")
248  extvars_.push_back(
249  std::make_unique<Int8ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
250  else if (type == "uint8")
251  extvars_.push_back(
252  std::make_unique<UInt8ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
253  else if (type == "int16")
254  extvars_.push_back(
255  std::make_unique<Int16ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
256  else if (type == "uint16")
257  extvars_.push_back(
258  std::make_unique<UInt16ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
259  else if (type == "bool")
260  extvars_.push_back(
261  std::make_unique<BoolExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
262  else
263  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
264  }
265  }
266  }
267 
269 
272 
274  "singleton", false, true, edm::Comment("whether or not the input collection is single-element")),
276  "cut", "", true, edm::Comment("selection on the main input collection")) or
277  true >> edm::EmptyGroupDescription());
278  desc.addOptional<unsigned int>("maxLen")->setComment(
279  "define the maximum length of the input collection to put in the branch");
280 
281  edm::ParameterSetDescription extvariable;
282  extvariable.add<edm::InputTag>("src")->setComment("valuemap input collection to fill the flat table");
283  extvariable.add<std::string>("doc")->setComment("few words description of the branch content");
284  extvariable.ifValue(
286  "type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
287  edm::allowedValues<std::string>("int", "uint", "float", "double", "int8", "uint8", "int16", "uint16", "bool"));
288  extvariable.addOptionalNode(
290  "precision", true, edm::Comment("the precision with which to store the value in the flat table")) xor
292  "precision", true, edm::Comment("the precision with which to store the value in the flat table")),
293  false);
294 
295  edm::ParameterSetDescription extvariables;
296  extvariables.setComment("a parameters set to define all variable taken form valuemap to fill the flat table");
297  extvariables.addOptionalNode(
299  desc.addOptional<edm::ParameterSetDescription>("externalVariables", extvariables);
300 
301  descriptions.addWithDefaultLabel(desc);
302  }
303 
304  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
305  const edm::Handle<edm::View<T>> &prod) const override {
306  std::vector<const T *> selobjs;
307  std::vector<edm::Ptr<T>> selptrs; // for external variables
308  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
309  if (singleton_) {
310  assert(prod->size() == 1);
311  selobjs.push_back(&(*prod)[0]);
312  if (!extvars_.empty())
313  selptrs.emplace_back(prod->ptrAt(0));
314  } else {
315  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
316  const auto &obj = (*prod)[i];
317  if (cut_(obj)) {
318  selobjs.push_back(&obj);
319  if (!extvars_.empty())
320  selptrs.emplace_back(prod->ptrAt(i));
321  }
322  if (selobjs.size() >= maxLen_)
323  break;
324  }
325  }
326  }
327  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, singleton_, this->extension_);
328  for (const auto &var : this->vars_)
329  var->fill(selobjs, *out);
330  for (const auto &var : this->extvars_)
331  var->fill(iEvent, selptrs, *out);
332  return out;
333  }
334 
335 protected:
337  const unsigned int maxLen_;
339 
349  std::vector<std::unique_ptr<ExtVariable<T>>> extvars_;
350 };
351 
352 template <typename T>
354 public:
356 
358 
361  descriptions.addWithDefaultLabel(desc);
362  }
363 
364  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &, const edm::Handle<T> &prod) const override {
365  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
366  std::vector<const T *> selobjs(1, prod.product());
367  for (const auto &var : this->vars_)
368  var->fill(selobjs, *out);
369  return out;
370  }
371 };
372 
373 template <typename T>
375 public:
378 
380 
383  descriptions.addWithDefaultLabel(desc);
384  }
385 
386  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
387  const edm::Handle<edm::View<T>> &prod) const override {
388  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
389  std::vector<const T *> selobjs(1, &(*prod)[0]);
390  for (const auto &var : this->vars_)
391  var->fill(selobjs, *out);
392  return out;
393  }
394 };
395 
396 // LuminosityBlock producers
397 // - ABC
398 // - Singleton
399 // - Collection
400 template <typename T, typename TProd>
402  : public edm::one::EDProducer<edm::EndLuminosityBlockProducer, edm::LuminosityBlockCache<int>> {
403 public:
405  : name_(params.getParameter<std::string>("name")),
406  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
407  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
409 
410  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
411  src_(consumes<TProd, edm::InLumi>(params.getParameter<edm::InputTag>("src"))) {
412  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
413  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
414  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
415  const std::string &type = varPSet.getParameter<std::string>("type");
416  if (type == "int")
417  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
418  else if (type == "float")
419  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
420  else if (type == "uint8")
421  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
422  else if (type == "bool")
423  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
424  else
425  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
426  }
427 
428  produces<nanoaod::FlatTable, edm::Transition::EndLuminosityBlock>();
429  }
430 
432 
433  std::shared_ptr<int> globalBeginLuminosityBlock(edm::LuminosityBlock const &,
434  edm::EventSetup const &) const override {
435  return nullptr;
436  }
437 
439 
440  // this is to be overriden by the child class
441  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &iLumi,
442  const edm::Handle<TProd> &prod) const = 0;
443 
444  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
445  // do nothing
446  }
447 
450  iLumi.getByToken(src_, src);
451 
452  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iLumi, src);
453  out->setDoc(doc_);
454 
455  iLumi.put(std::move(out));
456  }
457 
458 protected:
461  const bool extension_;
464 
469  std::vector<std::unique_ptr<Variable<T>>> vars_;
470 };
471 
472 // Class for singletons like GenFilterInfo
473 template <typename T>
475 public:
478 
480 
483  descriptions.addWithDefaultLabel(desc);
484  }
485 
486  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &,
487  const edm::Handle<T> &prod) const override {
488  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
489  std::vector<const T *> selobjs(1, prod.product());
490  for (const auto &var : this->vars_)
491  var->fill(selobjs, *out);
492  return out;
493  }
494 };
495 
496 // Class for generic collections
497 template <typename T, typename TProd>
499 public:
502  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
503  : std::numeric_limits<unsigned int>::max()),
504  cut_(params.existsAs<std::string>("cut") ? params.getParameter<std::string>("cut") : "", true) {}
505 
507 
510  desc.addOptional<unsigned int>("maxLen")->setComment(
511  "define the maximum length of the input collection to put in the branch");
512  descriptions.addWithDefaultLabel(desc);
513  }
514 
515  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &iLumi,
516  const edm::Handle<TProd> &prod) const override {
517  std::vector<const T *> selobjs;
518  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
519  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
520  const auto &obj = (*prod)[i];
521  if (cut_(obj)) {
522  selobjs.push_back(&obj);
523  }
524  if (selobjs.size() >= maxLen_)
525  break;
526  }
527  }
528  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, false, this->extension_);
529  for (const auto &var : this->vars_)
530  var->fill(selobjs, *out);
531  return out;
532  }
533 
534 protected:
535  const unsigned int maxLen_;
537 };
538 
539 // Run producers
540 // - ABC
541 // - Singleton
542 // - Collection
543 template <typename T, typename TProd>
544 class SimpleFlatTableProducerBaseRun : public edm::one::EDProducer<edm::EndRunProducer, edm::RunCache<int>> {
545 public:
547  : name_(params.getParameter<std::string>("name")),
548  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
549  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
551 
552  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
553  src_(consumes<TProd, edm::InRun>(params.getParameter<edm::InputTag>("src"))) {
554  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
555  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
556  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
557  const std::string &type = varPSet.getParameter<std::string>("type");
558  if (type == "int")
559  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
560  else if (type == "float")
561  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
562  else if (type == "uint8")
563  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
564  else if (type == "bool")
565  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
566  else
567  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
568  }
569 
570  produces<nanoaod::FlatTable, edm::Transition::EndRun>();
571  }
572 
574 
575  std::shared_ptr<int> globalBeginRun(edm::Run const &, edm::EventSetup const &) const override { return nullptr; }
576 
577  void globalEndRun(edm::Run const &, edm::EventSetup const &) override {}
578 
579  // this is to be overriden by the child class
580  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &iRun, const edm::Handle<TProd> &prod) const = 0;
581 
582  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
583  // do nothing
584  }
585 
586  void endRunProduce(edm::Run &iRun, const edm::EventSetup &iSetup) final {
588  iRun.getByToken(src_, src);
589 
590  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iRun, src);
591  out->setDoc(doc_);
592 
593  iRun.put(std::move(out));
594  }
595 
596 protected:
599  const bool extension_;
602 
607  std::vector<std::unique_ptr<Variable<T>>> vars_;
608 };
609 
610 // Class for singletons like GenFilterInfo
611 template <typename T>
613 public:
615 
617 
618  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &, const edm::Handle<T> &prod) const override {
619  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
620  std::vector<const T *> selobjs(1, prod.product());
621  for (const auto &var : this->vars_)
622  var->fill(selobjs, *out);
623  return out;
624  }
625 };
626 
627 // Class for generic collections
628 template <typename T, typename TProd>
630 public:
633  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
634  : std::numeric_limits<unsigned int>::max()),
635  cut_(params.existsAs<std::string>("cut") ? params.getParameter<std::string>("cut") : "", true) {}
636 
638 
639  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &iRun, const edm::Handle<TProd> &prod) const override {
640  std::vector<const T *> selobjs;
641  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
642  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
643  const auto &obj = (*prod)[i];
644  if (cut_(obj)) {
645  selobjs.push_back(&obj);
646  }
647  if (selobjs.size() >= maxLen_)
648  break;
649  }
650  }
651  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, false, this->extension_);
652  for (const auto &var : this->vars_)
653  var->fill(selobjs, *out);
654  return out;
655  }
656 
657 protected:
658  const unsigned int maxLen_;
660 };
ValueMapVariable< T, double, float > DoubleExtVar
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Variable(const std::string &aname, const edm::ParameterSet &cfg)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ValueMapVariable< T, int, uint16_t > UInt16ExtVar
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ValueMapVariable< T, bool > BoolExtVar
FuncVariable< T, StringObjectFunction< T >, int > IntVar
std::vector< std::unique_ptr< Variable< T > > > vars_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::LuminosityBlock &, const edm::Handle< T > &prod) const override
FuncVariable< T, StringCutObjectSelector< T >, bool > BoolVar
virtual void fill(const edm::Event &iEvent, std::vector< edm::Ptr< ObjType >> selptrs, nanoaod::FlatTable &out) const =0
std::shared_ptr< int > globalBeginRun(edm::Run const &, edm::EventSetup const &) const override
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
ValueMapVariable< T, int, uint8_t > UInt8ExtVar
const edm::EDGetTokenT< TProd > src_
void globalEndRun(edm::Run const &, edm::EventSetup const &) override
const StringCutObjectSelector< T > cut_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Event &iEvent, const edm::Handle< edm::View< T >> &prod) const override
FuncVariable< T, StringObjectFunction< T >, uint32_t > UIntVar
FuncVariable< T, StringObjectFunction< T >, uint8_t > UInt8Var
FuncVariable< T, StringCutObjectSelector< T >, bool > BoolVar
assert(be >=bs)
VariableBase(const std::string &aname, const edm::ParameterSet &cfg)
FuncVariable< T, StringObjectFunction< T >, uint16_t > UInt16Var
SimpleFlatTableProducerBase(edm::ParameterSet const &params)
ValueMapVariable< T, uint32_t > UIntExtVar
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ValueMapVariable< T, int, int8_t > Int8ExtVar
virtual std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Run &iRun, const edm::Handle< TProd > &prod) const =0
ValueMapVariable< T, int, int16_t > Int16ExtVar
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Event &, const edm::Handle< T > &prod) const override
FuncVariable< T, StringObjectFunction< T >, uint8_t > UInt8Var
void setComment(std::string const &value)
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::LuminosityBlock &iLumi, const edm::Handle< TProd > &prod) const override
const StringCutObjectSelector< T > cut_
void fill(const edm::Event &iEvent, std::vector< edm::Ptr< ObjType >> selptrs, nanoaod::FlatTable &out) const override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
FuncVariable< T, StringObjectFunction< T >, int16_t > Int16Var
FuncVariable< T, StringObjectFunction< T >, float > FloatVar
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
static const std::string & name()
Definition: ClassName.h:38
std::vector< std::unique_ptr< ExtVariable< T > > > extvars_
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
LumiSingletonSimpleFlatTableProducer(edm::ParameterSet const &params)
RunSingletonSimpleFlatTableProducer(edm::ParameterSet const &params)
edm::EDGetTokenT< edm::ValueMap< TIn > > token_
ExtVariable(const std::string &aname, const edm::ParameterSet &cfg)
SimpleFlatTableProducer(edm::ParameterSet const &params)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Run &iRun, const edm::Handle< TProd > &prod) const override
FuncVariable< T, StringObjectFunction< T >, int8_t > Int8Var
void endRunProduce(edm::Run &iRun, const edm::EventSetup &iSetup) final
const edm::EDGetTokenT< TProd > src_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FuncVariable< T, StringObjectFunction< T >, float > FloatVar
FuncVariable< T, StringObjectFunction< T >, int32_t > IntVar
void fill(std::vector< const ObjType *> &selobjs, nanoaod::FlatTable &out) const override
FuncVariable< T, StringObjectFunction< T >, int > IntVar
StringFunctor precisionFunc_
RunSimpleFlatTableProducer(edm::ParameterSet const &params)
const std::string & name() const
SimpleFlatTableProducerBaseRun(edm::ParameterSet const &params)
FuncVariable< T, StringObjectFunction< T >, uint8_t > UInt8Var
FuncVariable< T, StringObjectFunction< T >, float > FloatVar
SimpleFlatTableProducerBaseLumi(edm::ParameterSet const &params)
virtual std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Event &iEvent, const edm::Handle< TProd > &prod) const =0
FuncVariable< T, StringObjectFunction< T >, double > DoubleVar
std::vector< std::unique_ptr< Variable< T > > > vars_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::shared_ptr< int > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Event &iEvent, const edm::Handle< edm::View< T >> &prod) const override
bool isValid() const
Definition: HandleBase.h:70
static float reduceMantissaToNbitsRounding(const float &f)
Definition: libminifloat.h:79
HLT enums.
ValueMapVariable(const std::string &aname, const edm::ParameterSet &cfg, edm::ConsumesCollector &&cc, bool skipNonExistingSrc=false)
FirstObjectSimpleFlatTableProducer(edm::ParameterSet const &params)
EventSingletonSimpleFlatTableProducer(edm::ParameterSet const &params)
ValueMapVariable< T, float > FloatExtVar
FuncVariable(const std::string &aname, const edm::ParameterSet &cfg)
virtual void fill(std::vector< const ObjType *> &selobjs, nanoaod::FlatTable &out) const =0
ValueMapVariable< T, int32_t > IntExtVar
std::vector< std::unique_ptr< Variable< T > > > vars_
LumiSimpleFlatTableProducer(edm::ParameterSet const &params)
long double T
std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Run &, const edm::Handle< T > &prod) const override
void endLuminosityBlockProduce(edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) final
const StringCutObjectSelector< T > cut_
FuncVariable< T, StringCutObjectSelector< T >, bool > BoolVar
def move(src, dest)
Definition: eostools.py:511
virtual std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::LuminosityBlock &iLumi, const edm::Handle< TProd > &prod) const =0
Definition: Run.h:45
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< TProd > src_
static edm::ParameterSetDescription baseDescriptions()