PtInConeEstimator Class Template Reference

#include <IsolationEstimators.hh>

Inheritance diagram for PtInConeEstimator:

Inheritance graph
[legend]

Collaboration diagram for PtInConeEstimator:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class T, class C>
class Rivet::PtInConeEstimator< T, C >

Definition at line 45 of file IsolationEstimators.hh.


Public Member Functions

 PtInConeEstimator (double radius, double ptmin=0.0)
virtual double estimate (const T &t, const C &c) const
virtual int compare (const IsolationEstimator< T, C > *other) const
double radius () const
double ptMin () const
virtual bool before (const IsolationEstimator *other) const
bool operator< (const IsolationEstimator &other) const

Private Attributes

double _radius
double _ptmin

Constructor & Destructor Documentation

PtInConeEstimator ( double  radius,
double  ptmin = 0.0 
) [inline]

Definition at line 47 of file IsolationEstimators.hh.

00048       : _radius(radius), _ptmin(ptmin) { }


Member Function Documentation

virtual double estimate ( const T &  t,
const C &  c 
) const [inline, virtual]

Implements IsolationEstimator.

Definition at line 50 of file IsolationEstimators.hh.

References PtInConeEstimator::_ptmin, PtInConeEstimator::_radius, and Rivet::deltaR().

00050                                                             {
00051       double ptsum = 0;
00052       for (typename C::const_iterator ic = c.begin(); ic != c.end(); ++ic) {
00053         if (ic->momentum().pT() < _ptmin)
00054           continue;
00055         if (deltaR(t.momentum(), ic->momentum()) < _radius) {
00056           ptsum += ic->momentum().pT();
00057         }
00058       }
00059       return ptsum / t.momentum().pT();
00060     }

virtual int compare ( const IsolationEstimator< T, C > *  other  )  const [inline, virtual]

Implements IsolationEstimator.

Definition at line 62 of file IsolationEstimators.hh.

References PtInConeEstimator::_ptmin, PtInConeEstimator::_radius, and Rivet::cmp().

00062                                                                         {
00063       const PtInConeEstimator *concreteother = dynamic_cast<const PtInConeEstimator*>(other);
00064       int ptmincmp = cmp(_ptmin, concreteother->getPtMin());
00065       if (ptmincmp != 0)
00066          return ptmincmp;
00067       int radcmp = cmp(_radius, concreteother->getRadius());
00068       if (radcmp != 0)
00069          return radcmp;
00070        return 0;
00071     }

double radius (  )  const [inline]

Definition at line 73 of file IsolationEstimators.hh.

References PtInConeEstimator::_radius.

00073                           {
00074       return _radius;
00075     }

double ptMin (  )  const [inline]

Definition at line 77 of file IsolationEstimators.hh.

References PtInConeEstimator::_ptmin.

00077                          {
00078       return _ptmin;
00079     }

virtual bool before ( const IsolationEstimator< T, C > *  other  )  const [inline, virtual, inherited]

Definition at line 26 of file IsolationEstimators.hh.

References IsolationEstimator::compare().

Referenced by IsolationEstimator::operator<().

00026                                                                   {
00027         const std::type_info & thisid = typeid(*this);
00028         const std::type_info & otherid = typeid(*other);
00029         if (thisid == otherid) {
00030           return compare(other) < 0;
00031         } else {
00032           return thisid.before(otherid);
00033         }
00034       }

bool operator< ( const IsolationEstimator< T, C > &  other  )  const [inline, inherited]

Definition at line 36 of file IsolationEstimators.hh.

References IsolationEstimator::before().

00036                                                              {
00037         return this->before(&other);
00038       }


Member Data Documentation

double _radius [private]

double _ptmin [private]


The documentation for this class was generated from the following file: