1 #ifndef PhysicsTools_FWLite_ScannerHelpers_h 2 #define PhysicsTools_FWLite_ScannerHelpers_h 13 #if !defined(__CINT__) && !defined(__MAKECINT__) 53 bool addExpression(
const char *
expr);
60 bool setCut(
const char *
cut);
64 bool addExtraCut(
const char *cut);
66 void clearExtraCuts();
72 bool test(
const void *
obj,
size_t icut = 0)
const;
76 double eval(
const void *obj,
size_t iexpr = 0)
const;
80 void print(
const void *obj)
const;
84 void fill1D(
const void *obj, TH1 *
hist)
const;
88 void fill2D(
const void *obj, TH2 *hist2d)
const;
92 void fillGraph(
const void *obj, TGraph *graph)
const;
96 void fillProf(
const void *obj, TProfile *prof)
const;
104 std::vector<reco::parser::ExpressionPtr>
exprs_;
107 std::vector<reco::parser::SelectorPtr>
cuts_;
void setIgnoreExceptions(bool ignoreThem)
std::shared_ptr< ExpressionBase > ExpressionPtr
void clearExpressions()
Clear all the expressions.
S & print(S &os, JobReport::InputFile const &f)
static bool test(const reco::parser::SelectorPtr &sel, const edm::TypeWithDict type, const void *obj)
Make a edm::ObjectWithDict(type, obj) and pass it to the selector.
std::vector< reco::parser::SelectorPtr > cuts_
The first one is the default cut, the others are the extra ones.
std::vector< reco::parser::ExpressionPtr > exprs_
ScannerBase(const edm::TypeWithDict &objType)
Constructor taking as argument the type of the individual object passed to the scanner.
ScannerBase()
Empty constructor, necessary for Root, DO NOT USE.
bool ignoreExceptions_
See setIgnoreExceptions to find out what this means.
static edm::TypeWithDict elementType(const edm::TypeWithDict &wrapperType)
Perform the type deduction form edm::Wrapper<C> to C::value_type and resolves typedefs.
size_t numberOfExtraCuts() const
Number of extra cuts.
static reco::parser::ExpressionPtr makeExpression(const std::string &expr, const edm::TypeWithDict &type)
Parse an expression for a given object type (using lazy parsing when resolving methods) ...
static double eval(const reco::parser::ExpressionPtr &sel, const edm::TypeWithDict type, const void *obj)
Make a edm::ObjectWithDict(type, obj) and pass it to the expression.
static reco::parser::SelectorPtr makeSelector(const std::string &expr, const edm::TypeWithDict &type)
Parse an expression for a given object type (using lazy parsing when resolving methods) ...
edm::TypeWithDict objType_
Parser()
Empty constructor, necessary for Root, useless.
size_t numberOfExpressions() const
Number of valid expressions.
std::shared_ptr< SelectorBase > SelectorPtr