ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/GPetrucc/interface/fwliteHelpers.h
Revision: 1.2
Committed: Sun Jan 31 10:20:21 2010 UTC (15 years, 3 months ago) by gpetrucc
Content type: text/plain
Branch: MAIN
Changes since 1.1: +8 -0 lines
Log Message:
First implementation of draw

File Contents

# User Rev Content
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 gpetrucc 1.2 #include <TH1.h>
10     #include <TH2.h>
11     #include <TProfile.h>
12     #include <TGraph.h>
13 gpetrucc 1.1
14     #if !defined(__CINT__) && !defined(__MAKECINT__)
15     #include "CommonTools/Utils/src/ExpressionPtr.h"
16     #include "CommonTools/Utils/src/SelectorPtr.h"
17     #include "CommonTools/Utils/src/ExpressionBase.h"
18     #include "CommonTools/Utils/src/SelectorBase.h"
19     #endif
20    
21     namespace helper {
22     class Parser {
23     public:
24     Parser() {}
25     reco::parser::ExpressionPtr makeExpression(const std::string &expr, const Reflex::Type &type) const ;
26     reco::parser::SelectorPtr makeSelector(const std::string &expr, const Reflex::Type &type) const ;
27     Reflex::Type elementType(const Reflex::Type &wrapperType) const ;
28     };
29     class ScannerBase {
30     public:
31     ScannerBase(const Reflex::Type &objType) : objType_(objType) {}
32     void clearExpressions() { exprs_.clear(); }
33     void addExpression(const char *expr) ;
34     void setCut(const char *cut) ;
35     void clearCut() { cut_.reset(); }
36    
37     /// obj must point to an object of the correct type!
38     bool test(const void *obj) ;
39     void print(const void *obj) ;
40 gpetrucc 1.2
41     void fill1D(const void *obj, TH1 *hist) ;
42     void fill2D(const void *obj, TH2 *hist2d) ;
43     void fillProf(const void *obj, TProfile *prof) ;
44 gpetrucc 1.1 private:
45     Parser helpme;
46     Reflex::Type objType_;
47     std::vector<reco::parser::ExpressionPtr> exprs_;
48     reco::parser::SelectorPtr cut_;
49     };
50     }
51    
52