CMS 3D CMS Logo

Classes | Typedefs | Enumerations | Functions
reco::parser Namespace Reference

Classes

struct  Abort
 
struct  abs_f
 
struct  acos_f
 
struct  AndCombiner
 
class  AnyMethodArgument2VoidPtr
 
class  AnyMethodArgumentFixup
 
class  AnyObjSelector
 
struct  asin_f
 
struct  atan2_f
 
struct  atan_f
 
struct  BinaryCutSetter
 
struct  BinarySelector
 
class  BinarySelectorSetter
 
struct  chi2prob_f
 
struct  Comparison
 
struct  ComparisonBase
 
struct  ComparisonSetter
 
struct  cos_f
 
struct  cosh_f
 
struct  CutBinaryOperator
 
struct  CutBinaryOperatorSetter
 
struct  CutSetter
 
struct  deltaPhi_f
 
struct  deltaR_f
 
class  Exception
 
struct  exp_f
 
struct  ExpressionBase
 
struct  ExpressionBinaryOperator
 
struct  ExpressionBinaryOperatorSetter
 
struct  ExpressionCondition
 
struct  ExpressionConditionSetter
 
struct  ExpressionFunctionSetter
 
class  ExpressionLazyVar
 
struct  ExpressionNumber
 
struct  ExpressionNumberSetter
 
struct  ExpressionQuaterOperator
 
class  ExpressionSelectorSetter
 
struct  ExpressionSetter
 
struct  ExpressionUnaryOperator
 
struct  ExpressionUnaryOperatorSetter
 
class  ExpressionVar
 Evaluate an object's method or datamember (or chain of them) to get a number. More...
 
struct  ExpressionVarSetter
 
struct  FunctionSetter
 
struct  FunctionSetterCommit
 
struct  Grammar
 
struct  hypot_f
 
struct  IntSetter
 
struct  LazyInvoker
 Keeps different SingleInvokers for each dynamic type of the objects passed to invoke() More...
 
struct  log10_f
 
struct  log_f
 
struct  LogicalBinaryOperator
 
struct  LogicalUnaryOperator
 
struct  matches_another_integral_type
 
struct  max_f
 
struct  MethodArgumentSetter
 
class  MethodInvoker
 
class  MethodSetter
 
struct  min_f
 
struct  NotCombiner
 
struct  OrCombiner
 
struct  pow_f
 
struct  power_of
 
class  SelectorBase
 
struct  sin_f
 
struct  SingleInvoker
 
struct  sinh_f
 
struct  sqrt_f
 
struct  tan_f
 
struct  tanh_f
 
struct  test_bit_f
 
struct  TrinarySelector
 
class  TrinarySelectorSetter
 
struct  UnaryCutSetter
 

Typedefs

typedef std::conditional< matches_another_integral_type< unsigned long >::value, std::variant< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, double, float, std::string >, std::variant< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, unsigned long, double, float, std::string > >::type AnyMethodArgument
 
typedef boost::spirit::classic::parser_error< reco::parser::SyntaxErrorsBaseException
 
typedef std::vector< std::shared_ptr< ComparisonBase > > ComparisonStack
 
typedef std::shared_ptr< ExpressionBaseExpressionPtr
 
typedef std::vector< reco::parser::ExpressionPtrExpressionPtrs
 
typedef std::vector< std::shared_ptr< ExpressionBase > > ExpressionStack
 
typedef std::vector< FunctionFunctionStack
 
typedef std::vector< int > IntStack
 
typedef std::vector< LazyInvokerLazyMethodStack
 
typedef std::vector< AnyMethodArgumentMethodArgumentStack
 
typedef std::vector< MethodInvokerMethodStack
 
typedef std::shared_ptr< SelectorBaseSelectorPtr
 
typedef std::vector< reco::parser::SelectorPtrSelectorPtrs
 
typedef std::vector< SelectorPtrSelectorStack
 
typedef std::vector< edm::TypeWithDictTypeStack
 

Enumerations

enum  ErrorCodes {
  kNoError = 0, kNameDoesNotExist, kIsNotPublic, kIsStatic,
  kIsNotConst, kIsFunctionAddedByROOT, kIsConstructor, kIsDestructor,
  kIsOperator, kWrongNumberOfArguments, kWrongArgumentType, kOverloaded
}
 
enum  Function {
  kAbs, kAcos, kAsin, kAtan,
  kAtan2, kChi2Prob, kCos, kCosh,
  kExp, kHypot, kLog, kLog10,
  kMax, kMin, kPow, kSin,
  kSinh, kSqrt, kTan, kTanh,
  kDeltaR, kDeltaPhi, kTestBit
}
 
enum  SyntaxErrors { kSyntaxError, kMissingClosingParenthesis, kSpecialError }
 

Functions

const char * baseExceptionWhat (const BaseException &e)
 returns the appropriate 'what' message for the exception More...
 
bool cutParser (const edm::TypeWithDict &t, const std::string &cut, SelectorPtr &sel, bool lazy)
 
template<typename T >
bool cutParser (const std::string &cut, SelectorPtr &sel, bool lazy=false)
 
bool expressionParser (const edm::TypeWithDict &t, const std::string &value, ExpressionPtr &expr, bool lazy)
 
template<typename T >
bool expressionParser (const std::string &value, ExpressionPtr &expr, bool lazy=false)
 
template<class T >
Exceptionoperator<< (const Exception &e, const T &iT)
 
Exceptionoperator<< (const Exception &e, std::ios_base &(*f)(std::ios_base &))
 
Exceptionoperator<< (const Exception &e, std::ostream &(*f)(std::ostream &))
 
template<class T >
Exceptionoperator<< (Exception &e, const T &iT)
 
Exceptionoperator<< (Exception &e, std::ios_base &(*f)(std::ios_base &))
 
Exceptionoperator<< (Exception &e, std::ostream &(*f)(std::ostream &))
 

Typedef Documentation

◆ AnyMethodArgument

typedef std::conditional< matches_another_integral_type<unsigned long>::value, std::variant<int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, double, float, std::string>, std::variant<int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, unsigned long, double, float, std::string> >::type reco::parser::AnyMethodArgument

Definition at line 45 of file AnyMethodArgument.h.

◆ BaseException

typedef boost::spirit::classic::parser_error<reco::parser::SyntaxErrors> reco::parser::BaseException

Definition at line 33 of file Exception.h.

◆ ComparisonStack

typedef std::vector<std::shared_ptr<ComparisonBase> > reco::parser::ComparisonStack

Definition at line 19 of file ComparisonStack.h.

◆ ExpressionPtr

typedef std::shared_ptr< ExpressionBase > reco::parser::ExpressionPtr

Definition at line 25 of file ExpressionBase.h.

◆ ExpressionPtrs

Definition at line 13 of file classes.h.

◆ ExpressionStack

typedef std::vector<std::shared_ptr<ExpressionBase> > reco::parser::ExpressionStack

Definition at line 19 of file ExpressionStack.h.

◆ FunctionStack

typedef std::vector<Function> reco::parser::FunctionStack

Definition at line 17 of file FunctionStack.h.

◆ IntStack

typedef std::vector<int> reco::parser::IntStack

Definition at line 16 of file IntStack.h.

◆ LazyMethodStack

Definition at line 18 of file MethodStack.h.

◆ MethodArgumentStack

Definition at line 17 of file MethodArgumentStack.h.

◆ MethodStack

Definition at line 17 of file MethodStack.h.

◆ SelectorPtr

typedef std::shared_ptr<SelectorBase> reco::parser::SelectorPtr

Definition at line 18 of file SelectorPtr.h.

◆ SelectorPtrs

Definition at line 14 of file classes.h.

◆ SelectorStack

Definition at line 18 of file SelectorStack.h.

◆ TypeStack

Definition at line 17 of file TypeStack.h.

Enumeration Type Documentation

◆ ErrorCodes

ErrorCodes.h CommonTools/Utils/interface/ErrorCodes.h

Description: enum containing the various ways data/function member lookups can fail

Usage: <usage>

Enumerator
kNoError 
kNameDoesNotExist 
kIsNotPublic 
kIsStatic 
kIsNotConst 
kIsFunctionAddedByROOT 
kIsConstructor 
kIsDestructor 
kIsOperator 
kWrongNumberOfArguments 
kWrongArgumentType 
kOverloaded 

Definition at line 30 of file ErrorCodes.h.

◆ Function

Enumerator
kAbs 
kAcos 
kAsin 
kAtan 
kAtan2 
kChi2Prob 
kCos 
kCosh 
kExp 
kHypot 
kLog 
kLog10 
kMax 
kMin 
kPow 
kSin 
kSinh 
kSqrt 
kTan 
kTanh 
kDeltaR 
kDeltaPhi 
kTestBit 

Definition at line 18 of file Function.h.

18  {
19  kAbs,
20  kAcos,
21  kAsin,
22  kAtan,
23  kAtan2,
24  kChi2Prob,
25  kCos,
26  kCosh,
27  kExp,
28  kHypot,
29  kLog,
30  kLog10,
31  kMax,
32  kMin,
33  kPow,
34  kSin,
35  kSinh,
36  kSqrt,
37  kTan,
38  kTanh,
39  kDeltaR,
40  kDeltaPhi,
41  kTestBit
42  };

◆ SyntaxErrors

Enumerator
kSyntaxError 
kMissingClosingParenthesis 
kSpecialError 

Definition at line 31 of file Exception.h.

Function Documentation

◆ baseExceptionWhat()

const char* reco::parser::baseExceptionWhat ( const BaseException e)
inline

returns the appropriate 'what' message for the exception

Definition at line 36 of file Exception.h.

36  {
37  switch (e.descriptor) {
39  return "Missing close parenthesis.";
40  case kSyntaxError:
41  return "Syntax error.";
42  case kSpecialError:
43  default:
44  break;
45  }
46  return e.what();
47  }

References MillePedeFileConverter_cfg::e, kMissingClosingParenthesis, kSpecialError, and kSyntaxError.

Referenced by cutParser(), expressionParser(), helper::Parser::makeExpression(), helper::Parser::makeSelector(), FWModelExpressionSelector::select(), FWModelFilter::setExpression(), and FWExpressionEvaluator::setExpression().

◆ cutParser() [1/2]

bool reco::parser::cutParser ( const edm::TypeWithDict t,
const std::string &  cut,
SelectorPtr sel,
bool  lazy = false 
)

Definition at line 7 of file cutParser.cc.

7  {
8  bool justBlanks = true;
9  for (std::string::const_iterator c = cut.begin(); c != cut.end(); ++c) {
10  if (*c != ' ') {
11  justBlanks = false;
12  break;
13  }
14  }
15  if (justBlanks) {
17  return true;
18  } else {
19  using namespace boost::spirit::classic;
20  Grammar grammar(sel, t, lazy);
21  bool returnValue = false;
22  const char* startingFrom = cut.c_str();
23  try {
24  returnValue = parse(startingFrom, grammar.use_parser<0>() >> end_p, space_p).full;
25  } catch (BaseException& e) {
27  << "Cut parser error:" << baseExceptionWhat(e) << " (char " << e.where - startingFrom << ")\n";
28  }
29  return returnValue;
30  }
31 }

References baseExceptionWhat(), c, edm::errors::Configuration, TkAlMuonSelectors_cfi::cut, MillePedeFileConverter_cfg::e, Exception, dumpparser::parse(), EgammaValidation_Wenu_cff::sel, and submitPVValidationJobs::t.

