ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/interface/VHbbNameSpace.h
(Generate patch)

Comparing UserCode/VHbb/interface/VHbbNameSpace.h (file contents):
Revision 1.3 by bortigno, Thu Jan 10 14:21:00 2013 UTC vs.
Revision 1.5 by nmohr, Thu Jan 17 16:32:37 2013 UTC

# Line 38 | Line 38 | namespace VHbb {
38      TVector3 n1(H1);
39      TVector3 n2(H2);
40      
41 <    float det= n1.Px() * n2.Py() - n2.Px() * n1.Py();
41 >    double det= n1.Px() * n2.Py() - n2.Px() * n1.Py();
42      
43      H1.SetMag( (  - n2.Py() * V.Px() + n2.Px() * V.Py() )  / (sin(n1.Theta()) *det ) );
44      H2.SetMag( ( + n1.Py() * V.Px() - n1.Px() * V.Py() )  / (sin(n2.Theta())  *det ) );
45      
46 <    float mass=TMath::Sqrt( TMath::Power( (H1.Mag()+H2.Mag()),2 ) - TMath::Power(( ( H1+H2 ).Mag()),2) );
46 >    double mass=TMath::Sqrt( TMath::Power( (H1.Mag()+H2.Mag()),2 ) - TMath::Power(( ( H1+H2 ).Mag()),2) );
47      
48      return mass;
49      
# Line 71 | Line 71 | namespace VHbb {
71  
72  
73    }
74 +  
75 +  double ANGLELZ(double pt, double eta, double phi, double mass, double pt2, double eta2, double phi2, double mass2){
76 +  TLorentzVector m1, m2, msum;
77 +  m1.SetPtEtaPhiM(pt, eta, phi, mass);
78 +  m2.SetPtEtaPhiM(pt2, eta2, phi2, mass2);
79 +  msum = m1 + m2;
80 +
81 +  TVector3 bZ =  msum.BoostVector();
82 +
83 +  m1.Boost(-bZ);  
84 +  m2.Boost(-bZ);  
85 +
86 +  TVector3 b1;
87 +
88 +
89 +  if((int) (pt) % 2 == 0)
90 +    b1 =  m1.BoostVector();
91 +  else
92 +    b1 =  m2.BoostVector();
93  
94 + double cosTheta = b1.Dot(msum.BoostVector()) / (b1.Mag()*msum.BoostVector().Mag());
95 + return(cosTheta);
96 +  }
97 +
98 +
99 +   double ANGLEHB(double pt, double eta, double phi, double e, double pt2, double eta2, double phi2, double e2){
100 + TLorentzVector m1, m2, msum;
101 + m1.SetPtEtaPhiE(pt, eta, phi, e);
102 + m2.SetPtEtaPhiE(pt2, eta2, phi2, e2);
103 + msum = m1 + m2;
104 +
105 + TVector3 bZ =  msum.BoostVector();
106 +
107 + m1.Boost(-bZ);
108 + m2.Boost(-bZ);  
109 +
110 + TVector3 b1;
111 +
112 +  if((int) (pt) % 2 == 0)
113 +    b1 =  m1.BoostVector();
114 +  else
115 +    b1 =  m2.BoostVector();
116 +
117 + double cosTheta = b1.Dot(msum.BoostVector()) / (b1.Mag()*msum.BoostVector().Mag());
118 + return(cosTheta);
119 +   }
120 +
121 +   double metCorSysShift(double met, double metphi, int Nvtx, int EVENT_run)
122 + {
123 +    double metx = met * cos(metphi);
124 +    double mety = met * sin(metphi);
125 +    double px = 0.0, py = 0.0;
126 +    if (EVENT_run!=1) {
127 +        //pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_data
128 +        px = +1.68804e-01 + 3.37139e-01*Nvtx;
129 +        py = -1.72555e-01 - 1.79594e-01*Nvtx;
130 +    } else {
131 +        //pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_mc
132 +        px = +2.22335e-02 - 6.59183e-02*Nvtx;
133 +        py = +1.52720e-01 - 1.28052e-01*Nvtx;
134 +    }
135 +    metx -= px;
136 +    mety -= py;
137 +    return std::sqrt(metx*metx + mety*mety);
138 + }
139 +
140 +    double metphiCorSysShift(double met, double metphi, int Nvtx, int EVENT_run)
141 + {
142 +    double metx = met * cos(metphi);
143 +    double mety = met * sin(metphi);
144 +    double px = 0.0, py = 0.0;
145 +    if (EVENT_run!=1) {
146 +
147 +        //pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_data
148 +        px = +1.68804e-01 + 3.37139e-01*Nvtx;
149 +        py = -1.72555e-01 - 1.79594e-01*Nvtx;
150 +    } else {
151 +        //pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_mc
152 +        px = +2.22335e-02 - 6.59183e-02*Nvtx;
153 +        py = +1.52720e-01 - 1.28052e-01*Nvtx;
154 +    }
155 +    metx -= px;
156 +    mety -= py;
157 +    if (metx == 0.0 && mety == 0.0)
158 +        return 0.0;
159 +
160 +    double phi1 = std::atan2(mety,metx);
161 +    double phi2 = std::atan2(mety,metx)-2.0*M_PI;
162 +    if (std::abs(phi1-metphi) < std::abs(phi2-metphi)+0.5*M_PI)
163 +        return phi1;
164 +    else
165 +        return phi2;
166 + }
167 +
168 + double resolutionBias(double eta)
169 + {
170 + // return 0;//Nominal!
171 + if(eta< 1.1) return 0.05;
172 + if(eta< 2.5) return 0.10;
173 + if(eta< 5) return 0.30;
174 + return 0;
175 + }
176 +
177 + double evalJERBias( double ptreco, double ptgen, double eta1){
178 +  double eta = fabs(eta1);
179 +  double cor =1;  
180 +  if ((fabs(ptreco - ptgen)/ ptreco)<0.5) { //Limit the effect to the core
181 +     cor = (ptreco +resolutionBias(eta) *(ptreco-ptgen))/ptreco;  
182 +  }
183 +  return ptreco*cor;
184 + }
185 +
186 + double evalEt( double pt, double eta, double phi, double e){
187 +  TLorentzVector j;
188 +  j.SetPtEtaPhiE(pt,eta,phi, e );
189 +  return j.Et();
190 +
191 + }
192 +
193 + double evalMt( double pt, double eta, double phi, double e){
194 +  TLorentzVector j;
195 +  j.SetPtEtaPhiE(pt,eta,phi, e );
196 +  return j.Mt();
197 +
198 + }
199  
200   }
201  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines