Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

Atlfast::KinematicHelper Class Reference

Provides implementation of useful manipulations of entities honouring the IKinematic interface. More...

#include <KinematicHelper.h>

List of all members.


Public Methods

double deltaR (IKinematic &a, IKinematic &b)
 Return the distance in eta-phi space between two items.

double deltaR (IKinematic *a, IKinematic *b)
 Return the distance in eta-phi space between two items.

double deltaPhi (IKinematic &a, IKinematic &b)
 Return the distance in phi space between two items.

double deltaPhi (IKinematic *a, IKinematic *b)
 Return the distance in phi space between two items.

double mass (IKinematic &a, IKinematic &b)
 Return the invariant mass of two items,.

double mass (IKinematic *a, IKinematic *b)
 Return the invariant mass of two items,.

template<class Iter> double mass (Iter begin, Iter end)
 Return the invariant mass of a collection of IKinematic* (not IKinematic& at present).

template<class Iter> double sumETInCone (Iter begin, Iter end, IKinematic *reference, double rCone)
 Sum quantities in a given R-cone from a reference.


Detailed Description

Provides implementation of useful manipulations of entities honouring the IKinematic interface.

Definition at line 32 of file KinematicHelper.h.


Member Function Documentation

double Atlfast::KinematicHelper::deltaR IKinematic &    a,
IKinematic &    b
 

Return the distance in eta-phi space between two items.

Definition at line 35 of file KinematicHelper.cxx.

Referenced by sumETInCone().

00036 { 
00037   return this->deltaR( &a, &b ) ;
00038 }

double Atlfast::KinematicHelper::deltaR IKinematic *    a,
IKinematic *    b
 

Return the distance in eta-phi space between two items.

Definition at line 18 of file KinematicHelper.cxx.

00019 { 
00020   //IKinematic* a = this->regulateType( aa ) ;
00021   //IKinematic* b = this->regulateType( bb ) ;
00022 
00023   // Doing this takes care of cyclic algebra
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 }

double Atlfast::KinematicHelper::deltaPhi IKinematic &    a,
IKinematic &    b
 

Return the distance in phi space between two items.

Definition at line 47 of file KinematicHelper.cxx.

00048 { 
00049   return this->deltaPhi( &a, &b ) ;
00050 }

double Atlfast::KinematicHelper::deltaPhi IKinematic *    a,
IKinematic *    b
 

Return the distance in phi space between two items.

Definition at line 42 of file KinematicHelper.cxx.

00043 { 
00044   return std::abs( Phi( a->phi() - b->phi() ) ) ;
00045 }

double Atlfast::KinematicHelper::mass IKinematic &    a,
IKinematic &    b
 

Return the invariant mass of two items,.

Definition at line 59 of file KinematicHelper.cxx.

00060 { 
00061   return this->mass( &a, &b ) ;
00062 }

double Atlfast::KinematicHelper::mass IKinematic *    a,
IKinematic *    b
 

Return the invariant mass of two items,.

Definition at line 54 of file KinematicHelper.cxx.

00055 { 
00056   return ( a->momentum() + b->momentum() ).m() ;
00057 }

template<class Iter>
double Atlfast::KinematicHelper::mass Iter    begin,
Iter    end
[inline]
 

Return the invariant mass of a collection of IKinematic* (not IKinematic& at present).

Definition at line 76 of file KinematicHelper.h.

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     }

template<class Iter>
double Atlfast::KinematicHelper::sumETInCone Iter    begin,
Iter    end,
IKinematic *    reference,
double    rCone
[inline]
 

Sum quantities in a given R-cone from a reference.

Definition at line 92 of file KinematicHelper.h.

References deltaR().

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 }

The documentation for this class was generated from the following files:
Generated on Wed Jan 15 11:00:34 2003 for AtlfastUtils by doxygen1.3-rc1