ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbbAnalysis/HbbAnalyzer/interface/VHbbCandidateTools.h
Revision: 1.4
Committed: Thu Jun 30 08:56:27 2011 UTC (13 years, 10 months ago) by tboccali
Content type: text/plain
Branch: MAIN
CVS Tags: Jun30th2011
Changes since 1.3: +23 -2 lines
Log Message:
fix met

File Contents

# User Rev Content
1 tboccali 1.1 #ifndef VHBBCANDIDATETOOLS_H
2     #define VHBBCANDIDATETOOLS_H
3    
4     #include "VHbbAnalysis/HbbAnalyzer/interface/VHbbCandidate.h"
5    
6 tboccali 1.4 #include <iostream>
7    
8 tboccali 1.3 class VHbbCandidateTools {
9 tboccali 1.1 public:
10 tboccali 1.4
11     VHbbCandidateTools(bool verbose = false): verbose_(verbose){}
12    
13 tboccali 1.1 float deltaPhi(float in2, float in1){
14 tboccali 1.3 float dphi = in2-in1;
15 tboccali 1.1 if ( dphi > M_PI ) {
16     dphi -= 2.0*M_PI;
17     } else if ( dphi <= -M_PI ) {
18     dphi += 2.0*M_PI;
19     }
20     return dphi;
21     }
22    
23     VHbbCandidate getHZmumuCandidate(const VHbbCandidate & in, bool & ok){
24 tboccali 1.4 if (verbose_){
25     std::cout <<" getHZmumuCandidate input mu "<<in.V.muons.size()<<" e "<<in.V.electrons.size()<<std::endl;
26     }
27 tboccali 1.1 ok = false;
28     VHbbCandidate temp=in;
29     if (temp.V.muons.size()!=2) return in ;
30 tboccali 1.3 if (temp.V.electrons.size()!=0) return in ;
31     temp.V.fourMomentum = temp.V.muons[0].fourMomentum+temp.V.muons[1].fourMomentum;
32    
33     if (temp.V.muons[0].fourMomentum.Pt()<20 || temp.V.muons[1].fourMomentum.Pt()<20 ) return in;
34 tboccali 1.1
35 tboccali 1.3 // if (temp.V.Pt()<150 ) return in;
36     // if (temp.H.Pt()<150) return in;
37     // if (temp.H.firstJet().csv< 0.9) return in;
38     // if (temp.H.secondJet().csv<0.5) return in;
39     // if (deltaPhi(temp.V.Phi(),temp.H.Phi())<2.7) return in;
40     // if (temp.V.FourMomentum.Mass()<75 || temp.V.FourMomentum.Mass()>105) return in;
41     // if (temp.additionalJets.size()>0) return in;
42 tboccali 1.1 // if (std::Abs(deltaTheta) ????
43     ok = true;
44     return temp;
45     }
46     VHbbCandidate getHZeeCandidate(const VHbbCandidate & in, bool & ok){
47 tboccali 1.4 if (verbose_){
48     std::cout <<" getHZeeCandidate input mu "<<in.V.muons.size()<<" e "<<in.V.electrons.size()<<std::endl;
49     }
50    
51 tboccali 1.1 ok = false;
52     VHbbCandidate temp=in;
53     if (temp.V.electrons.size()!=2) return in ;
54 tboccali 1.3 if (temp.V.muons.size()!=0) return in ;
55    
56 tboccali 1.1 temp.V.fourMomentum = temp.V.electrons[0].fourMomentum+temp.V.electrons[1].fourMomentum;
57 tboccali 1.3
58 tboccali 1.1 //
59     // i need to ask VBTF and pt NEEDS ADJUSTING!!!!!
60     //
61     if (temp.V.electrons[0].fourMomentum.Pt()<20 ||temp.V.electrons[1].fourMomentum.Pt()<20 ) return in;
62     if (temp.V.electrons[0].id95r < -100000 ||temp.V.electrons[1].id95r < -100000) return in;
63    
64 tboccali 1.3 // if (temp.V.fourMomentum.Pt()<150 ) return in;
65     // if (temp.H.fourMomentum.Pt()<150) return in;
66     // if (temp.H.firstJet().csv< 0.9) return in;
67     // if (temp.H.secondJet().csv<0.5) return in;
68     // if (deltaPhi(temp.V.fourMomentum.Phi(),temp.H.fourMomentum.Phi())<2.7) return in;
69     // if (temp.V.fourMomentum.M()<75 || temp.V.fourMomentum.M()>105) return in;
70     // if (temp.additionalJets.size()>0) return in;
71 tboccali 1.1 // if (std::Abs(deltaTheta) ????
72     ok = true;
73     return temp;
74     }
75     VHbbCandidate getHZnnCandidate(const VHbbCandidate & in, bool & ok){
76 tboccali 1.4 if (verbose_){
77     std::cout <<" getHZnnCandidate input mu "<<in.V.muons.size()<<" e "<<in.V.electrons.size()<<" met "<<in.V.mets.size()<<std::endl;
78     }
79    
80 tboccali 1.1 ok = false;
81     VHbbCandidate temp=in;
82     if (temp.V.mets.size()!=1) return in;
83 tboccali 1.3 if (temp.V.muons.size()!=0) return in ;
84     if (temp.V.electrons.size()!=0) return in ;
85    
86 tboccali 1.1 temp.V.fourMomentum = temp.V.mets[0].fourMomentum;
87 tboccali 1.4 if (verbose_) {
88     std::cout <<" debug met "<< temp.V.mets[0].metSig << " " << temp.V.mets[0].sumEt<< std::endl;
89     }
90 tboccali 1.1 if (temp.V.mets[0].metSig<5) return in;
91 tboccali 1.4 if (temp.V.mets[0].sumEt<50) return in;
92 tboccali 1.3 // if (temp.H.fourMomentum.Pt()<150)return in;
93     // if (temp.H.firstJet().csv< 0.9) return in;
94     // if (temp.H.secondJet().csv<0.5) return in;
95     // if (deltaPhi(temp.V.fourMomentum.Phi(),temp.H.fourMomentum.Phi())<2.95) return in;
96     // if (temp.V.electrons.size()>0 || temp.V.muons.size()>0 ) return in;
97     // if (temp.additionalJets.size()>0) return in;
98 tboccali 1.1 // if (std::Abs(deltaTheta) ????
99    
100     ok = true;
101     return temp;
102     }
103    
104     VHbbCandidate getHWmunCandidate(const VHbbCandidate & in, bool & ok){
105     ok = false;
106     VHbbCandidate temp=in;
107     if (temp.V.muons.size()!=1) return in ;
108 tboccali 1.3 if (temp.V.electrons.size()!=0) return in ;
109 tboccali 1.1 //
110     // not clear to me, where is MET? it is not used????
111     //
112     return in;
113     }
114    
115     VHbbCandidate getHWenCandidate(const VHbbCandidate & in, bool & ok){
116     ok = false;
117     VHbbCandidate temp=in;
118     if (temp.V.electrons.size()!=1) return in ;
119 tboccali 1.3 if (temp.V.muons.size()!=0) return in ;
120 tboccali 1.1 //
121     // not clear to me, where is MET? it is not used????
122     //
123     return in;
124     }
125    
126 tboccali 1.4 public:
127     bool verbose_;
128    
129 tboccali 1.1 };
130    
131    
132    
133     #endif
134    
135    
136 tboccali 1.3
137    
138    
139