1 |
gpetrucc |
1.1 |
//#include "DataFormats/Candidate/interface/Candidate.h"
|
2 |
|
|
//#include "DataFormats/TrackReco/interface/Track.h"
|
3 |
|
|
//#include "DataFormats/VertexReco/interface/Vertex.h"
|
4 |
|
|
//#include "CommonTools/Utils/interface/StringObjectFunction.h"
|
5 |
|
|
//#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
|
6 |
|
|
|
7 |
|
|
#include <string>
|
8 |
|
|
#include <Reflex/Type.h>
|
9 |
|
|
|
10 |
|
|
#if !defined(__CINT__) && !defined(__MAKECINT__)
|
11 |
|
|
#include "CommonTools/Utils/src/ExpressionPtr.h"
|
12 |
|
|
#include "CommonTools/Utils/src/SelectorPtr.h"
|
13 |
|
|
#include "CommonTools/Utils/src/ExpressionBase.h"
|
14 |
|
|
#include "CommonTools/Utils/src/SelectorBase.h"
|
15 |
|
|
#endif
|
16 |
|
|
|
17 |
|
|
namespace helper {
|
18 |
|
|
class Parser {
|
19 |
|
|
public:
|
20 |
|
|
Parser() {}
|
21 |
|
|
reco::parser::ExpressionPtr makeExpression(const std::string &expr, const Reflex::Type &type) const ;
|
22 |
|
|
reco::parser::SelectorPtr makeSelector(const std::string &expr, const Reflex::Type &type) const ;
|
23 |
|
|
Reflex::Type elementType(const Reflex::Type &wrapperType) const ;
|
24 |
|
|
};
|
25 |
|
|
class ScannerBase {
|
26 |
|
|
public:
|
27 |
|
|
ScannerBase(const Reflex::Type &objType) : objType_(objType) {}
|
28 |
|
|
void clearExpressions() { exprs_.clear(); }
|
29 |
|
|
void addExpression(const char *expr) ;
|
30 |
|
|
void setCut(const char *cut) ;
|
31 |
|
|
void clearCut() { cut_.reset(); }
|
32 |
|
|
|
33 |
|
|
/// obj must point to an object of the correct type!
|
34 |
|
|
bool test(const void *obj) ;
|
35 |
|
|
void print(const void *obj) ;
|
36 |
|
|
private:
|
37 |
|
|
Parser helpme;
|
38 |
|
|
Reflex::Type objType_;
|
39 |
|
|
std::vector<reco::parser::ExpressionPtr> exprs_;
|
40 |
|
|
reco::parser::SelectorPtr cut_;
|
41 |
|
|
};
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
|