CMS 3D CMS Logo

VariableHelper.cc
Go to the documentation of this file.
3 
6 
7 #include <iomanip>
8 
10  std::vector<std::string> psetNames;
11  iConfig.getParameterSetNames(psetNames);
12  for (unsigned int i = 0; i != psetNames.size(); ++i) {
13  std::string& vname = psetNames[i];
14  edm::ParameterSet vPset = iConfig.getParameter<edm::ParameterSet>(psetNames[i]);
15  std::string method = vPset.getParameter<std::string>("method");
16 
18  method, CachingVariable::CachingVariableFactoryArg(vname, variables_, vPset), iC);
19  }
20 }
21 
23  iterator it = variables_.begin();
24  iterator it_end = variables_.end();
25  for (; it != it_end; ++it)
26  it->second->setHolder(hn);
27 }
28 
29 void VariableHelper::print() const {
30  iterator it = variables_.begin();
31  iterator it_end = variables_.end();
32  for (; it != it_end; ++it)
33  it->second->print();
34 }
35 
37  std::stringstream ss;
38  iterator it = variables_.begin();
39  iterator it_end = variables_.end();
40  ss << std::setw(10) << event.id().run() << " : " << std::setw(10) << event.id().event();
41  for (; it != it_end; ++it) {
42  if (it->second->compute(event))
43  ss << " : " << it->first << "=" << (*it->second)(event);
44  else
45  ss << " : " << it->first << " N/A";
46  }
47  return ss.str();
48 }
50  iterator v = variables_.find(name);
51  if (v != variables_.end())
52  return v->second;
53  else {
54  edm::LogError("VariableHelper") << "I don't know anything named: " << name
55  << " list of available variables follows.";
56  print();
57  return nullptr;
58  }
59 }
T getParameter(std::string const &) const
VariableHelper(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
const CachingVariable * variable(std::string name) const
std::string printValues(const edm::Event &event) const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::map< std::string, const CachingVariable * > variables_
void setHolder(std::string hn)
std::map< std::string, const CachingVariable * >::const_iterator iterator
void print() const
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
Definition: event.py:1