#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 44 of file ScannerHelpers.h.
|
inline |
Empty constructor, necessary for Root, DO NOT USE.
Definition at line 47 of file ScannerHelpers.h.
|
inline |
Constructor taking as argument the type of the individual object passed to the scanner.
Definition at line 49 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 67 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, jets_cff::expr, 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 92 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, TkAlMuonSelectors_cfi::cut, helper::Parser::makeSelector(), and convertSQLiteXML::ok.
Referenced by fwlite::Scanner< Collection >::fillDataSet().
void helper::ScannerBase::clearCut | ( | ) |
|
inline |
void helper::ScannerBase::clearExtraCuts | ( | ) |
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 118 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::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 179 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cppFunctionSkipper::exception, get, gpuVertexFinder::hist, 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 192 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cppFunctionSkipper::exception, get, gpuVertexFinder::hist, 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 205 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cppFunctionSkipper::exception, get, 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 218 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cppFunctionSkipper::exception, get, gpuVertexFinder::hist, and getGTfromDQMFile::obj.
Referenced by fwlite::Scanner< Collection >::drawProf().
|
inline |
|
inline |
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 130 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, cppFunctionSkipper::exception, get, getGTfromDQMFile::obj, runTheMatrix::ret, 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 78 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, TkAlMuonSelectors_cfi::cut, get, 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 100 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 103 of file ScannerHelpers.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cppFunctionSkipper::exception, get, and getGTfromDQMFile::obj.
Referenced by fwlite::ObjectCountSelector< Collection >::accept(), 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.
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.