CMS 3D CMS Logo

SimpleFlatTableProducer.h
Go to the documentation of this file.
8 
11 
12 #include <memory>
13 #include <vector>
14 
15 // Base class for dumped variables
16 class VariableBase {
17 public:
19  : name_(aname),
20  doc_(cfg.getParameter<std::string>("doc")),
21  precision_(cfg.existsAs<int>("precision") ? cfg.getParameter<int>("precision")
22  : (cfg.existsAs<std::string>("precision") ? -2 : -1)) {}
23  virtual ~VariableBase() {}
24  const std::string &name() const { return name_; }
25 
26 protected:
29 };
30 
31 // Object member variables and methods
32 template <typename ObjType>
33 class Variable : public VariableBase {
34 public:
35  Variable(const std::string &aname, const edm::ParameterSet &cfg) : VariableBase(aname, cfg) {}
36  virtual void fill(std::vector<const ObjType *> &selobjs, nanoaod::FlatTable &out) const = 0;
37 };
38 
39 template <typename ObjType, typename StringFunctor, typename ValType>
40 class FuncVariable : public Variable<ObjType> {
41 public:
43  : Variable<ObjType>(aname, cfg),
44  func_(cfg.getParameter<std::string>("expr"), true),
45  precisionFunc_(cfg.existsAs<std::string>("precision") ? cfg.getParameter<std::string>("precision") : "23",
46  true) {}
47  ~FuncVariable() override {}
48  void fill(std::vector<const ObjType *> &selobjs, nanoaod::FlatTable &out) const override {
49  std::vector<ValType> vals(selobjs.size());
50  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
51  if constexpr (std::is_same<ValType, float>()) {
52  if (this->precision_ == -2) {
54  } else {
55  vals[i] = func_(*selobjs[i]);
56  }
57  } else {
58  vals[i] = func_(*selobjs[i]);
59  }
60  }
61  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
62  }
63 
64 protected:
65  StringFunctor func_;
66  StringFunctor precisionFunc_;
67 };
68 
69 // External variables: i.e. variables that are not member or methods of the object
70 template <typename ObjType>
71 class ExtVariable : public VariableBase {
72 public:
73  ExtVariable(const std::string &aname, const edm::ParameterSet &cfg) : VariableBase(aname, cfg) {}
74  virtual void fill(const edm::Event &iEvent,
76  nanoaod::FlatTable &out) const = 0;
77 };
78 template <typename ObjType, typename TIn, typename ValType = TIn>
79 class ValueMapVariable : public ExtVariable<ObjType> {
80 public:
82  const edm::ParameterSet &cfg,
84  bool skipNonExistingSrc = false)
85  : ExtVariable<ObjType>(aname, cfg),
87  token_(cc.consumes<edm::ValueMap<TIn>>(cfg.getParameter<edm::InputTag>("src"))) {}
88  void fill(const edm::Event &iEvent, std::vector<edm::Ptr<ObjType>> selptrs, nanoaod::FlatTable &out) const override {
90  iEvent.getByToken(token_, vmap);
91  std::vector<ValType> vals;
92  if (vmap.isValid() || !skipNonExistingSrc_) {
93  vals.resize(selptrs.size());
94  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
95  vals[i] = (*vmap)[selptrs[i]];
96  }
97  }
98  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
99  }
100 
101 protected:
104 };
105 
106 // Event producers
107 // - ABC
108 // - Singleton
109 // - Collection
110 template <typename T, typename TProd>
112 public:
114  : name_(params.getParameter<std::string>("name")),
115  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
116  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
118  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
119  src_(consumes<TProd>(params.getParameter<edm::InputTag>("src"))) {
120  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
121  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
122  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
123  const std::string &type = varPSet.getParameter<std::string>("type");
124  if (type == "int")
125  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
126  else if (type == "uint")
127  vars_.push_back(std::make_unique<UIntVar>(vname, varPSet));
128  else if (type == "float")
129  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
130  else if (type == "int8")
131  vars_.push_back(std::make_unique<Int8Var>(vname, varPSet));
132  else if (type == "uint8")
133  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
134  else if (type == "bool")
135  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
136  else
137  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
138  }
139 
140  produces<nanoaod::FlatTable>();
141  }
142 
144 
145  // this is to be overriden by the child class
146  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
147  const edm::Handle<TProd> &prod) const = 0;
148 
149  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
151  iEvent.getByToken(src_, src);
152 
153  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iEvent, src);
154  out->setDoc(doc_);
155 
156  iEvent.put(std::move(out));
157  }
158 
159 protected:
162  const bool extension_;
165 
172  std::vector<std::unique_ptr<Variable<T>>> vars_;
173 };
174 
175 template <typename T>
176 class SimpleFlatTableProducer : public SimpleFlatTableProducerBase<T, edm::View<T>> {
177 public:
180  singleton_(params.getParameter<bool>("singleton")),
181  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
182  : std::numeric_limits<unsigned int>::max()),
183  cut_(!singleton_ ? params.getParameter<std::string>("cut") : "", true) {
184  if (params.existsAs<edm::ParameterSet>("externalVariables")) {
185  edm::ParameterSet const &extvarsPSet = params.getParameter<edm::ParameterSet>("externalVariables");
186  for (const std::string &vname : extvarsPSet.getParameterNamesForType<edm::ParameterSet>()) {
187  const auto &varPSet = extvarsPSet.getParameter<edm::ParameterSet>(vname);
188  const std::string &type = varPSet.getParameter<std::string>("type");
189  if (type == "int")
190  extvars_.push_back(
191  std::make_unique<IntExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
192  else if (type == "float")
193  extvars_.push_back(
194  std::make_unique<FloatExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
195  else if (type == "double")
196  extvars_.push_back(
197  std::make_unique<DoubleExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
198  else if (type == "int8")
199  extvars_.push_back(
200  std::make_unique<Int8ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
201  else if (type == "uint8")
202  extvars_.push_back(
203  std::make_unique<UInt8ExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
204  else if (type == "bool")
205  extvars_.push_back(
206  std::make_unique<BoolExtVar>(vname, varPSet, this->consumesCollector(), this->skipNonExistingSrc_));
207  else
208  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
209  }
210  }
211  }
212 
214 
215  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
216  const edm::Handle<edm::View<T>> &prod) const override {
217  std::vector<const T *> selobjs;
218  std::vector<edm::Ptr<T>> selptrs; // for external variables
219  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
220  if (singleton_) {
221  assert(prod->size() == 1);
222  selobjs.push_back(&(*prod)[0]);
223  if (!extvars_.empty())
224  selptrs.emplace_back(prod->ptrAt(0));
225  } else {
226  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
227  const auto &obj = (*prod)[i];
228  if (cut_(obj)) {
229  selobjs.push_back(&obj);
230  if (!extvars_.empty())
231  selptrs.emplace_back(prod->ptrAt(i));
232  }
233  if (selobjs.size() >= maxLen_)
234  break;
235  }
236  }
237  }
238  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, singleton_, this->extension_);
239  for (const auto &var : this->vars_)
240  var->fill(selobjs, *out);
241  for (const auto &var : this->extvars_)
242  var->fill(iEvent, selptrs, *out);
243  return out;
244  }
245 
246 protected:
248  const unsigned int maxLen_;
250 
257  std::vector<std::unique_ptr<ExtVariable<T>>> extvars_;
258 };
259 
260 template <typename T>
262 public:
264 
266 
267  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &, const edm::Handle<T> &prod) const override {
268  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
269  std::vector<const T *> selobjs(1, prod.product());
270  for (const auto &var : this->vars_)
271  var->fill(selobjs, *out);
272  return out;
273  }
274 };
275 
276 template <typename T>
278 public:
281 
283 
284  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Event &iEvent,
285  const edm::Handle<edm::View<T>> &prod) const override {
286  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
287  std::vector<const T *> selobjs(1, &(*prod)[0]);
288  for (const auto &var : this->vars_)
289  var->fill(selobjs, *out);
290  return out;
291  }
292 };
293 
294 // LuminosityBlock producers
295 // - ABC
296 // - Singleton
297 // - Collection
298 template <typename T, typename TProd>
300  : public edm::one::EDProducer<edm::EndLuminosityBlockProducer, edm::LuminosityBlockCache<int>> {
301 public:
303  : name_(params.getParameter<std::string>("name")),
304  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
305  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
307 
308  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
309  src_(consumes<TProd, edm::InLumi>(params.getParameter<edm::InputTag>("src"))) {
310  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
311  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
312  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
313  const std::string &type = varPSet.getParameter<std::string>("type");
314  if (type == "int")
315  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
316  else if (type == "float")
317  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
318  else if (type == "uint8")
319  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
320  else if (type == "bool")
321  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
322  else
323  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
324  }
325 
326  produces<nanoaod::FlatTable, edm::Transition::EndLuminosityBlock>();
327  }
328 
330 
331  std::shared_ptr<int> globalBeginLuminosityBlock(edm::LuminosityBlock const &,
332  edm::EventSetup const &) const override {
333  return nullptr;
334  }
335 
337 
338  // this is to be overriden by the child class
339  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &iLumi,
340  const edm::Handle<TProd> &prod) const = 0;
341 
342  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
343  // do nothing
344  }
345 
348  iLumi.getByToken(src_, src);
349 
350  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iLumi, src);
351  out->setDoc(doc_);
352 
353  iLumi.put(std::move(out));
354  }
355 
356 protected:
359  const bool extension_;
362 
367  std::vector<std::unique_ptr<Variable<T>>> vars_;
368 };
369 
370 // Class for singletons like GenFilterInfo
371 template <typename T>
373 public:
376 
378 
379  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &,
380  const edm::Handle<T> &prod) const override {
381  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
382  std::vector<const T *> selobjs(1, prod.product());
383  for (const auto &var : this->vars_)
384  var->fill(selobjs, *out);
385  return out;
386  }
387 };
388 
389 // Class for generic collections
390 template <typename T, typename TProd>
392 public:
395  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
396  : std::numeric_limits<unsigned int>::max()),
397  cut_(params.existsAs<std::string>("cut") ? params.getParameter<std::string>("cut") : "", true) {}
398 
400 
401  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::LuminosityBlock &iLumi,
402  const edm::Handle<TProd> &prod) const override {
403  std::vector<const T *> selobjs;
404  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
405  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
406  const auto &obj = (*prod)[i];
407  if (cut_(obj)) {
408  selobjs.push_back(&obj);
409  }
410  if (selobjs.size() >= maxLen_)
411  break;
412  }
413  }
414  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, false, this->extension_);
415  for (const auto &var : this->vars_)
416  var->fill(selobjs, *out);
417  return out;
418  }
419 
420 protected:
421  const unsigned int maxLen_;
423 };
424 
425 // Run producers
426 // - ABC
427 // - Singleton
428 // - Collection
429 template <typename T, typename TProd>
430 class SimpleFlatTableProducerBaseRun : public edm::one::EDProducer<edm::EndRunProducer, edm::RunCache<int>> {
431 public:
433  : name_(params.getParameter<std::string>("name")),
434  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
435  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
437 
438  params.existsAs<bool>("skipNonExistingSrc") ? params.getParameter<bool>("skipNonExistingSrc") : false),
439  src_(consumes<TProd, edm::InRun>(params.getParameter<edm::InputTag>("src"))) {
440  edm::ParameterSet const &varsPSet = params.getParameter<edm::ParameterSet>("variables");
441  for (const std::string &vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
442  const auto &varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
443  const std::string &type = varPSet.getParameter<std::string>("type");
444  if (type == "int")
445  vars_.push_back(std::make_unique<IntVar>(vname, varPSet));
446  else if (type == "float")
447  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet));
448  else if (type == "uint8")
449  vars_.push_back(std::make_unique<UInt8Var>(vname, varPSet));
450  else if (type == "bool")
451  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet));
452  else
453  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
454  }
455 
456  produces<nanoaod::FlatTable, edm::Transition::EndRun>();
457  }
458 
460 
461  std::shared_ptr<int> globalBeginRun(edm::Run const &, edm::EventSetup const &) const override { return nullptr; }
462 
463  void globalEndRun(edm::Run const &, edm::EventSetup const &) override {}
464 
465  // this is to be overriden by the child class
466  virtual std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &iRun, const edm::Handle<TProd> &prod) const = 0;
467 
468  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override {
469  // do nothing
470  }
471 
472  void endRunProduce(edm::Run &iRun, const edm::EventSetup &iSetup) final {
474  iRun.getByToken(src_, src);
475 
476  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iRun, src);
477  out->setDoc(doc_);
478 
479  iRun.put(std::move(out));
480  }
481 
482 protected:
485  const bool extension_;
488 
493  std::vector<std::unique_ptr<Variable<T>>> vars_;
494 };
495 
496 // Class for singletons like GenFilterInfo
497 template <typename T>
499 public:
501 
503 
504  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &, const edm::Handle<T> &prod) const override {
505  auto out = std::make_unique<nanoaod::FlatTable>(1, this->name_, true, this->extension_);
506  std::vector<const T *> selobjs(1, prod.product());
507  for (const auto &var : this->vars_)
508  var->fill(selobjs, *out);
509  return out;
510  }
511 };
512 
513 // Class for generic collections
514 template <typename T, typename TProd>
516 public:
519  maxLen_(params.existsAs<unsigned int>("maxLen") ? params.getParameter<unsigned int>("maxLen")
520  : std::numeric_limits<unsigned int>::max()),
521  cut_(params.existsAs<std::string>("cut") ? params.getParameter<std::string>("cut") : "", true) {}
522 
524 
525  std::unique_ptr<nanoaod::FlatTable> fillTable(const edm::Run &iRun, const edm::Handle<TProd> &prod) const override {
526  std::vector<const T *> selobjs;
527  if (prod.isValid() || !(this->skipNonExistingSrc_)) {
528  for (unsigned int i = 0, n = prod->size(); i < n; ++i) {
529  const auto &obj = (*prod)[i];
530  if (cut_(obj)) {
531  selobjs.push_back(&obj);
532  }
533  if (selobjs.size() >= maxLen_)
534  break;
535  }
536  }
537  auto out = std::make_unique<nanoaod::FlatTable>(selobjs.size(), this->name_, false, this->extension_);
538  for (const auto &var : this->vars_)
539  var->fill(selobjs, *out);
540  return out;
541  }
542 
543 protected:
544  const unsigned int maxLen_;
546 };
ValueMapVariable< T, double, float > DoubleExtVar
Variable(const std::string &aname, const edm::ParameterSet &cfg)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ValueMapVariable< T, bool > BoolExtVar
FuncVariable< T, StringObjectFunction< T >, int > IntVar
std::vector< std::unique_ptr< Variable< T > > > vars_
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 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
FuncVariable< T, StringObjectFunction< T >, float > FloatVar
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
std::vector< std::unique_ptr< ExtVariable< T > > > extvars_
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)
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_
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_
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
const edm::EDGetTokenT< TProd > src_
ValueMapVariable< T, int > IntExtVar