CMS 3D CMS Logo

Public Member Functions | Private Attributes

fireworks::StateOrdering Class Reference

#include <TrackUtils.h>

List of all members.

Public Member Functions

bool operator() (const State &state1, const State &state2) const
 StateOrdering (const TEveVector &momentum)

Private Attributes

TEveVector m_direction

Detailed Description

Definition at line 48 of file TrackUtils.h.


Constructor & Destructor Documentation

fireworks::StateOrdering::StateOrdering ( const TEveVector &  momentum) [inline]

Definition at line 51 of file TrackUtils.h.

References m_direction.

                                               {
      m_direction = momentum;
      m_direction.Normalize();
   }

Member Function Documentation

bool fireworks::StateOrdering::operator() ( const State state1,
const State state2 
) const [inline]

Definition at line 55 of file TrackUtils.h.

References m_direction, and fireworks::State::position.

                                                 {
      double product1 = state1.position.Perp()*(state1.position.fX*m_direction.fX + state1.position.fY*m_direction.fY>0 ? 1 : -1);
      double product2 = state2.position.Perp()*(state2.position.fX*m_direction.fX + state2.position.fY*m_direction.fY>0 ? 1 : -1);
      return product1 < product2;
   }

Member Data Documentation

Definition at line 49 of file TrackUtils.h.

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