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.1 by bortigno, Fri Dec 14 15:59:45 2012 UTC vs.
Revision 1.3 by bortigno, Thu Jan 10 14:21:00 2013 UTC

# Line 1 | Line 1
1 <
1 > #include "TLorentzVector.h"
2 > #include "TVector3.h"
3   #include "TMath.h"
4  
5   namespace VHbb {
# Line 15 | Line 16 | namespace VHbb {
16      {
17        double deta = eta1 - eta2;
18        double dphi = deltaPhi(phi1, phi2);
19 <      return std::sqrt(deta*deta + dphi*dphi);
19 >      return TMath::Sqrt(deta*deta + dphi*dphi);
20      }
21 +
22 +
23 +  double Hmass( double V_eta,double V_phi,double V_pt,
24 +                double hJet1_eta,double hJet1_phi,double hJet1_pt,
25 +                double hJet2_eta,double hJet2_phi,double hJet2_pt ){
26 +    
27 +    TVector3 V(1,1,1);
28 +    V.SetPtEtaPhi(V_pt,V_eta,V_phi);
29 +    
30 +    TVector3 H1(1,1,1);
31 +    H1.SetPtEtaPhi(hJet1_pt,hJet1_eta,hJet1_phi);
32 +    H1.SetMag(1/sin(H1.Theta()));
33 +    
34 +    TVector3 H2(1,1,1);
35 +    H2.SetPtEtaPhi(hJet2_pt,hJet2_eta,hJet2_phi);
36 +    H2.SetMag(1/sin(H2.Theta()));
37 +    
38 +    TVector3 n1(H1);
39 +    TVector3 n2(H2);
40 +    
41 +    float 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) );
47 +    
48 +    return mass;
49 +    
50 +  }
51 +  
52 +  double Hmass_comb(double hJet1_eta,double hJet1_phi,double hJet1_pt, double hJet1_mass,
53 +                    double hJet2_eta,double hJet2_phi,double hJet2_pt, double hJet2_mass){
54 +
55 +    TLorentzVector H1, H2;
56 +    H1.SetPtEtaPhiM(hJet1_pt,hJet1_eta,hJet1_phi, hJet1_mass);;
57 +    H2.SetPtEtaPhiM(hJet2_pt,hJet2_eta,hJet2_phi, hJet2_mass);
58 +
59 +    return (H1 + H2).M();
60 +
61 +  }
62 +
63 +  double Hmass_3j(double h_eta,double h_phi,double h_pt, double h_mass,
64 +                  double aJet_eta,double aJet_phi,double aJet_pt, double aJet_mass){
65 +
66 +    TLorentzVector H, H3;
67 +    H.SetPtEtaPhiM( h_pt,h_eta,h_phi, h_mass);;
68 +    H3.SetPtEtaPhiM(aJet_pt,aJet_eta,aJet_phi, aJet_mass);
69 +
70 +    return (H + H3).M();
71 +
72 +
73 +  }
74 +
75 +
76   }
77  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines