6 if (!var->
compute(iEvent))
return std::make_pair(
false,0);
11 else return std::make_pair(
false,0);
15 else return std::make_pair(
false,0);
23 else return std::make_pair(
true,(
double)i-1);
28 if (!var->
compute(iEvent))
return std::make_pair(
false,0);
32 return std::make_pair(
true,p);
47 edm::LogError(
"VariableComputer")<<
"redeclaring: "<<var<<
" skipping.";
52 arg_.
m.insert(std::make_pair(aName,newVar));
55 std::map<std::string ,const ComputedVariable *>::const_iterator it=
iCompute_.find(var);
58 ss<<
"cannot assign: "<<var<<
". List of variable declared:\n";
59 for ( std::map<std::string ,const ComputedVariable *>::const_iterator it=
iCompute_.begin(); it!=
iCompute_.end();++it)
60 ss<<it->first<<std::endl;
64 it->second->setCache(value);
68 for ( std::map<std::string ,const ComputedVariable *>::const_iterator it=
iCompute_.begin(); it!=
iCompute_.end();++it)
69 it->second->setNotCompute();
72 std::map<std::string ,const ComputedVariable *>::const_iterator it=
iCompute_.find(var);
75 ss<<
"cannot act on: "<<var<<
". List of variable declared:\n";
76 for ( std::map<std::string ,const ComputedVariable *>::const_iterator it=
iCompute_.begin(); it!=
iCompute_.end();++it)
77 ss<<it->first<<std::endl;
81 it->second->setNotCompute();
T getParameter(std::string const &) const
ComputedVariable(const CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
VariableComputer(const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
const CachingVariable::CachingVariableFactoryArg & arg_
std::vector< double > slots_
unsigned int maxIndex() const
void assign(std::string var, double &value) const
edm::ParameterSet & iConfig
void compute(const edm::Event &iEvent) const override
VariableComputerTest(const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
CachingVariable::evalType eval(const edm::Event &iEvent) const override
std::map< std::string,const ComputedVariable * > iCompute_
CachingVariable::vMap & m
CachingVariable::evalType eval(const edm::Event &iEvent) const override
bool compute(const edm::Event &iEvent) const
void doesNotCompute() const
void declare(std::string var, edm::ConsumesCollector &iC)
T get(const Candidate &c)
std::pair< bool, valueType > evalType