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

SortAttribute::DeltaR Class Reference

STL generic algorithm function object. More...

#include <FunctionObjects.h>

List of all members.


Public Methods

 DeltaR (Atlfast::IKinematic *reference)
 Constructor which accepts the reference.

 DeltaR (Atlfast::IKinematic &reference)
 Constructor which accepts the reference.

bool operator() (const Atlfast::IKinematic *a, const Atlfast::IKinematic *b) const
 function operator for comparing two objects

bool operator() (const Atlfast::IKinematic &a, const Atlfast::IKinematic &b) const
 forwarded function operator for comparing two objects


Private Attributes

Atlfast::IKinematic * ref

Detailed Description

STL generic algorithm function object.

Used to sort a container of IKinematic objects or pointers in delta R from a reference IKinematic.

Definition at line 311 of file FunctionObjects.h.


Constructor & Destructor Documentation

SortAttribute::DeltaR::DeltaR Atlfast::IKinematic *    reference [inline]
 

Constructor which accepts the reference.

Definition at line 319 of file FunctionObjects.h.

References ref.

00319 : ref(reference) {}

SortAttribute::DeltaR::DeltaR Atlfast::IKinematic &    reference [inline]
 

Constructor which accepts the reference.

Definition at line 321 of file FunctionObjects.h.

References ref.

00321 : ref(&reference) {} 

Member Function Documentation

bool SortAttribute::DeltaR::operator() const Atlfast::IKinematic *    a,
const Atlfast::IKinematic *    b
const [inline]
 

function operator for comparing two objects

Definition at line 325 of file FunctionObjects.h.

References ref.

Referenced by operator()().

00325                                                                         { 
00326       
00327       Phi a_dPhi( a->phi() - ref->phi() ) ;
00328       Phi b_dPhi( b->phi() - ref->phi() ) ;
00329       
00330       double dista = 
00331         sqrt(
00332              (a_dPhi*a_dPhi) +
00333              (a->eta() - ref->eta())*(a->eta() - ref->eta()) 
00334              );
00335       
00336       double distb = 
00337         sqrt(
00338              (b_dPhi*b_dPhi) +
00339              (b->eta() - ref->eta())*(b->eta() - ref->eta()) 
00340              );
00341       
00342       return ( dista < distb ) ;
00343     }

bool SortAttribute::DeltaR::operator() const Atlfast::IKinematic &    a,
const Atlfast::IKinematic &    b
const [inline]
 

forwarded function operator for comparing two objects

Definition at line 348 of file FunctionObjects.h.

References operator()().

00349       { return this->operator() ( &a, &b ) ; }

Member Data Documentation

Atlfast::IKinematic* SortAttribute::DeltaR::ref [private]
 

Definition at line 314 of file FunctionObjects.h.

Referenced by DeltaR(), and operator()().


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