ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitCommon/MathTools/interface/MathUtils.h
Revision: 1.6
Committed: Tue Mar 3 18:12:25 2009 UTC (16 years, 2 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2, Mit_008pre1
Changes since 1.5: +12 -1 lines
Log Message:
Add catch-all templated DeltaR function

File Contents

# User Rev Content
1 sixie 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.6 // $Id: MathUtils.h,v 1.5 2009/02/18 15:38:26 loizides Exp $
3 sixie 1.1 //
4     // MathUtils
5     //
6 loizides 1.2 // Math utility functions.
7 sixie 1.1 //
8 loizides 1.2 // Authors: S.Xie, C.Loizides
9 sixie 1.1 //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.2 #ifndef MITCOMMON_MATHTOOLS_MATHUTILS_H
12     #define MITCOMMON_MATHTOOLS_MATHUTILS_H
13 sixie 1.1
14 loizides 1.2 #include "MitCommon/DataFormats/interface/Types.h"
15 sixie 1.1 #include <TMath.h>
16    
17 loizides 1.3 namespace mithep
18 sixie 1.1 {
19 loizides 1.2 class MathUtils {
20     public:
21 loizides 1.4 static Double_t AddInQuadrature(Double_t a, Double_t b);
22     static Double_t DeltaPhi(Double_t phi1, Double_t phi2);
23     static Double_t DeltaPhi(const FourVector &v1, const FourVector &v2);
24 loizides 1.5 static Double_t DeltaPhi(const FourVectorM &v1, const FourVectorM &v2);
25 loizides 1.4 static Double_t DeltaR(Double_t phi1, Double_t eta1, Double_t phi2, Double_t eta2);
26     static Double_t DeltaR(const FourVector &v1, const FourVector &v2);
27 loizides 1.5 static Double_t DeltaR(const FourVectorM &v1, const FourVectorM &v2);
28 bendavid 1.6 template<class V1, class V2> static Double_t DeltaR(const V1 &v1, const V2 &v2);
29 loizides 1.4 static Double_t Eta2Theta(Double_t eta);
30     static Double_t Theta2Eta(Double_t theta);
31 loizides 1.2 };
32 sixie 1.1 }
33 bendavid 1.6
34     //--------------------------------------------------------------------------------------------------
35     template<class V1, class V2>
36     Double_t mithep::MathUtils::DeltaR(const V1 &v1, const V2 &v2)
37     {
38    
39     return mithep::MathUtils::DeltaR(v1.Phi(),v1.Eta(),v2.Phi(),v2.Eta());
40    
41     }
42    
43 sixie 1.1 #endif