Jpp  15.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
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. More...
 
 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 >
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 523 of file JReconstruction/JEvtToolkit.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JPointing::JPointing ( )
inline

Default constructor.

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

529  {}
JRECONSTRUCTION::JPointing::JPointing ( const JVersor3D dir)
inline

Constructor.

Parameters
dirreference direction

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

538  {
539  this->dir = dir;
540  }

Member Function Documentation

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

Get direction.

Returns
direction

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

549  {
550  return dir;
551  }
double JRECONSTRUCTION::JPointing::getDot ( const JFit fit) const
inline

Get dot product between reference direction and fit result.

Parameters
fitfit
Returns
dot product

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

561  {
562  return JRECONSTRUCTION::getDot(fit, dir);
563  }
double getDot(const JFit &first, const JFit &second)
Get dot product.
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 572 of file JReconstruction/JEvtToolkit.hh.

573  {
574  const double dot = getDot(fit);
575 
576  if (dot >= +1.0)
577  return 0.0;
578  else if (dot <= -1.0)
579  return 180.0;
580  else
581  return acos(dot) * 180.0 / JMATH::PI;
582  }
static const double PI
Mathematical constants.
double getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
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 worse; else false

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

593  {
594  return this->getDot(first) < this->getDot(second);
595  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
double getDot(const JFit &fit) const
Get dot product between reference direction and fit result.
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 606 of file JReconstruction/JEvtToolkit.hh.

607  {
608  return std::max_element(__begin, __end, *this);
609  }

Member Data Documentation

JVersor3D JRECONSTRUCTION::JPointing::dir
protected

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


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