CMS 3D CMS Logo

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 42 of file TrackUtils.h.

Constructor & Destructor Documentation

◆ StateOrdering()

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

Definition at line 46 of file TrackUtils.h.

References m_direction.

46  {
47  m_direction = momentum;
48  m_direction.Normalize();
49  }

Member Function Documentation

◆ operator()()

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

Definition at line 50 of file TrackUtils.h.

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

50  {
51  double product1 = state1.position.Perp() *
52  (state1.position.fX * m_direction.fX + state1.position.fY * m_direction.fY > 0 ? 1 : -1);
53  double product2 = state2.position.Perp() *
54  (state2.position.fX * m_direction.fX + state2.position.fY * m_direction.fY > 0 ? 1 : -1);
55  return product1 < product2;
56  }

Member Data Documentation

◆ m_direction

TEveVector fireworks::StateOrdering::m_direction
private

Definition at line 43 of file TrackUtils.h.

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