ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/System8/s8/Utility/interface/SolverLeptonInJetPlots.h
Revision: 1.1
Committed: Fri May 6 14:36:55 2011 UTC (14 years ago) by samvel
Content type: text/plain
Branch: MAIN
CVS Tags: V00-00-04, V00-00-03, V00-00-02-04, V00-00-02-03, V00-00-02-02, V00-00-02-01, V00-00-02, melo-old, HEAD
Log Message:
Import Utility

File Contents

# User Rev Content
1 samvel 1.1 /**
2     * SolverLeptonInJetPlots
3     * s8
4     *
5     * Created by Samvel Khalatian on Nov 17, 2010
6     * Copyright 2010, All rights reserved
7     */
8    
9     #ifndef S8_SOLVER_MUON_IN_JET_PLOTS
10     #define S8_SOLVER_MUON_IN_JET_PLOTS
11    
12     #include <memory>
13     #include <string>
14    
15     class TDirectory;
16     class TH2;
17    
18     namespace s8
19     {
20     class Jet;
21     class Lepton;
22     class TaggerOperatingPoint;
23     class LeptonInJetDiscriminator;
24    
25     // plot namespace is designed solely for internal purposes. User should be
26     // working with s8::SolverLeptonInJetPlots class
27     //
28     namespace plot
29     {
30     // Generic interface for all plots
31     //
32     class LeptonInJetPlots
33     {
34     public:
35     virtual ~LeptonInJetPlots();
36    
37     // Plots should be booked in init
38     //
39     virtual void init() = 0;
40    
41     virtual void setDiscriminator(LeptonInJetDiscriminator *) = 0;
42    
43     // Group is responsible for filling plots
44     //
45     virtual void fill(const Lepton *, const Jet *,
46     const double &weight = 1) = 0;
47    
48     // Each group knows how to save itself
49     //
50     virtual void save(TDirectory *) const = 0;
51     };
52    
53     // Generic interface for all groups
54     //
55     class LeptonInJetGroup
56     {
57     public:
58     virtual ~LeptonInJetGroup();
59    
60     // TaggerOperatingPoint is used for b-Discriminant
61     //
62     virtual void setTaggerOperatingPoint(const TaggerOperatingPoint *) = 0;
63     };
64    
65     // Group of plots that has 2D Pt, Eta, etc. vs PtRel distributions,e.g.
66     //
67     // PtRel vs Pt
68     // PtRel vs Eta
69     // PtRel vs etc.
70     //
71     // where:
72     //
73     // PtRel is the length of the perpendicular vector of the muon momentum
74     // with respect to (muon+jet) momentum
75     //
76     // Pt is the corresponding Jet Pt
77     //
78     // Eta is the corresponding Jet Eta
79     //
80     class LeptonInJetPlotCategory: public LeptonInJetPlots
81     {
82     public:
83     // Prefix and Suffix
84     //
85     LeptonInJetPlotCategory(const std::string &, const std::string &);
86     virtual ~LeptonInJetPlotCategory();
87    
88     virtual void init();
89    
90     virtual void setDiscriminator(LeptonInJetDiscriminator *);
91    
92     virtual void fill(const Lepton *, const Jet *,
93     const double &weight = 1);
94     virtual void save(TDirectory *) const;
95    
96     private:
97     bool _didNotInitialize;
98    
99     std::string _prefix;
100     std::string _suffix;
101    
102     LeptonInJetDiscriminator *_discriminator;
103    
104     std::auto_ptr<TH2> _pt;
105     std::auto_ptr<TH2> _eta;
106     std::auto_ptr<TH2> _phi;
107     };
108    
109     // All and b-tagged jet categories.
110     //
111     class LeptonInJetPlotGroup: public LeptonInJetPlots,
112     public LeptonInJetGroup
113     {
114     public:
115     LeptonInJetPlotGroup(const std::string &, const std::string & = "");
116     virtual ~LeptonInJetPlotGroup();
117    
118     virtual void init();
119    
120     virtual void setDiscriminator(LeptonInJetDiscriminator *);
121    
122     virtual void setTaggerOperatingPoint(const TaggerOperatingPoint *);
123     virtual void fill(const Lepton *, const Jet *,
124     const double &weight = 1);
125     virtual void save(TDirectory *) const;
126    
127     private:
128     const TaggerOperatingPoint *_operatingPoint;
129    
130     std::auto_ptr<LeptonInJetPlotCategory> _all;
131     std::auto_ptr<LeptonInJetPlotCategory> _tag;
132     };
133    
134     // One PlotGroup for all jet flavours. Given set of plots should be
135     // used by Data input.
136     //
137     class NonFlavouredLeptonInJetPlotGroup: public LeptonInJetPlots,
138     public LeptonInJetGroup
139     {
140     public:
141     NonFlavouredLeptonInJetPlotGroup(const std::string &);
142    
143     virtual void init();
144    
145     virtual void setDiscriminator(LeptonInJetDiscriminator *);
146    
147     virtual void setTaggerOperatingPoint(const TaggerOperatingPoint *);
148     virtual void fill(const Lepton *, const Jet *,
149     const double &weight = 1);
150     virtual void save(TDirectory *) const;
151    
152     private:
153     std::auto_ptr<LeptonInJetPlotGroup> _plots;
154     };
155    
156     // Separate PlotGroup for each jet flavour
157     //
158     class FlavouredLeptonInJetPlotGroup: public LeptonInJetPlots,
159     public LeptonInJetGroup
160     {
161     public:
162     FlavouredLeptonInJetPlotGroup(const std::string &);
163    
164     virtual void init();
165    
166     virtual void setDiscriminator(LeptonInJetDiscriminator *);
167    
168     virtual void setTaggerOperatingPoint(const TaggerOperatingPoint *);
169     virtual void fill(const Lepton *, const Jet *,
170     const double &weight = 1);
171     virtual void save(TDirectory *) const;
172    
173     private:
174     std::auto_ptr<LeptonInJetPlotGroup> _b;
175     std::auto_ptr<LeptonInJetPlotGroup> _cl;
176     };
177     }
178    
179     // Combination of flavoured and non-flavoured plots. This set of plots
180     // should be used by Monte-Carlo inputs.
181     //
182     class SolverLeptonInJetPlots: public plot::LeptonInJetPlots,
183     public plot::LeptonInJetGroup
184     {
185     public:
186     SolverLeptonInJetPlots(const std::string &);
187    
188     virtual void init();
189    
190     bool isFlavoured() const;
191     void setIsFlavoured(const bool &);
192    
193     virtual void setDiscriminator(LeptonInJetDiscriminator *);
194    
195     virtual void setTaggerOperatingPoint(const TaggerOperatingPoint *);
196     virtual void fill(const Lepton *, const Jet *,
197     const double &weight = 1);
198     virtual void save(TDirectory *) const;
199    
200     private:
201     bool _isFlavoured;
202    
203     std::auto_ptr<plot::FlavouredLeptonInJetPlotGroup> _flavoured;
204     std::auto_ptr<plot::NonFlavouredLeptonInJetPlotGroup> _nonFlavoured;
205     };
206     }
207    
208     #endif