1 |
+ |
#ifndef UserCode_GPetrucc_fwliteHelpers_h |
2 |
+ |
#define UserCode_GPetrucc_fwliteHelpers_h |
3 |
|
//#include "DataFormats/Candidate/interface/Candidate.h" |
4 |
|
//#include "DataFormats/TrackReco/interface/Track.h" |
5 |
|
//#include "DataFormats/VertexReco/interface/Vertex.h" |
24 |
|
class Parser { |
25 |
|
public: |
26 |
|
Parser() {} |
27 |
< |
reco::parser::ExpressionPtr makeExpression(const std::string &expr, const Reflex::Type &type) const ; |
28 |
< |
reco::parser::SelectorPtr makeSelector(const std::string &expr, const Reflex::Type &type) const ; |
29 |
< |
Reflex::Type elementType(const Reflex::Type &wrapperType) const ; |
27 |
> |
static reco::parser::ExpressionPtr makeExpression(const std::string &expr, const Reflex::Type &type) ; |
28 |
> |
static reco::parser::SelectorPtr makeSelector(const std::string &expr, const Reflex::Type &type) ; |
29 |
> |
static Reflex::Type elementType(const Reflex::Type &wrapperType) ; |
30 |
|
}; |
31 |
|
class ScannerBase { |
32 |
|
public: |
33 |
< |
ScannerBase(const Reflex::Type &objType) : objType_(objType) {} |
33 |
> |
ScannerBase() {} |
34 |
> |
ScannerBase(const Reflex::Type &objType) : objType_(objType), ignoreExceptions_(false) {} |
35 |
|
void clearExpressions() { exprs_.clear(); } |
36 |
|
void addExpression(const char *expr) ; |
37 |
|
void setCut(const char *cut) ; |
38 |
|
void clearCut() { cut_.reset(); } |
39 |
|
|
40 |
|
/// obj must point to an object of the correct type! |
41 |
< |
bool test(const void *obj) ; |
42 |
< |
void print(const void *obj) ; |
41 |
> |
bool test(const void *obj) const ; |
42 |
> |
void print(const void *obj) const ; |
43 |
|
|
44 |
< |
void fill1D(const void *obj, TH1 *hist) ; |
45 |
< |
void fill2D(const void *obj, TH2 *hist2d) ; |
46 |
< |
void fillProf(const void *obj, TProfile *prof) ; |
44 |
> |
void fill1D(const void *obj, TH1 *hist) const ; |
45 |
> |
void fill2D(const void *obj, TH2 *hist2d) const ; |
46 |
> |
void fillProf(const void *obj, TProfile *prof) const ; |
47 |
> |
|
48 |
> |
void setIgnoreExceptions(bool ignoreThem) { ignoreExceptions_ = ignoreThem; } |
49 |
|
private: |
45 |
– |
Parser helpme; |
50 |
|
Reflex::Type objType_; |
51 |
|
std::vector<reco::parser::ExpressionPtr> exprs_; |
52 |
|
reco::parser::SelectorPtr cut_; |
53 |
+ |
bool ignoreExceptions_; |
54 |
|
}; |
55 |
|
} |
56 |
|
|
57 |
< |
|
57 |
> |
#endif |