00001
00002
00003
00004
00005
00006
00007 #include "AtlfastUtils/KinematicHelper.h"
00008
00009 #include "AtlfastEvent/IKinematic.h"
00010 #include "AtlfastEvent/Phi.h"
00011
00012 namespace Atlfast {
00013
00014
00015
00016
00017
00018 double KinematicHelper::deltaR( IKinematic* a , IKinematic* b )
00019 {
00020
00021
00022
00023
00024 Phi aphi(a->phi()) ;
00025 Phi bphi(b->phi()) ;
00026
00027 double dist =
00028 sqrt(
00029 (aphi - bphi)*(aphi - bphi) +
00030 (a->eta() - b->eta())*(a->eta() - b->eta())
00031 );
00032 return dist ;
00033 }
00034
00035 double KinematicHelper::deltaR( IKinematic& a , IKinematic& b )
00036 {
00037 return this->deltaR( &a, &b ) ;
00038 }
00039
00040
00041
00042 double KinematicHelper::deltaPhi( IKinematic* a , IKinematic* b )
00043 {
00044 return std::abs( Phi( a->phi() - b->phi() ) ) ;
00045 }
00046
00047 double KinematicHelper::deltaPhi( IKinematic& a , IKinematic& b )
00048 {
00049 return this->deltaPhi( &a, &b ) ;
00050 }
00051
00052
00053
00054 double KinematicHelper::mass( IKinematic* a , IKinematic* b )
00055 {
00056 return ( a->momentum() + b->momentum() ).m() ;
00057 }
00058
00059 double KinematicHelper::mass( IKinematic& a , IKinematic& b )
00060 {
00061 return this->mass( &a, &b ) ;
00062 }
00063
00064
00065 }
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075