Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
JCALIBRATE::JPairwiseComparator Struct Reference

Auxiliary class to sort pairs of PMT addresses within optical module. More...

#include <JCalibrateK40.hh>

Public Member Functions

 JPairwiseComparator (const JModule &module, const double epsilon=1.0e-5)
 Constructor.
 
bool operator() (const pair_type &first, const pair_type &second) const
 Comparison of two pairs of PMT addresses.
 
double getDot (const pair_type &pair) const
 Get cosine of space angle between PMT axes.
 

Protected Attributes

const JModule &const double epsilon
 

Detailed Description

Auxiliary class to sort pairs of PMT addresses within optical module.

Definition at line 47 of file JCalibrateK40.hh.

Constructor & Destructor Documentation

◆ JPairwiseComparator()

JCALIBRATE::JPairwiseComparator::JPairwiseComparator ( const JModule & module,
const double epsilon = 1.0e-5 )
inline

Constructor.

Parameters
moduledetector module
epsilonprecision

Definition at line 54 of file JCalibrateK40.hh.

55 :
56 module (module),
58 {}
const JModule &const double epsilon

Member Function Documentation

◆ operator()()

bool JCALIBRATE::JPairwiseComparator::operator() ( const pair_type & first,
const pair_type & second ) const
inline

Comparison of two pairs of PMT addresses.

Parameters
firstfirst pair of PMT addresses
secondsecond pair of PMT addresses
Returns
true if first pair has larger space angle; else false

Definition at line 68 of file JCalibrateK40.hh.

69 {
70 using namespace std;
71
72 if (fabs(this->getDot(first) - this->getDot(second)) > epsilon)
73 return this->getDot(first) < this->getDot(second);
74 else if (max(first.first, first.second) == max(second.first, second.second))
75 return min(first.first, first.second) < min(second.first, second.second);
76 else
77 return max(first.first, first.second) < max(second.first, second.second);
78 }
double getDot(const pair_type &pair) const
Get cosine of space angle between PMT axes.

◆ getDot()

double JCALIBRATE::JPairwiseComparator::getDot ( const pair_type & pair) const
inline

Get cosine of space angle between PMT axes.

Parameters
pairpair of PMT addresses
Returns
cosine

Definition at line 87 of file JCalibrateK40.hh.

88 {
89 return JMATH::getDot(module.getPMT(pair.first) .getDirection(),
90 module.getPMT(pair.second).getDirection());
91 }
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.

Member Data Documentation

◆ epsilon

const JModule& const double JCALIBRATE::JPairwiseComparator::epsilon
protected

Definition at line 95 of file JCalibrateK40.hh.


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