#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.
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 64 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::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 98 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, helper::Parser::makeSelector(), and convertSQLiteXML::ok.
Referenced by fwlite::Scanner< Collection >::fillDataSet().
void helper::ScannerBase::clearCut | ( | ) |
Clear the default cut.
Definition at line 87 of file ScannerHelpers.cc.
|
inline |
Clear all the expressions.
Definition at line 56 of file ScannerHelpers.h.
References exprs_.
void helper::ScannerBase::clearExtraCuts | ( | ) |
Clear all extra cuts ;.
Definition at line 92 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 124 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, getGTfromDQMFile::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 182 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, and getGTfromDQMFile::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 194 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, and getGTfromDQMFile::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 206 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, and getGTfromDQMFile::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 219 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, and getGTfromDQMFile::obj.
Referenced by fwlite::Scanner< Collection >::drawProf().
|
inline |
Number of valid expressions.
Definition at line 58 of file ScannerHelpers.h.
References exprs_.
|
inline |
Number of extra cuts.
Definition at line 69 of file ScannerHelpers.h.
References cuts_.
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 135 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, cppFunctionSkipper::exception, getGTfromDQMFile::obj, and run_regression::ret.
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 76 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::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(), fwlite::ObjectCountSelector< Collection >::ObjectCountSelector(), fwlite::Scanner< Collection >::scan(), and fwlite::ObjectCountSelector< Collection >::setCut().
|
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.
References ignoreExceptions_.
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(), fwlite::ObjectCountSelector< Collection >::ObjectCountSelector(), fwlite::Scanner< Collection >::scan(), and fwlite::ObjectCountSelector< Collection >::setIgnoreExceptions().
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 111 of file ScannerHelpers.cc.
References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, and getGTfromDQMFile::obj.
Referenced by fwlite::ObjectCountSelector< Collection >::accept(), fwlite::Scanner< Collection >::count(), fwlite::Scanner< Collection >::draw2D(), fwlite::Scanner< Collection >::fillDataSet(), and fwlite::Scanner< Collection >::scan().
|
private |
The first one is the default cut, the others are the extra ones.
Definition at line 107 of file ScannerHelpers.h.
Referenced by numberOfExtraCuts().
|
private |
Definition at line 104 of file ScannerHelpers.h.
Referenced by clearExpressions(), and numberOfExpressions().
|
private |
See setIgnoreExceptions to find out what this means.
Definition at line 110 of file ScannerHelpers.h.
Referenced by setIgnoreExceptions().
|
private |
Definition at line 103 of file ScannerHelpers.h.