#include <ScannerHelpers.h>
Public Member Functions | |
bool | addExpression (const char *expr) |
bool | addExtraCut (const char *cut) |
Add one extra cut that can be evaluated separately (as if it was an expression) More... | |
void | clearCut () |
Clear the default cut. More... | |
void | clearExpressions () |
Clear all the expressions. More... | |
void | clearExtraCuts () |
Clear all extra cuts ;. More... | |
double | eval (const void *obj, size_t iexpr=0) const |
void | fill1D (const void *obj, TH1 *hist) const |
void | fill2D (const void *obj, TH2 *hist2d) const |
void | fillGraph (const void *obj, TGraph *graph) const |
void | fillProf (const void *obj, TProfile *prof) const |
size_t | numberOfExpressions () const |
Number of valid expressions. More... | |
size_t | numberOfExtraCuts () const |
Number of extra cuts. More... | |
void | print (const void *obj) const |
ScannerBase () | |
Empty constructor, necessary for Root, DO NOT USE. More... | |
ScannerBase (const edm::TypeWithDict &objType) | |
Constructor taking as argument the type of the individual object passed to the scanner. More... | |
bool | setCut (const char *cut) |
Set the default cut that is applied to the events. More... | |
void | setIgnoreExceptions (bool ignoreThem) |
bool | test (const void *obj, size_t icut=0) const |
Private Attributes | |
std::vector< reco::parser::SelectorPtr > | cuts_ |
The first one is the default cut, the others are the extra ones. More... | |
std::vector< reco::parser::ExpressionPtr > | exprs_ |
bool | ignoreExceptions_ |
See setIgnoreExceptions to find out what this means. More... | |
edm::TypeWithDict | objType_ |
Class helper::ScannerBase: tool to print or histogram proprieties of an object using the dictionary, The class is generic, but each instance is restricted to the type of the objects to inspect, fixed at construction time.
Definition at line 45 of file ScannerHelpers.h.
|
inline |
Empty constructor, necessary for Root, DO NOT USE.
Definition at line 48 of file ScannerHelpers.h.
|
inline |
Constructor taking as argument the type of the individual object passed to the scanner.
Definition at line 50 of file ScannerHelpers.h.
References jets_cff::expr.
bool helper::ScannerBase::addExpression | ( | const char * | expr | ) |
Add an expression to be evaluated on the objects Returns false if the parsing failed
Definition at line 65 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, helper::Parser::makeExpression(), and convertSQLiteXML::ok.
Referenced by fwlite::Scanner< Collection >::draw(), fwlite::Scanner< Collection >::draw2D(), fwlite::Scanner< Collection >::drawGraph(), fwlite::Scanner< Collection >::drawProf(), fwlite::Scanner< Collection >::fillDataSet(), and fwlite::Scanner< Collection >::scan().
bool helper::ScannerBase::addExtraCut | ( | const char * | cut | ) |
Add one extra cut that can be evaluated separately (as if it was an expression)
Definition at line 99 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, helper::Parser::makeSelector(), and convertSQLiteXML::ok.
Referenced by fwlite::Scanner< Collection >::fillDataSet().
void helper::ScannerBase::clearCut | ( | ) |
Clear the default cut.
Definition at line 88 of file ScannerHelpers.cc.
|
inline |
Clear all the expressions.
Definition at line 56 of file ScannerHelpers.h.
void helper::ScannerBase::clearExtraCuts | ( | ) |
Clear all extra cuts ;.
Definition at line 93 of file ScannerHelpers.cc.
double helper::ScannerBase::eval | ( | const void * | obj, |
size_t | iexpr = 0 |
||
) | const |
Evaluate one of the expressions set in this scanner Obj must point to an object of the type used to construct this ScannerBase
Definition at line 125 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, cppFunctionSkipper::exception, GetRecoTauVFromDQM_MC_cff::obj, and relativeConstraints::value.
Referenced by fwlite::Scanner< Collection >::draw2D(), and fwlite::Scanner< Collection >::fillDataSet().
void helper::ScannerBase::fill1D | ( | const void * | obj, |
TH1 * | hist | ||
) | const |
Fill the histogram with the first expression evaluated on the object, if it passes the default cut Obj must point to an object of the type used to construct this ScannerBase
Definition at line 183 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, cppFunctionSkipper::exception, and GetRecoTauVFromDQM_MC_cff::obj.
Referenced by fwlite::Scanner< Collection >::draw().
void helper::ScannerBase::fill2D | ( | const void * | obj, |
TH2 * | hist2d | ||
) | const |
Fill the histogram with (x,y) equal to the first and second expressions evaluated on the object, if it passes the default cut Obj must point to an object of the type used to construct this ScannerBase
Definition at line 195 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, cppFunctionSkipper::exception, and GetRecoTauVFromDQM_MC_cff::obj.
Referenced by fwlite::Scanner< Collection >::draw2D().
void helper::ScannerBase::fillGraph | ( | const void * | obj, |
TGraph * | graph | ||
) | const |
Fill the graph with (x,y) equal to the first and second expressions evaluated on the object, if it passes the default cut Obj must point to an object of the type used to construct this ScannerBase
Definition at line 207 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, cppFunctionSkipper::exception, and GetRecoTauVFromDQM_MC_cff::obj.
Referenced by fwlite::Scanner< Collection >::drawGraph().
void helper::ScannerBase::fillProf | ( | const void * | obj, |
TProfile * | prof | ||
) | const |
Fill the profile histogram with (x,y) equal to the first and second expressions evaluated on the object, if it passes the default cut Obj must point to an object of the type used to construct this ScannerBase
Definition at line 220 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, cppFunctionSkipper::exception, and GetRecoTauVFromDQM_MC_cff::obj.
Referenced by fwlite::Scanner< Collection >::drawProf().
|
inline |
Number of valid expressions.
Definition at line 58 of file ScannerHelpers.h.
References TkAlMuonSelectors_cfi::cut.
|
inline |
Number of extra cuts.
Definition at line 69 of file ScannerHelpers.h.
References helper::Parser::eval(), create_public_lumi_plots::hist, GetRecoTauVFromDQM_MC_cff::obj, edm::print(), and helper::Parser::test().
void helper::ScannerBase::print | ( | const void * | obj | ) | const |
Print out in a single row all the expressions for this object Obj must point to an object of the type used to construct this ScannerBase
Definition at line 136 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, gather_cfg::cout, cppFunctionSkipper::exception, GetRecoTauVFromDQM_MC_cff::obj, mps_setup::stdout, and heppy_batch::val.
Referenced by fwlite::Scanner< Collection >::scan().
bool helper::ScannerBase::setCut | ( | const char * | cut | ) |
Set the default cut that is applied to the events.
Definition at line 77 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, helper::Parser::makeSelector(), and convertSQLiteXML::ok.
Referenced by fwlite::Scanner< Collection >::count(), fwlite::Scanner< Collection >::draw(), fwlite::Scanner< Collection >::draw2D(), fwlite::Scanner< Collection >::drawGraph(), fwlite::Scanner< Collection >::drawProf(), fwlite::Scanner< Collection >::fillDataSet(), and fwlite::Scanner< Collection >::scan().
|
inline |
If set to true, exceptions are silently ignored: test will return 'false', and 'eval' will return 0. If left to the default value, false, for each exception a printout is done.
Definition at line 101 of file ScannerHelpers.h.
Referenced by fwlite::Scanner< Collection >::count(), fwlite::Scanner< Collection >::draw(), fwlite::Scanner< Collection >::draw2D(), fwlite::Scanner< Collection >::drawGraph(), fwlite::Scanner< Collection >::drawProf(), fwlite::Scanner< Collection >::fillDataSet(), and fwlite::Scanner< Collection >::scan().
bool helper::ScannerBase::test | ( | const void * | obj, |
size_t | icut = 0 |
||
) | const |
Check if the object passes the default cut (icut=0) or any extra cut (icut = 1 .. numberOfExtraCuts) Obj must point to an object of the type used to construct this ScannerBase
Definition at line 112 of file ScannerHelpers.cc.
References MessageLogger_cfi::cerr, cppFunctionSkipper::exception, and GetRecoTauVFromDQM_MC_cff::obj.
Referenced by fwlite::Scanner< Collection >::count(), fwlite::Scanner< Collection >::draw2D(), fwlite::Scanner< Collection >::fillDataSet(), edmIntegrityCheck.IntegrityCheck::report(), fwlite::Scanner< Collection >::scan(), and edmIntegrityCheck.IntegrityCheck::structured().
|
private |
The first one is the default cut, the others are the extra ones.
Definition at line 107 of file ScannerHelpers.h.
|
private |
Definition at line 104 of file ScannerHelpers.h.
|
private |
See setIgnoreExceptions to find out what this means.
Definition at line 110 of file ScannerHelpers.h.
|
private |
Definition at line 103 of file ScannerHelpers.h.