Jpp 19.3.0-rc.5
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JPointing Class Reference

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

#include <JEvtToolkit.hh>

Public Member Functions

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

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 630 of file JReconstruction/JEvtToolkit.hh.

Constructor & Destructor Documentation

◆ JPointing() [1/3]

JRECONSTRUCTION::JPointing::JPointing ( )
inline

Default constructor.

Definition at line 635 of file JReconstruction/JEvtToolkit.hh.

636 {}

◆ JPointing() [2/3]

JRECONSTRUCTION::JPointing::JPointing ( const JVersor3D & dir)
inline

Constructor.

Parameters
dirreference direction

Definition at line 644 of file JReconstruction/JEvtToolkit.hh.

645 {
646 this->dir = dir;
647 }

◆ JPointing() [3/3]

JRECONSTRUCTION::JPointing::JPointing ( const JFit & fit)
inline

Constructor.

Parameters
fitfit

Definition at line 655 of file JReconstruction/JEvtToolkit.hh.

656 {
658 }
JDirection3D getDirection(const JFit &fit)
Get direction.

Member Function Documentation

◆ getDirection()

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

Get direction.

Returns
direction

Definition at line 666 of file JReconstruction/JEvtToolkit.hh.

667 {
668 return dir;
669 }

◆ getAngle()

double JRECONSTRUCTION::JPointing::getAngle ( const JFit & fit) const
inline

Get angle between reference direction and fit result.

Parameters
fitfit
Returns
angle [deg]

Definition at line 678 of file JReconstruction/JEvtToolkit.hh.

679 {
680 const double dot = getDot(fit, dir);
681
682 if (dot >= +1.0)
683 return 0.0;
684 else if (dot <= -1.0)
685 return 180.0;
686 else
687 return acos(dot) * 180.0 / JMATH::PI;
688 }
static const double PI
Mathematical constants.
double getDot(const JFit &first, const JFit &second)
Get dot product.

◆ operator()() [1/2]

bool JRECONSTRUCTION::JPointing::operator() ( const JFit & first,
const JFit & second ) const
inline

Comparison of fit results.

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

Definition at line 698 of file JReconstruction/JEvtToolkit.hh.

699 {
700 return getDot(first, dir) > getDot(second, dir);
701 }

◆ operator()() [2/2]

template<class T >
T JRECONSTRUCTION::JPointing::operator() ( T __begin,
T __end ) const
inline

Select best fit result.

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

Definition at line 712 of file JReconstruction/JEvtToolkit.hh.

713 {
714 return std::min_element(__begin, __end, *this);
715 }

Member Data Documentation

◆ dir

JVersor3D JRECONSTRUCTION::JPointing::dir
protected

Definition at line 718 of file JReconstruction/JEvtToolkit.hh.


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