ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/Objects.hh
(Generate patch)

Comparing UserCode/HbbAnalysis/interface/Objects.hh (file contents):
Revision 1.24 by amagnan, Fri Jun 24 14:49:11 2011 UTC vs.
Revision 1.26 by agilbert, Sun Aug 7 09:51:36 2011 UTC

# Line 6 | Line 6
6   #include <iostream>
7  
8   #include "TLorentzVector.h"
9 + #include "TMath.h"
10  
11   namespace HbbAnalysis {
12  
# Line 708 | Line 709 | namespace HbbAnalysis {
709  
710    };
711  
711
712
713
712    double DeltaPhi(const double phi1, const double phi2);
713  
714    template <class T1, class T2>
715    double DeltaR(const T1 & v1, const T2 & v2){
716      double dEta = v1.eta - v2.eta;
717 <    double dPhi = v1.phi - v2.phi;
717 >    double dPhi = fabs(v1.phi - v2.phi);
718 >    if (dPhi > TMath::Pi()) dPhi = (2.0*TMath::Pi() - dPhi);
719      return sqrt(dEta*dEta+dPhi*dPhi);
720    }
721  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines