Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JFIT::JPointing Class Reference

Auxiliary class to compare fit results with respect to a reference direction (e.g. More...

#include <JEvtToolkit.hh>

Public Member Functions

 JPointing (const JVersor3D &dir)
 Constructor. More...
 
JVersor3D getDirection () const
 Get direction. More...
 
double getDot (const JFit &fit) const
 Get dot product between reference direction and fit result. More...
 
double getAngle (const JFit &fit) const
 Get angle between reference direction and fit result. More...
 
bool operator() (const JFit &first, const JFit &second) const
 Comparison of fit results. More...
 
template<class T >
operator() (T __begin, T __end) const
 Select best fit result. More...
 

Protected Attributes

JVersor3D dir
 

Detailed Description

Auxiliary class to compare fit results with respect to a reference direction (e.g.

true muon). The sort operation results in an ordered set of fit results with increasing angle between the reference direction and that of the fit results.

Definition at line 533 of file JEvtToolkit.hh.

Constructor & Destructor Documentation

JFIT::JPointing::JPointing ( const JVersor3D dir)
inline

Constructor.

Parameters
dirreference direction

Definition at line 540 of file JEvtToolkit.hh.

541  {
542  this->dir = dir;
543  }

Member Function Documentation

JVersor3D JFIT::JPointing::getDirection ( ) const
inline

Get direction.

Returns
direction

Definition at line 551 of file JEvtToolkit.hh.

552  {
553  return dir;
554  }
double JFIT::JPointing::getDot ( const JFit fit) const
inline

Get dot product between reference direction and fit result.

Parameters
fitfit
Returns
dot product

Definition at line 563 of file JEvtToolkit.hh.

564  {
565  return JFIT::getDot(fit, dir);
566  }
double getDot(const JFit &first, const JFit &second)
Get dot product.
Definition: JEvtToolkit.hh:168
double JFIT::JPointing::getAngle ( const JFit fit) const
inline

Get angle between reference direction and fit result.

Parameters
fitfit
Returns
angle [deg]

Definition at line 575 of file JEvtToolkit.hh.

576  {
577  const double dot = getDot(fit);
578 
579  if (dot >= +1.0)
580  return 0.0;
581  else if (dot <= -1.0)
582  return 180.0;
583  else
584  return acos(dot) * 180.0 / JTOOLS::PI;
585  }
static const double PI
Constants.
Definition: JConstants.hh:20
double getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
Definition: JEvtToolkit.hh:563
bool JFIT::JPointing::operator() ( const JFit first,
const JFit second 
) const
inline

Comparison of fit results.

Parameters
firstfirst fit
secondsecond fit
Returns
true if first fit worse; else false

Definition at line 595 of file JEvtToolkit.hh.

596  {
597  return this->getDot(first) < this->getDot(second);
598  }
double getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
Definition: JEvtToolkit.hh:563
template<class T >
T JFIT::JPointing::operator() ( __begin,
__end 
) const
inline

Select best fit result.

Parameters
__beginbegin of fit results
__endend of fit results
Returns
best fit result

Definition at line 609 of file JEvtToolkit.hh.

610  {
611  return std::max_element(__begin, __end, *this);
612  }

Member Data Documentation

JVersor3D JFIT::JPointing::dir
protected

Definition at line 615 of file JEvtToolkit.hh.


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