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
00113 template< class Iter>
00114 double sumETInHalo( Iter begin,
00115 Iter end,
00116 IKinematic* reference,
00117 double rLower,
00118 double rHigher
00119 )
00120 {
00121 double result = 0.0;
00122 for( Iter itr = begin; itr < end; ++itr )
00123 {
00124 if( this->deltaR( reference, *itr ) > rLower
00125 && this->deltaR( reference, *itr ) < rHigher
00126 )
00127 {
00128 result += (*itr)->eT() ;
00129 }
00130 }
00131 return result ;
00132 }
00133
00134
00138 template< class Iter>
00139 HepLorentzVector sumMomentumInHalo( Iter begin,
00140 Iter end,
00141 IKinematic* reference,
00142 double rLower,
00143 double rHigher
00144 )
00145 {
00146 HepLorentzVector result(0.,0.,0.,0.);
00147 for( Iter itr = begin; itr < end; ++itr )
00148 {
00149 if( this->deltaR( reference, *itr ) > rLower
00150 && this->deltaR( reference, *itr ) < rHigher
00151 )
00152 {
00153 result += (*itr)->momentum() ;
00154 }
00155 }
00156 return result ;
00157 }
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 private:
00169
00170
00171
00172
00173
00174
00175 };
00176
00177 }
00178
00179 #endif
00180
00181
00182
00183