Referenced by cutParser().

◆ cutParser() [2/2]

template<typename T >
bool reco::parser::cutParser ( const std::string &  cut,
SelectorPtr sel,
bool  lazy = false 
)
inline

Definition at line 13 of file cutParser.h.

13  {
14  return reco::parser::cutParser(edm::TypeWithDict(typeid(T)), cut, sel, lazy);
15  }

References TkAlMuonSelectors_cfi::cut, cutParser(), and EgammaValidation_Wenu_cff::sel.

◆ expressionParser() [1/2]

bool reco::parser::expressionParser ( const edm::TypeWithDict t,
const std::string &  value,
ExpressionPtr expr,
bool  lazy 
)

Definition at line 7 of file expressionParser.cc.

10  {
11  using namespace boost::spirit::classic;
12  Grammar grammar(expr, t, lazy);
13  bool returnValue = false;
14  const char* startingFrom = value.c_str();
15  try {
16  returnValue = parse(startingFrom, grammar.use_parser<1>() >> end_p, space_p).full;
17  } catch (BaseException& e) {
19  << "Expression parser error:" << baseExceptionWhat(e) << " (char " << e.where - startingFrom << ")\n";
20  }
21  return returnValue;
22 }

References baseExceptionWhat(), edm::errors::Configuration, MillePedeFileConverter_cfg::e, Exception, jets_cff::expr, dumpparser::parse(), and submitPVValidationJobs::t.

Referenced by expressionParser().

◆ expressionParser() [2/2]

template<typename T >
bool reco::parser::expressionParser ( const std::string &  value,
ExpressionPtr expr,
bool  lazy = false 
)

Definition at line 13 of file expressionParser.h.

13  {
15  }

References jets_cff::expr, and expressionParser().

◆ operator<<() [1/6]

template<class T >
Exception& reco::parser::operator<< ( const Exception e,
const T iT 
)
inline

Definition at line 87 of file Exception.h.

87  {
88  return operator<<(const_cast<Exception&>(e), iT);
89  }

References MillePedeFileConverter_cfg::e.

◆ operator<<() [2/6]

Exception& reco::parser::operator<< ( const Exception e,
std::ios_base &(*)(std::ios_base &)  f 
)
inline

Definition at line 102 of file Exception.h.

102  {
103  f(const_cast<Exception&>(e).ost_);
104  return const_cast<Exception&>(e);
105  }

References MillePedeFileConverter_cfg::e, and f.

◆ operator<<() [3/6]

Exception& reco::parser::operator<< ( const Exception e,
std::ostream &(*)(std::ostream &)  f 
)
inline

Definition at line 94 of file Exception.h.

94  {
95  f(const_cast<Exception&>(e).ost_);
96  return const_cast<Exception&>(e);
97  }

References MillePedeFileConverter_cfg::e, and f.

◆ operator<<() [4/6]

template<class T >
Exception& reco::parser::operator<< ( Exception e,
const T iT 
)
inline

Definition at line 82 of file Exception.h.

82  {
83  e.ost_ << iT;
84  return e;
85  }

References MillePedeFileConverter_cfg::e.

◆ operator<<() [5/6]

Exception& reco::parser::operator<< ( Exception e,
std::ios_base &(*)(std::ios_base &)  f 
)
inline

Definition at line 98 of file Exception.h.

98  {
99  f(e.ost_);
100  return e;
101  }

References MillePedeFileConverter_cfg::e, and f.

◆ operator<<() [6/6]

Exception& reco::parser::operator<< ( Exception e,
std::ostream &(*)(std::ostream &)  f 
)
inline

Definition at line 90 of file Exception.h.

90  {
91  f(e.ost_);
92  return e;
93  }

References MillePedeFileConverter_cfg::e, and f.

