CMS 3D CMS Logo

CachingVariable.h
Go to the documentation of this file.
1 #ifndef ConfigurableAnalysis_CachingVariable_H
2 #define ConfigurableAnalysis_CachingVariable_H
3 
12 
14 
15 namespace edm {
16  class EventSetup;
17 }
18 #include <vector>
19 #include "TString.h"
20 
21 class Description {
22 public:
24  Description(std::vector<std::string>& d) : d_(d) {}
25  std::string text() const {
27  for (unsigned int i = 0; i != d_.size(); ++i)
28  text += d_[i] + "\n";
29  return text;
30  }
31  const std::vector<std::string> lines() { return d_; }
32  void addLine(const std::string& l) { d_.push_back(l); }
33 
34 private:
35  std::vector<std::string> d_;
36 };
37 
38 class VariableComputer;
39 
41 public:
42  //every variable return double values
43  typedef double valueType;
44  typedef std::pair<bool, valueType> evalType;
45  typedef std::map<std::string, const CachingVariable*> vMap;
49  : n(N), m(M), iConfig(P) {}
53  };
54 
56  : cache_(std::make_pair(false, 0)), method_(m), name_(n), conf_(iConfig) {}
57 
58  virtual ~CachingVariable() {}
59 
60  //does the variable computes
61  bool compute(const edm::Event& iEvent) const { return baseEval(iEvent).first; }
62 
63  //accessor to the computed/cached value
64  valueType operator()(const edm::Event& iEvent) const { return baseEval(iEvent).second; }
65 
66  const std::string& name() const { return name_; }
67  const std::string& method() const { return method_; }
68  const Description& description() const { return d_; }
70  const std::string& holderName() const { return holderName_; }
71  void setHolder(std::string hn) const { holderName_ = hn; }
72 
73  void print() const { edm::LogVerbatim("CachingVariable") << name() << "\n" << description().text(); }
74 
75 protected:
76  mutable evalType cache_;
78 
82  void setCache(valueType& v) const {
83  cache_.first = true;
84  cache_.second = v;
85  }
86  void setNotCompute() const {
87  cache_.first = false;
88  cache_.second = 0;
89  }
92  LogDebug("CachingVariable") << name_ + ":" + holderName_ << " is checking once";
93  cache_ = eval(iEvent);
94  }
95  return cache_;
96  }
99  eventCacheID_ != iEvent.cacheIdentifier());
100  if (retValue) {
101  eventCacheID_ = iEvent.cacheIdentifier();
102  }
103  return retValue;
104  }
105 
106  //cannot be made purely virtual otherwise one cannot have purely CachingVariableObjects
107  virtual evalType eval(const edm::Event& iEvent) const { return std::make_pair(false, 0); };
108 
109  Description d_;
111  friend class VariableComputer;
112 };
113 
114 class ComputedVariable;
116 public:
118  virtual ~VariableComputer() {}
119 
120  virtual void compute(const edm::Event& iEvent) const = 0;
121  const std::string& name() const { return name_; }
123  void assign(std::string var, double& value) const;
124  void doesNotCompute() const;
125  void doesNotCompute(std::string var) const;
126 
129  eventCacheID_ != iEvent.cacheIdentifier());
130  if (retValue) {
131  eventCacheID_ = iEvent.cacheIdentifier();
132  }
133  return retValue;
134  }
135 
136 protected:
140  mutable std::map<std::string, const ComputedVariable*> iCompute_;
142 
144 };
145 
148 
155 
157 public:
161  : CachingVariable(M, N, P, iC), myComputer(c) {}
162  ~ComputedVariable() override{};
163 
164  evalType eval(const edm::Event& iEvent) const override {
165  if (myComputer->notSeenThisEventAlready(iEvent))
166  myComputer->compute(iEvent);
167  return cache_;
168  }
169 
170 private:
171  std::unique_ptr<const VariableComputer> myComputer;
172 };
173 
175 public:
177  ~VariableComputerTest() override{};
178 
179  void compute(const edm::Event& iEvent) const override;
180 };
181 
182 class Splitter : public CachingVariable {
183 public:
185  : CachingVariable(method, n, iConfig, iC) {}
186 
187  //purely virtual here
188  CachingVariable::evalType eval(const edm::Event& iEvent) const override = 0;
189 
190  unsigned int maxIndex() const { return maxSlots() - 1; }
191 
192  //maximum NUMBER of slots: counting over/under flows
193  virtual unsigned int maxSlots() const { return labels_.size(); }
194 
195  const std::string shortLabel(unsigned int i) const {
196  if (i >= short_labels_.size()) {
197  edm::LogError("Splitter") << "trying to access slots short_label at index: " << i
198  << "while of size: " << short_labels_.size() << "\n"
199  << conf_.dump();
200  return short_labels_.back();
201  } else
202  return short_labels_[i];
203  }
204 
205  const std::string& label(unsigned int i) const {
206  if (i >= labels_.size()) {
207  edm::LogError("Splitter") << "trying to access slots label at index: " << i << "while of size: " << labels_.size()
208  << "\n"
209  << conf_.dump();
210  return labels_.back();
211  } else
212  return labels_[i];
213  }
214 
215 protected:
216  std::vector<std::string> labels_;
217  std::vector<std::string> short_labels_;
218 };
219 
220 class VarSplitter : public Splitter {
221 public:
223  : Splitter("VarSplitter", arg.n, arg.iConfig, iC) {
224  var_ = arg.iConfig.getParameter<std::string>("var");
225  useUnderFlow_ = arg.iConfig.getParameter<bool>("useUnderFlow");
226  useOverFlow_ = arg.iConfig.getParameter<bool>("useOverFlow");
227  slots_ = arg.iConfig.getParameter<std::vector<double> >("slots");
228  if (useUnderFlow_) {
229  labels_.push_back("underflow");
230  short_labels_.push_back("_" + arg.n + "_underflow");
231  }
232  std::vector<std::string> confLabels;
233  if (arg.iConfig.exists("labels")) {
234  confLabels = arg.iConfig.getParameter<std::vector<std::string> >("labels");
235  } else {
236  std::string labelFormat = arg.iConfig.getParameter<std::string>("labelsFormat");
237  for (unsigned int is = 0; is != slots_.size() - 1; ++is) {
238  std::string l(Form(labelFormat.c_str(), slots_[is], slots_[is + 1]));
239  confLabels.push_back(l);
240  }
241  }
242  for (unsigned int i = 0; i != confLabels.size(); ++i) {
243  labels_.push_back(confLabels[i]);
244  std::stringstream ss;
245  ss << "_" << arg.n << "_" << i;
246  short_labels_.push_back(ss.str());
247  }
248  if (useOverFlow_) {
249  labels_.push_back("overFlow");
250  short_labels_.push_back("_" + arg.n + "_overFlow");
251  }
252 
253  //check consistency
254  if (labels_.size() != maxSlots())
255  edm::LogError("Splitter") << "splitter with name: " << name() << " has inconsistent configuration\n"
256  << conf_.dump();
257 
258  arg.m[arg.n] = this;
259  }
260 
261  CachingVariable::evalType eval(const edm::Event& iEvent) const override;
262 
263  //redefine the maximum number of slots
264  unsigned int maxSlots() const override {
265  unsigned int s = slots_.size() - 1;
266  if (useUnderFlow_)
267  s++;
268  if (useOverFlow_)
269  s++;
270  return s;
271  }
272 
273 protected:
277  std::vector<double> slots_;
278 };
279 
280 template <typename Object, const char* label>
282 public:
284  : CachingVariable(std::string(label) + "ExpressionVariable", arg.n, arg.iConfig, iC),
285  f_(nullptr),
286  forder_(nullptr) {
287  srcTag_ = edm::Service<InputTagDistributorService>()->retrieve("src", arg.iConfig);
289  //old style constructor
290  if (arg.iConfig.exists("expr") && arg.iConfig.exists("index")) {
291  std::string expr = arg.iConfig.getParameter<std::string>("expr");
292  index_ = arg.iConfig.getParameter<unsigned int>("index");
294  addDescriptionLine("calculating: " + expr);
295  std::stringstream ss;
296  ss << "on object at index: " << index_ << " of: " << srcTag_;
297 
298  if (arg.iConfig.exists("order")) {
299  std::string order = arg.iConfig.getParameter<std::string>("order");
301  ss << " after sorting according to: " << order;
302  } else
303  forder_ = nullptr;
304 
305  if (arg.iConfig.exists("selection")) {
306  std::string selection = arg.iConfig.getParameter<std::string>("selection");
308  ss << " and selecting only: " << selection;
309  } else
310  selector_ = nullptr;
311 
312  addDescriptionLine(ss.str());
313  ss.str("");
314  arg.m[arg.n] = this;
315  } else {
316  //multiple instance constructor
317  std::map<std::string, edm::Entry> indexEntry;
318  if (arg.n.find("_N") != std::string::npos) {
319  //will have to loop over indexes
320  std::vector<unsigned int> indexes = arg.iConfig.getParameter<std::vector<unsigned int> >("indexes");
321  for (unsigned int iI = 0; iI != indexes.size(); ++iI) {
322  edm::ParameterSet toUse = arg.iConfig;
323  edm::Entry e("unsigned int", indexes[iI], true);
324  std::stringstream ss;
325  //add +1 0->1, 1->2, ... in the variable label
326  ss << indexes[iI] + 1;
327  indexEntry.insert(std::make_pair(ss.str(), e));
328  }
329  } //contains "_N"
330 
331  std::map<std::string, edm::Entry> varEntry;
332  if (arg.n.find("_V") != std::string::npos) {
333  //do something fancy for multiple variable from one PSet
334  std::vector<std::string> vars = arg.iConfig.getParameter<std::vector<std::string> >("vars");
335  for (unsigned int v = 0; v != vars.size(); ++v) {
336  unsigned int sep = vars[v].find(":");
337  std::string name = vars[v].substr(0, sep);
338  std::string expr = vars[v].substr(sep + 1);
339 
340  edm::Entry e("string", expr, true);
341  varEntry.insert(std::make_pair(name, e));
342  }
343  } //contains "_V"
344 
345  std::string radical = arg.n;
346  //remove the "_V";
347  if (!varEntry.empty())
348  radical = radical.substr(0, radical.size() - 2);
349  //remove the "_N";
350  if (!indexEntry.empty())
351  radical = radical.substr(0, radical.size() - 2);
352 
353  if (varEntry.empty()) {
354  //loop only the indexes
355  for (std::map<std::string, edm::Entry>::iterator iIt = indexEntry.begin(); iIt != indexEntry.end(); ++iIt) {
356  edm::ParameterSet toUse = arg.iConfig;
357  toUse.insert(true, "index", iIt->second);
358  std::string newVname = radical + iIt->first;
359  // std::cout<<"in the loop, creating variable with name: "<<newVname<<std::endl;
360  // the constructor auto log the new variable in the map
362  }
363  } else {
364  for (std::map<std::string, edm::Entry>::iterator vIt = varEntry.begin(); vIt != varEntry.end(); ++vIt) {
365  if (indexEntry.empty()) {
366  edm::ParameterSet toUse = arg.iConfig;
367  toUse.insert(true, "expr", vIt->second);
368  std::string newVname = radical + vIt->first;
369  // std::cout<<"in the loop, creating variable with name: "<<newVname<<std::endl;
370  // the constructor auto log the new variable in the map
372  } else {
373  for (std::map<std::string, edm::Entry>::iterator iIt = indexEntry.begin(); iIt != indexEntry.end(); ++iIt) {
374  edm::ParameterSet toUse = arg.iConfig;
375  toUse.insert(true, "expr", vIt->second);
376  toUse.insert(true, "index", iIt->second);
377  std::string newVname = radical + iIt->first + vIt->first;
378  // std::cout<<"in the loop, creating variable with name: "<<newVname<<std::endl;
379  // the constructor auto log the new variable in the map
381  }
382  }
383  }
384  }
385  //there is a memory leak here, because the object we are in is not logged in the arg.m, the variable is not valid
386  // anyways, but reside in memory with no ways of de-allocating it.
387  // since the caching variables are actually "global" objects, it does not matter.
388  // we cannot add it to the map, otherwise, it would be considered for eventV ntupler
389  }
390  }
391  ~ExpressionVariable() override {
392  if (f_)
393  delete f_;
394  if (forder_)
395  delete forder_;
396  if (selector_)
397  delete selector_;
398  }
399 
401  if (!f_) {
402  edm::LogError(method()) << " no parser attached.";
403  return std::make_pair(false, 0);
404  }
406  iEvent.getByToken(src_, oH);
407  if (index_ >= oH->size()) {
408  LogDebug(method()) << "fail to get object at index: " << index_ << " in collection: " << srcTag_;
409  return std::make_pair(false, 0);
410  }
411 
412  //get the ordering right first. if required
413  if (selector_ || forder_) {
414  std::vector<const Object*> copyToSort(0);
415  copyToSort.reserve(oH->size());
416  for (unsigned int i = 0; i != oH->size(); ++i) {
417  if (selector_ && !((*selector_)((*oH)[i])))
418  continue;
419  copyToSort.push_back(&(*oH)[i]);
420  }
421  if (index_ >= copyToSort.size())
422  return std::make_pair(false, 0);
423  if (forder_)
424  std::sort(copyToSort.begin(), copyToSort.end(), sortByStringFunction<Object>(forder_));
425 
426  const Object* o = copyToSort[index_];
427  return std::make_pair(true, (*f_)(*o));
428  } else {
429  const Object& o = (*oH)[index_];
430  return std::make_pair(true, (*f_)(o));
431  }
432  }
433 
434 private:
437  unsigned int index_;
441 };
442 
443 template <typename LHS, const char* lLHS, typename RHS, const char* lRHS, typename Calculator>
445 public:
447  : CachingVariable(Calculator::calculationType() + std::string(lLHS) + std::string(lRHS), arg.n, arg.iConfig, iC),
448  srcLhsTag_(edm::Service<InputTagDistributorService>()->retrieve("srcLhs", arg.iConfig)),
449  srcLhs_(iC.consumes<std::vector<LHS> >(srcLhsTag_)),
450  indexLhs_(arg.iConfig.getParameter<unsigned int>("indexLhs")),
451  srcRhsTag_(edm::Service<InputTagDistributorService>()->retrieve("srcRhs", arg.iConfig)),
452  srcRhs_(iC.consumes<std::vector<RHS> >(srcRhsTag_)),
453  indexRhs_(arg.iConfig.getParameter<unsigned int>("indexRhs")) {
454  std::stringstream ss;
456  ss << "with Obj1 at index: " << indexLhs_ << " of: " << srcLhs_;
457  addDescriptionLine(ss.str());
458  ss.str("");
459  ss << "with Obj2 at index: " << indexRhs_ << " of: " << srcRhs_;
460  addDescriptionLine(ss.str());
461  ss.str("");
462  arg.m[arg.n] = this;
463  }
464 
465  class getObject {
466  public:
467  getObject() : test(false), lhs(0), rhs(0) {}
468  bool test;
469  const LHS* lhs;
470  const RHS* rhs;
471  };
475  iEvent.getByToken(srcLhs_, lhsH);
476  if (lhsH.failedToGet()) {
477  LogDebug("TwoObjectVariable") << name() << " could not get a collection with label: " << srcLhsTag_;
478  return failed;
479  }
480  if (indexLhs_ >= lhsH->size()) {
481  LogDebug("TwoObjectVariable") << name() << " tries to access index: " << indexLhs_ << " of: " << srcLhsTag_
482  << " with: " << lhsH->size() << " entries.";
483  return failed;
484  }
485  const LHS& lhs = (*lhsH)[indexLhs_];
486 
488  iEvent.getByToken(srcRhs_, rhsH);
489  if (rhsH.failedToGet()) {
490  LogDebug("TwoObjectVariable") << name() << " could not get a collection with label: " << srcLhsTag_;
491  return failed;
492  }
493 
494  if (indexRhs_ >= rhsH->size()) {
495  LogDebug("TwoObjectVariable") << name() << " tries to access index: " << indexRhs_ << " of: " << srcRhsTag_
496  << " with: " << rhsH->size() << " entries.";
497  return failed;
498  }
499  const RHS& rhs = (*rhsH)[indexRhs_];
500 
501  failed.test = true;
502  failed.lhs = &lhs;
503  failed.rhs = &rhs;
504  return failed;
505  }
506 
507  //to be overloaded by the user
509  Calculator calc;
510  return calc(*o.lhs, *o.rhs);
511  }
514  if (!o.test)
515  return std::make_pair(false, 0);
516  return std::make_pair(true, calculate(o));
517  }
518 
519 private:
522  unsigned int indexLhs_;
525  unsigned int indexRhs_;
526 };
527 
529 public:
531  : CachingVariable("Power", arg.n, arg.iConfig, iC) {
532  power_ = arg.iConfig.getParameter<double>("power");
533  var_ = arg.iConfig.getParameter<std::string>("var");
534  std::stringstream ss("Calculare X^Y, with X=");
535  ss << var_ << " and Y=" << power_;
536  addDescriptionLine(ss.str());
537  arg.m[arg.n] = this;
538  }
539  ~VariablePower() override {}
540 
541  //concrete calculation of the variable
542  CachingVariable::evalType eval(const edm::Event& iEvent) const override;
543 
544 private:
545  double power_;
547 };
548 
549 template <typename TYPE>
551 public:
553  : CachingVariable("SimpleValueVariable", arg.n, arg.iConfig, iC),
554  src_(iC.consumes<TYPE>(edm::Service<InputTagDistributorService>()->retrieve("src", arg.iConfig))) {
555  arg.m[arg.n] = this;
556  }
559  iEvent.getByToken(src_, value);
560  if (value.failedToGet() || !value.isValid())
561  return std::make_pair(false, 0);
562  else
563  return std::make_pair(true, *value);
564  }
565 
566 private:
568 };
569 
570 template <typename TYPE>
572 public:
574  : CachingVariable("SimpleValueVectorVariable", arg.n, arg.iConfig, iC),
575  src_(iC.consumes<TYPE>(edm::Service<InputTagDistributorService>()->retrieve("src", arg.iConfig))),
576  index_(arg.iConfig.getParameter<unsigned int>("index")) {
577  arg.m[arg.n] = this;
578  }
581  iEvent.getByToken(src_, values);
582  if (values.failedToGet() || !values.isValid())
583  return std::make_pair(false, 0);
584  else if (index_ >= values->size())
585  return std::make_pair(false, 0);
586  else
587  return std::make_pair(true, (*values)[index_]);
588  }
589 
590 private:
592  unsigned int index_;
593 };
594 
595 #endif
PluginFactory.h
Splitter::shortLabel
const std::string shortLabel(unsigned int i) const
Definition: CachingVariable.h:195
Handle.h
VariableComputer::compute
virtual void compute(const edm::Event &iEvent) const =0
VariableComputer::method_
std::string method_
Definition: CachingVariable.h:139
mps_fire.i
i
Definition: mps_fire.py:355
InputTagDistributorService
Definition: InputTagDistributor.h:39
CachingVariable::conf_
edm::ParameterSet conf_
Definition: CachingVariable.h:110
ExpressionVariable::selector_
StringCutObjectSelector< Object > * selector_
Definition: CachingVariable.h:440
StringObjectFunction< Object >
VariablePower
Definition: CachingVariable.h:528
MessageLogger.h
VarSplitter::VarSplitter
VarSplitter(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:222
CachingVariable::addDescriptionLine
void addDescriptionLine(const std::string &s)
Definition: CachingVariable.h:69
funct::false
false
Definition: Factorize.h:34
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
VariablePower::VariablePower
VariablePower(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:530
Splitter::maxIndex
unsigned int maxIndex() const
Definition: CachingVariable.h:190
CachingVariable::setHolder
void setHolder(std::string hn) const
Definition: CachingVariable.h:71
ExpressionVariable::~ExpressionVariable
~ExpressionVariable() override
Definition: CachingVariable.h:391
VarSplitter::maxSlots
unsigned int maxSlots() const override
Definition: CachingVariable.h:264
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
TwoObjectVariable::srcLhs_
edm::EDGetTokenT< std::vector< LHS > > srcLhs_
Definition: CachingVariable.h:521
CachingVariable::eval
virtual evalType eval(const edm::Event &iEvent) const
Definition: CachingVariable.h:107
ComputedVariable::ComputedVariable
ComputedVariable(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.cc:97
VariableComputerTest::~VariableComputerTest
~VariableComputerTest() override
Definition: CachingVariable.h:177
VariablePower::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.cc:34
edm::EDGetTokenT
Definition: EDGetToken.h:33
TwoObjectVariable::getObject::getObject
getObject()
Definition: CachingVariable.h:467
edm
HLT enums.
Definition: AlignableModifier.h:19
TwoObjectVariable
Definition: CachingVariable.h:444
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
CachingVariable::method_
std::string method_
Definition: CachingVariable.h:79
Description::text
std::string text() const
Definition: CachingVariable.h:25
runEdmFileComparison.failed
failed
Definition: runEdmFileComparison.py:225
TwoObjectVariable::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.h:512
CachingVariable::setCache
void setCache(valueType &v) const
Definition: CachingVariable.h:82
ExpressionVariable::f_
StringObjectFunction< Object > * f_
Definition: CachingVariable.h:438
VariableComputerTest
Definition: CachingVariable.h:174
TwoObjectVariable::getObject
Definition: CachingVariable.h:465
TwoObjectVariable::objects
getObject objects(const edm::Event &iEvent) const
Definition: CachingVariable.h:472
ExpressionVariable::srcTag_
edm::InputTag srcTag_
Definition: CachingVariable.h:435
CachingVariable
Definition: CachingVariable.h:40
Splitter::labels_
std::vector< std::string > labels_
Definition: CachingVariable.h:216
VariableComputer::separator_
std::string separator_
Definition: CachingVariable.h:141
VariableComputer::doesNotCompute
void doesNotCompute() const
Definition: CachingVariable.cc:79
ExpressionVariable::forder_
StringObjectFunction< Object > * forder_
Definition: CachingVariable.h:439
ComputedVariable::~ComputedVariable
~ComputedVariable() override
Definition: CachingVariable.h:162
findQualityFiles.v
v
Definition: findQualityFiles.py:179
VariableComputerTest::compute
void compute(const edm::Event &iEvent) const override
Definition: CachingVariable.cc:109
edm::Handle
Definition: AssociativeIterator.h:50
SimpleValueVectorVariable::src_
edm::EDGetTokenT< TYPE > src_
Definition: CachingVariable.h:591
CachingVariable::cache_
evalType cache_
Definition: CachingVariable.h:76
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
ExpressionVariable
Definition: CachingVariable.h:281
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
TwoObjectVariable::getObject::lhs
const LHS * lhs
Definition: CachingVariable.h:469
SimpleValueVectorVariable
Definition: CachingVariable.h:571
TwoObjectVariable::getObject::rhs
const RHS * rhs
Definition: CachingVariable.h:470
CachingVariable::d_
Description d_
Definition: CachingVariable.h:107
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
CachingVariable::name_
std::string name_
Definition: CachingVariable.h:80
CachingVariable::CachingVariableFactoryArg::CachingVariableFactoryArg
CachingVariableFactoryArg(const CachingVariableFactoryArg &copy)
Definition: CachingVariable.h:47
CachingVariable::operator()
valueType operator()(const edm::Event &iEvent) const
Definition: CachingVariable.h:64
VariableComputer::VariableComputer
VariableComputer(const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.cc:44
alignCSCRings.s
s
Definition: alignCSCRings.py:92
test
Definition: SmallWORMDict.h:13
CachingVariable::description
const Description & description() const
Definition: CachingVariable.h:68
SimpleValueVectorVariable::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.h:579
ExpressionVariable::src_
edm::EDGetTokenT< edm::View< Object > > src_
Definition: CachingVariable.h:436
vars
vars
Definition: DeepTauId.cc:158
VarSplitter::slots_
std::vector< double > slots_
Definition: CachingVariable.h:277
edm::ParameterSet::dump
std::string dump(unsigned int indent=0) const
Definition: ParameterSet.cc:825
edm::ParameterSet::insert
void insert(bool ok_to_replace, char const *, Entry const &)
Definition: ParameterSet.cc:373
Service.h
ExpressionVariable::ExpressionVariable
ExpressionVariable(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:283
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
corrVsCorr.selection
selection
main part
Definition: corrVsCorr.py:100
SimpleValueVariable::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.h:557
N
#define N
Definition: blowfish.cc:9
Service
sortByStringFunction
Definition: StringObjectFunction.h:34
VariableComputer::name
const std::string & name() const
Definition: CachingVariable.h:121
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
VariableComputer
Definition: CachingVariable.h:115
VariableComputer::iCompute_
std::map< std::string, const ComputedVariable * > iCompute_
Definition: CachingVariable.h:140
VarSplitter
Definition: CachingVariable.h:220
Splitter::Splitter
Splitter(std::string method, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:184
TwoObjectVariable::TwoObjectVariable
TwoObjectVariable(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:446
CachingVariable::CachingVariableFactoryArg::m
CachingVariable::vMap & m
Definition: CachingVariable.h:51
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ComputedVariable::myComputer
std::unique_ptr< const VariableComputer > myComputer
Definition: CachingVariable.h:171
ExpressionVariable::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.h:400
TwoObjectVariable::srcLhsTag_
edm::InputTag srcLhsTag_
Definition: CachingVariable.h:520
edm::View
Definition: CaloClusterFwd.h:14
VariableComputer::assign
void assign(std::string var, double &value) const
Definition: CachingVariable.cc:66
edm::HandleBase::failedToGet
bool failedToGet() const
Definition: HandleBase.h:72
VarSplitter::useOverFlow_
bool useOverFlow_
Definition: CachingVariable.h:276
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::Event::CacheIdentifier_t
unsigned long CacheIdentifier_t
Definition: Event.h:116
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
Event.h
Splitter
Definition: CachingVariable.h:182
CachingVariable::CachingVariable
CachingVariable(std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:55
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
Description::Description
Description()
Definition: CachingVariable.h:23
edmplugin::PluginFactory
Definition: PluginFactory.h:34
CachingVariable::setNotCompute
void setNotCompute() const
Definition: CachingVariable.h:86
Description
Definition: CachingVariable.h:21
eventshapeDQM_cfi.order
order
Definition: eventshapeDQM_cfi.py:8
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
TwoObjectVariable::indexLhs_
unsigned int indexLhs_
Definition: CachingVariable.h:522
value
Definition: value.py:1
edm::LogVerbatim
Definition: MessageLogger.h:297
VarSplitter::var_
std::string var_
Definition: CachingVariable.h:274
Description::Description
Description(std::vector< std::string > &d)
Definition: CachingVariable.h:24
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
VariableComputer::declare
void declare(std::string var, edm::ConsumesCollector &iC)
Definition: CachingVariable.cc:55
VariablePower::~VariablePower
~VariablePower() override
Definition: CachingVariable.h:539
VariablePower::var_
std::string var_
Definition: CachingVariable.h:546
VariablePower::power_
double power_
Definition: CachingVariable.h:545
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
TwoObjectVariable::srcRhsTag_
edm::InputTag srcRhsTag_
Definition: CachingVariable.h:523
InputTagDistributor.h
Description::lines
const std::vector< std::string > lines()
Definition: CachingVariable.h:31
SimpleValueVectorVariable::SimpleValueVectorVariable
SimpleValueVectorVariable(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:573
VariableComputer::name_
std::string name_
Definition: CachingVariable.h:138
TwoObjectVariable::calculate
virtual CachingVariable::valueType calculate(getObject &o) const
Definition: CachingVariable.h:508
CachingVariable::valueType
double valueType
Definition: CachingVariable.h:43
Description::d_
std::vector< std::string > d_
Definition: CachingVariable.h:35
CachingVariable::holderName
const std::string & holderName() const
Definition: CachingVariable.h:70
std
Definition: JetResolutionObject.h:76
VariableComputer::arg_
const CachingVariable::CachingVariableFactoryArg & arg_
Definition: CachingVariable.h:137
StringCutObjectSelector.h
jets_cff.expr
expr
Definition: jets_cff.py:449
VarSplitter::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.cc:4
TwoObjectVariable::srcRhs_
edm::EDGetTokenT< std::vector< RHS > > srcRhs_
Definition: CachingVariable.h:524
CachingVariable::CachingVariableFactoryArg::CachingVariableFactoryArg
CachingVariableFactoryArg(std::string &N, CachingVariable::vMap &M, edm::ParameterSet &P)
Definition: CachingVariable.h:48
relativeConstraints.value
value
Definition: relativeConstraints.py:53
StringCutObjectSelector< Object >
runonSM.TYPE
TYPE
Definition: runonSM.py:21
CachingVariable::notSeenThisEventAlready
bool notSeenThisEventAlready(const edm::Event &iEvent) const
Definition: CachingVariable.h:97
SimpleValueVariable
Definition: CachingVariable.h:550
CachingVariable::~CachingVariable
virtual ~CachingVariable()
Definition: CachingVariable.h:58
Description::addLine
void addLine(const std::string &l)
Definition: CachingVariable.h:32
CachingVariable::vMap
std::map< std::string, const CachingVariable * > vMap
Definition: CachingVariable.h:45
CachingVariable::evalType
std::pair< bool, valueType > evalType
Definition: CachingVariable.h:44
CachingVariable::method
const std::string & method() const
Definition: CachingVariable.h:67
CachingVariable::compute
bool compute(const edm::Event &iEvent) const
Definition: CachingVariable.h:61
ComputedVariable
Definition: CachingVariable.h:156
Splitter::short_labels_
std::vector< std::string > short_labels_
Definition: CachingVariable.h:217
CachingVariable::name
const std::string & name() const
Definition: CachingVariable.h:66
funct::arg
A arg
Definition: Factorize.h:36
ExpressionVariable::index_
unsigned int index_
Definition: CachingVariable.h:437
ztail.d
d
Definition: ztail.py:151
CachingVariable::CachingVariableFactoryArg
Definition: CachingVariable.h:46
VariableComputerTest::VariableComputerTest
VariableComputerTest(const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.cc:101
ConsumesCollector.h
CachingVariable::print
void print() const
Definition: CachingVariable.h:73
SimpleValueVariable::src_
edm::EDGetTokenT< TYPE > src_
Definition: CachingVariable.h:567
TwoObjectVariable::indexRhs_
unsigned int indexRhs_
Definition: CachingVariable.h:525
SimpleValueVectorVariable::index_
unsigned int index_
Definition: CachingVariable.h:592
EventSetup
ParameterSet.h
VariableComputer::notSeenThisEventAlready
bool notSeenThisEventAlready(const edm::Event &iEvent) const
Definition: CachingVariable.h:127
TwoObjectVariable::getObject::test
bool test
Definition: CachingVariable.h:468
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:202
edm::Event
Definition: Event.h:73
CachingVariable::CachingVariableFactoryArg::n
std::string & n
Definition: CachingVariable.h:50
Splitter::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override=0
VariableComputer::~VariableComputer
virtual ~VariableComputer()
Definition: CachingVariable.h:118
StringObjectFunction.h
CachingVariable::CachingVariableFactoryArg::iConfig
edm::ParameterSet & iConfig
Definition: CachingVariable.h:52
ComputedVariable::ComputedVariable
ComputedVariable(const std::string &M, std::string &N, edm::ParameterSet &P, const VariableComputer *c, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:159
Splitter::label
const std::string & label(unsigned int i) const
Definition: CachingVariable.h:205
SimpleValueVariable::SimpleValueVariable
SimpleValueVariable(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
Definition: CachingVariable.h:552
edm::Entry
Definition: Entry.h:40
Splitter::maxSlots
virtual unsigned int maxSlots() const
Definition: CachingVariable.h:193
edm::InputTag
Definition: InputTag.h:15
CachingVariable::baseEval
evalType & baseEval(const edm::Event &iEvent) const
Definition: CachingVariable.h:90
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
label
const char * label
Definition: PFTauDecayModeTools.cc:11
VarSplitter::useUnderFlow_
bool useUnderFlow_
Definition: CachingVariable.h:275
ComputedVariable::eval
evalType eval(const edm::Event &iEvent) const override
Definition: CachingVariable.h:164
CachingVariable::holderName_
std::string holderName_
Definition: CachingVariable.h:81
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
VariableComputer::eventCacheID_
edm::Event::CacheIdentifier_t eventCacheID_
Definition: CachingVariable.h:143
CachingVariable::eventCacheID_
edm::Event::CacheIdentifier_t eventCacheID_
Definition: CachingVariable.h:77