ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/VHbbAnalysisCode/interface/VHbbCandidateVariables.h
Revision: 1.1
Committed: Wed Aug 15 22:37:47 2012 UTC (12 years, 8 months ago) by grimes
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Log Message:
Long overdue commit with several new files

File Contents

# Content
1 #ifndef trkupgradeanalysis_VHbbCandidateVariables_h
2 #define trkupgradeanalysis_VHbbCandidateVariables_h
3
4 #include "TrkUpgradeAnalysis/VHbb/interface/IHistogramVariable.h"
5 #include <string>
6 #include <memory> // required for auto_ptr
7
8 // Can't forward declare this because I need declarations of the constituent classes
9 #include "VHbbAnalysis/VHbbDataFormats/interface/VHbbEvent.h"
10 #include "VHbbAnalysis/VHbbDataFormats/interface/VHbbCandidate.h"
11
12 // Forward declarations
13 class VHbbCandidate;
14 namespace trkupgradeanalysis
15 {
16 namespace tools
17 {
18 class NTupleRow;
19 }
20 }
21
22
23 namespace trkupgradeanalysis
24 {
25 namespace variables
26 {
27 /** @brief Abstract base class for implementations of IHistogramVariable that can set themselves from VHbbCandidates.
28 *
29 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
30 * @date 06/Jun/2012
31 */
32 class VHbbCandidateVariable : public trkupgradeanalysis::IHistogramVariable
33 {
34 public:
35 VHbbCandidateVariable( const std::string& name, size_t suggestedNumberOfBins, double suggestedLowerEdge, double suggestedUpperEdge );
36 virtual ~VHbbCandidateVariable();
37
38 //
39 // The implementations required by the IHistogramVariable interface.
40 // variableName and histogrammableValue are implemented here, the subclass
41 // should implement the suggestedNumberOfBins, suggestedLowerEdge and suggestedUpperEdge
42 // methods
43 //
44 virtual std::string variableName() const;
45 virtual double histogrammableValue() const;
46 virtual size_t suggestedNumberOfBins() const;
47 virtual double suggestedLowerEdge() const;
48 virtual double suggestedUpperEdge() const;
49
50 /** Method so that implementations can set their values from a VHbbCandidate.
51 * Implementations can override this and use it to set the value_ member for this
52 * base class to do everything else. */
53 virtual void set( const VHbbCandidate& vhbbCandidate ) = 0;
54
55 /** Method to set the variable from a previously saved TTree.*/
56 virtual void set( const trkupgradeanalysis::tools::NTupleRow& ntupleRow );
57
58 /** Method to easily make copies through the base interface. */
59 virtual std::auto_ptr<VHbbCandidateVariable> copy() const = 0;
60 protected:
61 double value_;
62 std::string name_;
63 size_t suggestedNumberOfBins_;
64 double suggestedLowerEdge_;
65 double suggestedUpperEdge_;
66 };
67
68
69 /** @brief Class that calculates the number of additional jets from a VHbbCandidate.
70 *
71 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
72 * @date 06/Jun/2012
73 */
74 class NumberOfAdditionalJets : public trkupgradeanalysis::variables::VHbbCandidateVariable
75 {
76 public:
77 NumberOfAdditionalJets( bool applyCleaning=true );
78 virtual void set( const VHbbCandidate& vhbbCandidate );
79 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
80 protected:
81 bool applyCleaning_;
82 bool jetId( const VHbbEvent::SimpleJet& jet ) const;
83 };
84
85
86
87 /** @brief Class that calculates the di-jet mass from a VHbbCandidate.
88 *
89 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
90 * @date 06/Jun/2012
91 */
92 class DiJetMass : public trkupgradeanalysis::variables::VHbbCandidateVariable
93 {
94 public:
95 DiJetMass();
96 virtual void set( const VHbbCandidate& vhbbCandidate );
97 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
98 };
99
100
101
102 /** @brief Class that finds the highest CSV tag of a jet collection from a VHbbCandidate.
103 *
104 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
105 * @date 06/Jun/2012
106 */
107 class HighestCSV : public trkupgradeanalysis::variables::VHbbCandidateVariable
108 {
109 public:
110 /** @brief Constructor that optionally takes a limit on how many jets to check.
111 *
112 * The number of jets to check can be set with "maximumJetNumber". E.g. if this is set to 1 then
113 * only the first jet is checked, if set to 2 the first two jets are checked etcetera. If it is set
114 * to 0 (default) then all jets are checked.
115 */
116 HighestCSV( size_t maximumJetNumber=0 );
117 virtual void set( const VHbbCandidate& vhbbCandidate );
118 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
119 protected:
120 size_t maximumJetNumber_;
121 };
122
123
124
125 /** @brief Class that finds the lowest CSV tag of a jet collection from a VHbbCandidate.
126 *
127 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
128 * @date 06/Jun/2012
129 */
130 class LowestCSV : public trkupgradeanalysis::variables::VHbbCandidateVariable
131 {
132 public:
133 /** @brief Constructor that optionally takes a limit on how many jets to check.
134 *
135 * The number of jets to check can be set with "maximumJetNumber". E.g. if this is set to 1 then
136 * only the first jet is checked, if set to 2 the first two jets are checked etcetera. If it is set
137 * to 0 (default) then all jets are checked.
138 */
139 LowestCSV( size_t maximumJetNumber=0 );
140 virtual void set( const VHbbCandidate& vhbbCandidate );
141 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
142 protected:
143 size_t maximumJetNumber_;
144 };
145
146
147
148 /** @brief Class that gets the number of used jets (i.e. not including additional jets) from a VHbbCandidate.
149 *
150 * One would assume this should always be 2, but there's no harm in checking is there?
151 *
152 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
153 * @date 06/Jun/2012
154 */
155 class NumberOfJets : public trkupgradeanalysis::variables::VHbbCandidateVariable
156 {
157 public:
158 NumberOfJets();
159 virtual void set( const VHbbCandidate& vhbbCandidate );
160 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
161 };
162
163
164
165 /** @brief Class that gets the number of pixel hits in one of the muons in the di-muon pair.
166 *
167 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
168 * @date 04/Jul/2012
169 */
170 class MuonPixelHits : public trkupgradeanalysis::variables::VHbbCandidateVariable
171 {
172 public:
173 /** @brief Constructor where you set whether to look at the first muon or the second.
174 * @parameter checkFirstMuon If this is true the first muon is checked, if false the second is checked.
175 */
176 MuonPixelHits( bool checkFirstMuon );
177 virtual void set( const VHbbCandidate& vhbbCandidate );
178 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
179 protected:
180 bool checkFirstMuon_;
181 bool throwExceptions_;
182 };
183
184
185
186 /** @brief Like MuonPixelHits, but gives the highest value of the two muons.
187 *
188 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
189 * @date 04/Jul/2012
190 */
191 class HighestMuonPixelHits : public trkupgradeanalysis::variables::VHbbCandidateVariable
192 {
193 public:
194 HighestMuonPixelHits();
195 virtual void set( const VHbbCandidate& vhbbCandidate );
196 virtual void set( const trkupgradeanalysis::tools::NTupleRow& ntupleRow ); ///< Override so that I can check MuonPixelHits as well as HighestMuonPixelHits
197 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
198 protected:
199 bool throwExceptions_;
200 };
201
202
203
204 /** @brief Like MuonPixelHits, but gives the lowest value of the two muons.
205 *
206 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
207 * @date 04/Jul/2012
208 */
209 class LowestMuonPixelHits : public trkupgradeanalysis::variables::VHbbCandidateVariable
210 {
211 public:
212 LowestMuonPixelHits();
213 virtual void set( const VHbbCandidate& vhbbCandidate );
214 virtual void set( const trkupgradeanalysis::tools::NTupleRow& ntupleRow ); ///< Override so that I can check MuonPixelHits as well as HighestMuonPixelHits
215 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
216 protected:
217 bool throwExceptions_;
218 };
219
220
221
222 /** @brief Class
223 *
224 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
225 * @date 06/Jul/2012
226 */
227 class CandidateType : public trkupgradeanalysis::variables::VHbbCandidateVariable
228 {
229 public:
230 CandidateType();
231 virtual void set( const VHbbCandidate& vhbbCandidate );
232 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
233 };
234
235 /** @brief Class
236 *
237 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
238 * @date 06/Jul/2012
239 */
240 class DiLeptonMass : public trkupgradeanalysis::variables::VHbbCandidateVariable
241 {
242 public:
243 DiLeptonMass();
244 virtual void set( const VHbbCandidate& vhbbCandidate );
245 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
246 };
247
248 /** @brief Class
249 *
250 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
251 * @date 06/Jul/2012
252 */
253 class HiggsCandidatePt : public trkupgradeanalysis::variables::VHbbCandidateVariable
254 {
255 public:
256 HiggsCandidatePt();
257 virtual void set( const VHbbCandidate& vhbbCandidate );
258 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
259 };
260
261 /** @brief Class
262 *
263 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
264 * @date 06/Jul/2012
265 */
266 class VectorBosonCandidatePt : public trkupgradeanalysis::variables::VHbbCandidateVariable
267 {
268 public:
269 VectorBosonCandidatePt();
270 virtual void set( const VHbbCandidate& vhbbCandidate );
271 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
272 };
273
274 /** @brief Class
275 *
276 * @author Mark Grimes (mark.grimes@bristol.ac.uk)
277 * @date 06/Jul/2012
278 */
279 class DeltaPhiVH : public trkupgradeanalysis::variables::VHbbCandidateVariable
280 {
281 public:
282 DeltaPhiVH();
283 virtual void set( const VHbbCandidate& vhbbCandidate );
284 virtual std::auto_ptr<VHbbCandidateVariable> copy() const;
285 };
286
287 } // end of namespace variables
288 } // end of namespace trkupgradeanalysis
289
290
291 #endif // end of "#ifndef trkupgradeanalysis_VHbbCandidateVariables_h"