ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbbAnalysis/VHbbDataFormats/interface/VHbbCandidate.h
Revision: 1.8
Committed: Thu Sep 1 12:33:08 2011 UTC (13 years, 8 months ago) by arizzi
Content type: text/plain
Branch: MAIN
CVS Tags: AR_Sep8_LightNtuple
Changes since 1.7: +19 -1 lines
Log Message:
add accessors

File Contents

# User Rev Content
1 tboccali 1.1 #ifndef VHbbCandidate__H
2     #define VHbbCandidate__H
3    
4     #include <TLorentzVector.h>
5     #include <TVector2.h>
6     #include <vector>
7    
8     #include "VHbbAnalysis/VHbbDataFormats/interface/VHbbEvent.h"
9    
10     class VHbbCandidate {
11     public:
12 arizzi 1.7 //Zmumu = 0
13     //Zee = 1
14     //Wmun = 2
15     //Wen = 3
16     //Znn = 4
17    
18     enum CandidateType{Zmumu, Zee, Wmun, Wen, Znn, UNKNOWN};
19 tboccali 1.1
20     VHbbCandidate(){candidateType=UNKNOWN;}
21    
22     class VectorCandidate {
23     public:
24 arizzi 1.8 double Mt(CandidateType candidateType) const {
25 arizzi 1.6 if(candidateType==Wen)
26     {
27     float ptl=electrons[0].p4.Pt();
28     float met=mets[0].p4.Pt();
29     float et=ptl+met;
30     return sqrt(et*et - p4.Pt()*p4.Pt() );
31     }
32     if(candidateType==Wmun)
33     {
34     float ptl=muons[0].p4.Pt();
35     float met=mets[0].p4.Pt();
36     float et=ptl+met;
37     return sqrt(et*et - p4.Pt()*p4.Pt() );
38     }
39     return 0;
40     }
41 tboccali 1.4 TLorentzVector p4;
42 tboccali 1.1 std::vector<VHbbEvent::MuonInfo> muons;
43     std::vector<VHbbEvent::ElectronInfo> electrons;
44     std::vector<VHbbEvent::TauInfo> taus;
45     std::vector<VHbbEvent::METInfo> mets;
46    
47     };
48    
49     class HiggsCandidate {
50     public:
51 tboccali 1.4 TLorentzVector p4;
52 tboccali 1.1 std::vector<VHbbEvent::SimpleJet> jets;
53     float deltaTheta;
54 tboccali 1.2 std::vector <float> helicities;
55 tboccali 1.3 public:
56 tboccali 1.1 VHbbEvent::SimpleJet& firstJet(){return jets[0];}
57     VHbbEvent::SimpleJet& secondJet(){return jets[1];}
58     };
59    
60    
61     void setCandidateType (CandidateType c){candidateType = c;}
62 arizzi 1.8
63    
64     double deltaPhi() const {
65     return V.p4.DeltaPhi(H.p4);
66     }
67    
68     double Mt() const {
69     return V.Mt(candidateType);
70     }
71 tboccali 1.1
72 arizzi 1.8 int additionalLeptons() const {
73     int expectedLeptons = 0;
74     if( candidateType == Wmun || candidateType == Wen) expectedLeptons =1;
75     if( candidateType == Zmumu || candidateType == Zee) expectedLeptons =2;
76    
77     return ( V.muons.size() + V.electrons.size() - expectedLeptons);
78    
79     }
80    
81 tboccali 1.1 public:
82 tboccali 1.4 TLorentzVector p4(){return V.p4+H.p4;}
83 tboccali 1.1 CandidateType candidateType;
84     HiggsCandidate H;
85     VectorCandidate V;
86     std::vector<VHbbEvent::SimpleJet> additionalJets;
87     };
88    
89    
90     #endif