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  if constexpr (std::is_same<ValType, float>()) {
57  if (this->precision_ == -2) {
59  } else {
60  vals[i] = func_(*selobjs[i]);
61  }
62  } else {
63  vals[i] = func_(*selobjs[i]);
64  }
65  }
66  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
67  }
68 
69 protected:
70  StringFunctor func_;
71  StringFunctor precisionFunc_;
72 };
73 
74 // External variables: i.e. variables that are not member or methods of the object
75 template <typename ObjType>
76 class ExtVariable : public VariableBase {
77 public:
78  ExtVariable(const std::string &aname, const edm::ParameterSet &cfg) : VariableBase(aname, cfg) {}
79  virtual void fill(const edm::Event &iEvent,
81  nanoaod::FlatTable &out) const = 0;
82 };
83 template <typename ObjType, typename TIn, typename ValType = TIn>
84 class ValueMapVariable : public ExtVariable<ObjType> {
85 public:
87  const edm::ParameterSet &cfg,
89  bool skipNonExistingSrc = false)
90  : ExtVariable<ObjType>(aname, cfg),
92  token_(cc.consumes<edm::ValueMap<TIn>>(cfg.getParameter<edm::InputTag>("src"))) {}
93  void fill(const edm::Event &iEvent, std::vector<edm::Ptr<ObjType>> selptrs, nanoaod::FlatTable &out) const override {
95  iEvent.getByToken(token_, vmap);
96  std::vector<ValType> vals;
97  if (vmap.isValid() || !skipNonExistingSrc_) {
98  vals.resize(selptrs.size());
99  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
100  vals[i] = (*vmap)[selptrs[i]];
101  }
102  }
103  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
104  }
105 
106 protected:
109 };
110 
111 // Event producers
112 // - ABC
113 // - Singleton
114 // - Collection
115 template <typename T, typename TProd>
117 public:
119  : name_(params.getParameter<std::string>("name")),
120  doc_(params.getParameter<std::string>("doc")),
121  extension_(params.getParameter<bool>("extension")),
122  skipNonExistingSrc_(params.getParameter<bool>("skipNonExistingSrc")),
123  src_(consumes<TProd>(params.getParameter<edm::InputTag>("src"))) {
124  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
125  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
126  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
127  const std::string &type = varPSet.getParameter<std::string>("type");
128  if (type == "int")
129  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
130  else if (type == "uint")
131  vars_.push_back(std::make_unique<UIntVar>(vname, varPSet));
132  else if (type == "float")
133  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
134  else if (type == "int8")
135  vars_.push_back(std::make_unique<Int8Var>(vname, varPSet));
136  else if (type == "uint8")
137  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
138  else if (type == "bool")
139  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
140  else
141  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
142  }
143 
144  produces<nanoaod::FlatTable>();
145  }
146 
148 
152  desc.add<std::string>("name")->setComment("name of the branch in the flat table output for " + classname);
153  desc.add<std::string>("doc", "")->setComment("few words of self documentation");
154  desc.add<bool>("extension", false)->setComment("whether or not to extend an existing same table");
155  desc.add<bool>("skipNonExistingSrc", false)
156  ->setComment("whether or not to skip producing the table on absent input product");
157  desc.add<edm::InputTag>("src")->setComment("input collection to fill the flat table");
158 
160  variable.add<std::string>("expr")->setComment("a function to define the content of the branch in the flat table");
161  variable.add<std::string>("doc")->setComment("few words description of the branch content");
163  "type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
164  edm::allowedValues<std::string>("int", "unit", "float", "int8", "uint8", "bool"));
165  variable.addOptionalNode(
167  "precision", true, edm::Comment("the precision with which to store the value in the flat table")) xor
169  "precision", true, edm::Comment("the precision with which to store the value in the flat table")),
170  false);
171 
173  variables.setComment("a parameters set to define all variable to fill the flat table");
174  variables.addNode(
176  desc.add<edm::ParameterSetDescription>("variables", variables);
177 
178  return desc;
179  }
180  // this is to be overriden by the child class
181  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
182  const edm::Handle<TProd> &prod) const = 0;
183 
184  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
186  iEvent.getByToken(src_, src);
187 
188  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iEvent, src);
189  out->setDoc(doc_);
190 
191  iEvent.put(std::move(out));
192  }
193 
194 protected:
197  const bool extension_;
200 
207  std::vector<std::unique_ptr<Variable<T>>> vars_;
208 };
209 
210 template <typename T>
211 class SimpleFlatTableProducer : public SimpleFlatTableProducerBase<T, edm::View<T>> {
212 public:
215  singleton_(params.getParameter<bool>("singleton")),
216  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
217  : std::numeric_limits<unsigned int>::max()),
218  cut_(!singleton_ ? params.getParameter<std::string>("cut") : "", true) {
219  if (params.existsAs<edm::ParameterSet>("externalVariables")) {
220  edm::ParameterSet const &extvarsPSet = params.getParameter<edm::ParameterSet>("externalVariables");
221  for (const std::string &vname : extvarsPSet.getParameterNamesForType<edm::ParameterSet>()) {
222  const auto &varPSet = extvarsPSet.getParameter<edm::ParameterSet>(vname);
223  const std::string &type = varPSet.getParameter<std::string>("type");
224  if (type == "int")
225  extvars_.push_back(
226  std::make_unique<IntExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
227  else if (type == "float")
228  extvars_.push_back(
229  std::make_unique<FloatExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
230  else if (type == "double")
231  extvars_.push_back(
232  std::make_unique<DoubleExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
233  else if (type == "int8")
234  extvars_.push_back(
235  std::make_unique<Int8ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
236  else if (type == "uint8")
237  extvars_.push_back(
238  std::make_unique<UInt8ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
239  else if (type == "bool")
240  extvars_.push_back(
241  std::make_unique<BoolExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
242  else
243  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
244  }
245  }
246  }
247 
249 
252 
254  "singleton", false, true, edm::Comment("whether or not the input collection is single-element")),
256  "cut", "", true, edm::Comment("selection on the main input collection")) or
257  true >> edm::EmptyGroupDescription());
258  desc.addOptional<unsigned int>("maxLen")->setComment(
259  "define the maximum length of the input collection to put in the branch");
260 
261  edm::ParameterSetDescription extvariable;
262  extvariable.add<edm::InputTag>("src")->setComment("valuemap input collection to fill the flat table");
263  extvariable.add<std::string>("doc")->setComment("few words description of the branch content");
265  "type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
266  edm::allowedValues<std::string>("int", "unit", "float", "int8", "uint8", "bool"));
267  extvariable.addOptionalNode(
269  "precision", true, edm::Comment("the precision with which to store the value in the flat table")) xor
271  "precision", true, edm::Comment("the precision with which to store the value in the flat table")),
272  false);
273 
274  edm::ParameterSetDescription extvariables;
275  extvariables.setComment("a parameters set to define all variable taken form valuemap to fill the flat table");
276  extvariables.addOptionalNode(
278  desc.addOptional<edm::ParameterSetDescription>("externalVariables", extvariables);
279 
280  descriptions.addWithDefaultLabel(desc);
281  }
282 
283  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
284  const edm::Handle<edm::View<T>> &prod) const override {
285  std::vector<const T *> selobjs;
286  std::vector<edm::Ptr<T>> selptrs; // for external variables
287  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
288  if (singleton_) {
289  assert(prod->size() == 1);
290  selobjs.push_back(&(*prod)[0]);
291  if (!extvars_.empty())
292  selptrs.emplace_back(prod->ptrAt(0));
293  } else {
294  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
295  const auto &obj = (*prod)[i];
296  if (cut_(obj)) {
297  selobjs.push_back(&obj);
298  if (!extvars_.empty())
299  selptrs.emplace_back(prod->ptrAt(i));
300  }
301  if (selobjs.size() >= maxLen_)
302  break;
303  }
304  }
305  }
306  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, singleton_, this->extension_);
307  for (const auto &var : this->vars_)
308  var->fill(selobjs, *out);
309  for (const auto &var : this->extvars_)
310  var->fill(iEvent, selptrs, *out);
311  return out;
312  }
313 
314 protected:
316  const unsigned int maxLen_;
318 
325  std::vector<std::unique_ptr<ExtVariable<T>>> extvars_;
326 };
327 
328 template <typename T>
330 public:
332 
334 
337  descriptions.addWithDefaultLabel(desc);
338  }
339 
340  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &, const edm::Handle<T> &prod) const override {
341  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
342  std::vector<const T *> selobjs(1, prod.product());
343  for (const auto &var : this->vars_)
344  var->fill(selobjs, *out);
345  return out;
346  }
347 };
348 
349 template <typename T>
351 public:
354 
356 
359  descriptions.addWithDefaultLabel(desc);
360  }
361 
362  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
363  const edm::Handle<edm::View<T>> &prod) const override {
364  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
365  std::vector<const T *> selobjs(1, &(*prod)[0]);
366  for (const auto &var : this->vars_)
367  var->fill(selobjs, *out);
368  return out;
369  }
370 };
371 
372 // LuminosityBlock producers
373 // - ABC
374 // - Singleton
375 // - Collection
376 template <typename T, typename TProd>
378  : public edm::one::EDProducer<edm::EndLuminosityBlockProducer, edm::LuminosityBlockCache<int>> {
379 public:
381  : name_(params.getParameter<std::string>("name")),
382  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
383  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
385 
386  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
387  src_(consumes<TProd, edm::InLumi>(params.getParameter<edm::InputTag>("src"))) {
388  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
389  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
390  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
391  const std::string &type = varPSet.getParameter<std::string>("type");
392  if (type == "int")
393  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
394  else if (type == "float")
395  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
396  else if (type == "uint8")
397  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
398  else if (type == "bool")
399  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
400  else
401  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
402  }
403 
404  produces<nanoaod::FlatTable, edm::Transition::EndLuminosityBlock>();
405  }
406 
408 
409  std::shared_ptr<int> globalBeginLuminosityBlock(edm::LuminosityBlock const &,
410  edm::EventSetup const &) const override {
411  return nullptr;
412  }
413 
415 
416  // this is to be overriden by the child class
417  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &iLumi,
418  const edm::Handle<TProd> &prod) const = 0;
419 
420  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
421  // do nothing
422  }
423 
426  iLumi.getByToken(src_, src);
427 
428  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iLumi, src);
429  out->setDoc(doc_);
430 
431  iLumi.put(std::move(out));
432  }
433 
434 protected:
437  const bool extension_;
440 
445  std::vector<std::unique_ptr<Variable<T>>> vars_;
446 };
447 
448 // Class for singletons like GenFilterInfo
449 template <typename T>
451 public:
454 
456 
459  descriptions.addWithDefaultLabel(desc);
460  }
461 
462  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &,
463  const edm::Handle<T> &prod) const override {
464  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
465  std::vector<const T *> selobjs(1, prod.product());
466  for (const auto &var : this->vars_)
467  var->fill(selobjs, *out);
468  return out;
469  }
470 };
471 
472 // Class for generic collections
473 template <typename T, typename TProd>
475 public:
478  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
479  : std::numeric_limits<unsigned int>::max()),
480  cut_(params.existsAs<std::string>("cut") ? params.getParameter<std::string>("cut") : "", true) {}
481 
483 
486  desc.addOptional<unsigned int>("maxLen")->setComment(
487  "define the maximum length of the input collection to put in the branch");
488  descriptions.addWithDefaultLabel(desc);
489  }
490 
491  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &iLumi,
492  const edm::Handle<TProd> &prod) const override {
493  std::vector<const T *> selobjs;
494  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
495  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
496  const auto &obj = (*prod)[i];
497  if (cut_(obj)) {
498  selobjs.push_back(&obj);
499  }
500  if (selobjs.size() >= maxLen_)
501  break;
502  }
503  }
504  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, false, this->extension_);
505  for (const auto &var : this->vars_)
506  var->fill(selobjs, *out);
507  return out;
508  }
509 
510 protected:
511  const unsigned int maxLen_;
513 };
514 
515 // Run producers
516 // - ABC
517 // - Singleton
518 // - Collection
519 template <typename T, typename TProd>
520 class SimpleFlatTableProducerBaseRun : public edm::one::EDProducer<edm::EndRunProducer, edm::RunCache<int>> {
521 public:
523  : name_(params.getParameter<std::string>("name")),
524  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
525  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
527 
528  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
529  src_(consumes<TProd, edm::InRun>(params.getParameter<edm::InputTag>("src"))) {
530  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
531  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
532  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
533  const std::string &type = varPSet.getParameter<std::string>("type");
534  if (type == "int")
535  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
536  else if (type == "float")
537  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
538  else if (type == "uint8")
539  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
540  else if (type == "bool")
541  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
542  else
543  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
544  }
545 
546  produces<nanoaod::FlatTable, edm::Transition::EndRun>();
547  }
548 
550 
551  std::shared_ptr<int> globalBeginRun(edm::Run const &, edm::EventSetup const &) const override { return nullptr; }
552 
553  void globalEndRun(edm::Run const &, edm::EventSetup const &) override {}
554 
555  // this is to be overriden by the child class
556  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &iRun, const edm::Handle<TProd> &prod) const = 0;
557 
558  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
559  // do nothing
560  }
561 
562  void endRunProduce(edm::Run &iRun, const edm::EventSetup &iSetup) final {
564  iRun.getByToken(src_, src);
565 
566  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iRun, src);
567  out->setDoc(doc_);
568 
569  iRun.put(std::move(out));
570  }
571 
572 protected:
575  const bool extension_;
578 
583  std::vector<std::unique_ptr<Variable<T>>> vars_;
584 };
585 
586 // Class for singletons like GenFilterInfo
587 template <typename T>
589 public:
591 
593 
594  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &, const edm::Handle<T> &prod) const override {
595  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
596  std::vector<const T *> selobjs(1, prod.product());
597  for (const auto &var : this->vars_)
598  var->fill(selobjs, *out);
599  return out;
600  }
601 };
602 
603 // Class for generic collections
604 template <typename T, typename TProd>
606 public:
609  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
610  : std::numeric_limits<unsigned int>::max()),
611  cut_(params.existsAs<std::string>("cut") ? params.getParameter<std::string>("cut") : "", true) {}
612 
614 
615  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &iRun, const edm::Handle<TProd> &prod) const override {
616  std::vector<const T *> selobjs;
617  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
618  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
619  const auto &obj = (*prod)[i];
620  if (cut_(obj)) {
621  selobjs.push_back(&obj);
622  }
623  if (selobjs.size() >= maxLen_)
624  break;
625  }
626  }
627  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, false, this->extension_);
628  for (const auto &var : this->vars_)
629  var->fill(selobjs, *out);
630  return out;
631  }
632 
633 protected:
634  const unsigned int maxLen_;
636 };
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
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
ValueMapVariable< T, int, uint8_t > UInt8ExtVar
const edm::EDGetTokenT< TProd > src_
FuncVariable< T, StringObjectFunction< T >, unsigned int > UIntVar
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 >, uint8_t > UInt8Var
FuncVariable< T, StringCutObjectSelector< T >, bool > BoolVar
assert(be >=bs)
VariableBase(const std::string &aname, const edm::ParameterSet &cfg)
SimpleFlatTableProducerBase(edm::ParameterSet const &params)
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
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 >, 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
void fill(std::vector< const ObjType *> &selobjs, nanoaod::FlatTable &out) const override
FuncVariable< T, StringObjectFunction< T >, int > IntVar
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
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
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()
ValueMapVariable< T, int > IntExtVar