#include <CachingVariable.h>
Classes | |
class | getObject |
Public Member Functions | |
virtual CachingVariable::valueType | calculate (getObject &o) const |
CachingVariable::evalType | eval (const edm::Event &iEvent) const |
getObject | objects (const edm::Event &iEvent) const |
TwoObjectVariable (CachingVariableFactoryArg arg) | |
Private Attributes | |
unsigned int | indexLhs_ |
unsigned int | indexRhs_ |
edm::InputTag | srcLhs_ |
edm::InputTag | srcRhs_ |
Definition at line 410 of file CachingVariable.h.
TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::TwoObjectVariable | ( | CachingVariableFactoryArg | arg | ) | [inline] |
Definition at line 412 of file CachingVariable.h.
References CachingVariable::addDescriptionLine(), idDealer::description, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::indexLhs_, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::indexRhs_, CachingVariable::CachingVariableFactoryArg::m, CachingVariable::CachingVariableFactoryArg::n, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::srcLhs_, and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::srcRhs_.
: CachingVariable(Calculator::calculationType()+std::string(lLHS)+std::string(lRHS),arg.n,arg.iConfig), srcLhs_(edm::Service<InputTagDistributorService>()->retrieve("srcLhs",arg.iConfig)), indexLhs_(arg.iConfig.getParameter<unsigned int>("indexLhs")), srcRhs_(edm::Service<InputTagDistributorService>()->retrieve("srcRhs",arg.iConfig)), indexRhs_(arg.iConfig.getParameter<unsigned int>("indexRhs")) { std::stringstream ss; addDescriptionLine(Calculator::description()); ss<<"with Obj1 at index: "<<indexLhs_<<" of: "<<srcLhs_; addDescriptionLine(ss.str()); ss.str(""); ss<<"with Obj2 at index: "<<indexRhs_<<" of: "<<srcRhs_; addDescriptionLine(ss.str()); ss.str(""); arg.m[arg.n]=this; }
virtual CachingVariable::valueType TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::calculate | ( | getObject & | o | ) | const [inline, virtual] |
Definition at line 465 of file CachingVariable.h.
References TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::getObject::lhs, and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::getObject::rhs.
Referenced by TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::eval().
CachingVariable::evalType TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::eval | ( | const edm::Event & | iEvent | ) | const [inline, virtual] |
Reimplemented from CachingVariable.
Definition at line 469 of file CachingVariable.h.
References TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::calculate(), python::connectstrParser::o, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects(), and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::getObject::test.
getObject TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects | ( | const edm::Event & | iEvent | ) | const [inline] |
Definition at line 435 of file CachingVariable.h.
References edm::HandleBase::failedToGet(), edm::Event::getByLabel(), TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::indexLhs_, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::indexRhs_, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::getObject::lhs, LogDebug, CachingVariable::name(), TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::getObject::rhs, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::srcLhs_, TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::srcRhs_, and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::getObject::test.
Referenced by TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::eval().
{ getObject failed; edm::Handle<std::vector<LHS> > lhsH; iEvent.getByLabel(srcLhs_, lhsH); if (lhsH.failedToGet()){ LogDebug("TwoObjectVariable")<<name()<<" could not get a collection with label: "<<srcLhs_; return failed;} if (indexLhs_>=lhsH->size()){ LogDebug("TwoObjectVariable")<<name()<<" tries to access index: "<<indexLhs_<<" of: "<<srcLhs_<<" with: "<<lhsH->size()<<" entries."; return failed;} const LHS & lhs = (*lhsH)[indexLhs_]; edm::Handle<std::vector<RHS> > rhsH; iEvent.getByLabel(srcRhs_, rhsH); if (rhsH.failedToGet()){ LogDebug("TwoObjectVariable")<<name()<<" could not get a collection with label: "<<srcLhs_; return failed;} if (indexRhs_>=rhsH->size()){ LogDebug("TwoObjectVariable")<<name()<<" tries to access index: "<<indexRhs_<<" of: "<<srcRhs_<<" with: "<<rhsH->size()<<" entries."; return failed;} const RHS & rhs = (*rhsH)[indexRhs_]; failed.test=true; failed.lhs=&lhs; failed.rhs=&rhs; return failed; }
unsigned int TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::indexLhs_ [private] |
Definition at line 476 of file CachingVariable.h.
Referenced by TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects(), and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::TwoObjectVariable().
unsigned int TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::indexRhs_ [private] |
Definition at line 478 of file CachingVariable.h.
Referenced by TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects(), and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::TwoObjectVariable().
edm::InputTag TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::srcLhs_ [private] |
Definition at line 475 of file CachingVariable.h.
Referenced by TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects(), and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::TwoObjectVariable().
edm::InputTag TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::srcRhs_ [private] |
Definition at line 477 of file CachingVariable.h.
Referenced by TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::objects(), and TwoObjectVariable< LHS, lLHS, RHS, lRHS, Calculator >::TwoObjectVariable().