reco::parser::kLog
Definition: Function.h:29
reco::parser::kSin
Definition: Function.h:34
reco::parser::kCosh
Definition: Function.h:26
reco::parser::kTanh
Definition: Function.h:38
reco::parser::baseExceptionWhat
const char * baseExceptionWhat(const BaseException &e)
returns the appropriate 'what' message for the exception
Definition: Exception.h:36
reco::parser::kAcos
Definition: Function.h:20
reco::parser::kIsNotPublic
Definition: ErrorCodes.h:33
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
reco::parser::kNameDoesNotExist
Definition: ErrorCodes.h:32
boost::spirit::classic
Definition: DDPartSelection.cc:10
reco::parser::kIsOperator
Definition: ErrorCodes.h:39
kMax
#define kMax
Definition: Hydjet2Hadronizer.h:46
reco::parser::kSyntaxError
Definition: Exception.h:31
reco::parser::kHypot
Definition: Function.h:28
reco::parser::cutParser
bool cutParser(const edm::TypeWithDict &t, const std::string &cut, SelectorPtr &sel, bool lazy)
Definition: cutParser.cc:7
reco::parser::kIsFunctionAddedByROOT
Definition: ErrorCodes.h:36
reco::parser::kCos
Definition: Function.h:25
reco::parser::kIsDestructor
Definition: ErrorCodes.h:38
reco::parser::kIsNotConst
Definition: ErrorCodes.h:35
reco::parser::kAsin
Definition: Function.h:21
reco::parser::kDeltaR
Definition: Function.h:39
reco::parser::kDeltaPhi
Definition: Function.h:40
reco::parser::kMissingClosingParenthesis
Definition: Exception.h:31
reco::parser::kAtan
Definition: Function.h:22
dumpparser.parse
def parse(path, config)
Definition: dumpparser.py:13
edm::TypeWithDict
Definition: TypeWithDict.h:38
reco::parser::kNoError
Definition: ErrorCodes.h:31
reco::parser::BaseException
boost::spirit::classic::parser_error< reco::parser::SyntaxErrors > BaseException
Definition: Exception.h:33
reco::parser::kSqrt
Definition: Function.h:36
reco::parser::kOverloaded
Definition: ErrorCodes.h:42
value
Definition: value.py:1
reco::parser::kSpecialError
Definition: Exception.h:31
reco::parser::Grammar
Definition: Grammar.h:45
reco::parser::kChi2Prob
Definition: Function.h:24
reco::parser::kAbs
Definition: Function.h:19
reco::parser::kIsStatic
Definition: ErrorCodes.h:34
jets_cff.expr
expr
Definition: jets_cff.py:489
T
long double T
Definition: Basic3DVectorLD.h:48
reco::parser::SelectorPtr
std::shared_ptr< SelectorBase > SelectorPtr
Definition: SelectorPtr.h:18
reco::parser::kTan
Definition: Function.h:37
Exception
Definition: hltDiff.cc:245
reco::parser::kAtan2
Definition: Function.h:23
reco::parser::kMin
Definition: Function.h:32
reco::parser::kIsConstructor
Definition: ErrorCodes.h:37
reco::parser::kWrongNumberOfArguments
Definition: ErrorCodes.h:40
reco::parser::kExp
Definition: Function.h:27
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33
reco::parser::kTestBit
Definition: Function.h:41
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
reco::parser::expressionParser
bool expressionParser(const edm::TypeWithDict &t, const std::string &value, ExpressionPtr &expr, bool lazy)
Definition: expressionParser.cc:7
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
reco::parser::kLog10
Definition: Function.h:30
reco::parser::kPow
Definition: Function.h:33
edm::errors::Configuration
Definition: EDMException.h:36
reco::parser::kSinh
Definition: Function.h:35
reco::parser::kWrongArgumentType
Definition: ErrorCodes.h:41
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
reco::parser::AnyObjSelector
Definition: AnyObjSelector.h:7