00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef ATLFAST_KINEMATICHELPER_H
00019 #define ATLFAST_KINEMATICHELPER_H
00020
00021 #ifndef CLHEP_LORENTZVECTOR_H
00022 #define CLHEP_LORENTZVECTOR_H
00023 #include "CLHEP/Vector/LorentzVector.h"
00024 #endif
00025
00026 namespace Atlfast {
00027 class IKinematic;
00032 class KinematicHelper {
00033
00034 public:
00035
00036
00037
00038
00039
00043 double deltaR( IKinematic& a, IKinematic& b ) ;
00047 double deltaR( IKinematic* a, IKinematic* b ) ;
00048
00049
00050
00054 double deltaPhi( IKinematic& a, IKinematic& b ) ;
00058 double deltaPhi( IKinematic* a, IKinematic* b ) ;
00059
00060
00061
00065 double mass( IKinematic& a, IKinematic& b ) ;
00069 double mass( IKinematic* a, IKinematic* b ) ;
00070
00075 template< class Iter >
00076 double mass( Iter begin, Iter end )
00077 {
00078 HepLorentzVector temp(0.,0.,0.,0.) ;
00079 for( Iter i = begin; i < end; ++i )
00080 {
00081 temp += (*i)->momentum() ;
00082 }
00083 return temp.m() ;
00084 }
00085
00086
00087
00091 template< class Iter>
00092 double sumETInCone( Iter begin,
00093 Iter end,
00094 IKinematic* reference,
00095 double rCone
00096 )
00097 {
00098 double result = 0.0;
00099 for( Iter itr = begin; itr < end; ++itr )
00100 {
00101 if( this->deltaR( reference, *itr ) < rCone )
00102 {
00103 result += (*itr)->eT() ;
00104 }
00105 }
00106 return result ;
00107 }
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 private:
00121
00122
00123
00124
00125
00126
00127 };
00128
00129 }
00130
00131 #endif
00132
00133
00134
00135