CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
fireworks::StateOrdering Class Reference

#include <TrackUtils.h>

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.

51  {
52  m_direction = momentum;
53  m_direction.Normalize();
54  }

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.

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

Member Data Documentation

TEveVector fireworks::StateOrdering::m_direction
private

Definition at line 49 of file TrackUtils.h.

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