ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/Candidate.hh
Revision: 1.3
Committed: Tue Nov 8 21:41:46 2011 UTC (13 years, 5 months ago) by agilbert
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +3 -0 lines
Log Message:
Implement some basic print methods for the HbbEvent.

File Contents

# User Rev Content
1 agilbert 1.1 #ifndef HbbAnalysis_Candidate_hh
2     #define HbbAnalysis_Candidate_hh
3 agilbert 1.2 #include <cmath>
4 agilbert 1.1 #include "TLorentzVector.h"
5     #include "UserCode/HbbAnalysis/interface/Objects.hh"
6    
7     namespace HbbAnalysis {
8    
9     class Candidate{
10     public:
11     //Constructors
12     Candidate();
13     Candidate(HbbAnalysis::FourMomentum const& aFourVec){
14     fourVec(aFourVec);
15     }
16    
17     //Setters
18     void fourVec(HbbAnalysis::FourMomentum const& aFourVec) {
19     fourVec_ = aFourVec;
20     }
21    
22     //Getters
23     HbbAnalysis::FourMomentum const& fourVec() const {
24     return fourVec_;
25     }
26    
27     //Functions
28     void Clear();
29     TLorentzVector GetTLorentzVector() const {
30     return fourVec_.GetTLorentzVector();
31     }
32    
33 agilbert 1.2 inline double Pt() const {
34     return sqrt(fourVec_.px*fourVec_.px + fourVec_.py*fourVec_.py);
35     }
36    
37     inline double Eta() const {
38     double m = sqrt(fourVec_.px*fourVec_.px + fourVec_.py*fourVec_.py + fourVec_.pz*fourVec_.pz);
39     if ((m - fourVec_.pz) == 0.0) return 10e10;
40     return (0.5 * log((m+fourVec_.pz)/(m-fourVec_.pz)));
41     }
42    
43 agilbert 1.3 void Print() const;
44    
45    
46 agilbert 1.1 private:
47     FourMomentum fourVec_;
48     };
49    
50     }
51     #endif