Jpp  19.1.0-rc.1
the software that should make you happy
Public Member Functions | Protected Attributes | Friends | List of all members
JOSCPROB::JBaselineComputer Struct Reference

Auxiliary data structure for storing and calculating baselines. More...

#include <JBaselineComputer.hh>

Inheritance diagram for JOSCPROB::JBaselineComputer:
JOSCPROB::JOscProbInterface

Public Member Functions

 JBaselineComputer ()
 Default constructor. More...
 
 JBaselineComputer (const double Lmin, const double Lmax)
 Constructor. More...
 
double getMinimumBaseline () const
 Get minimum baseline. More...
 
double getMaximumBaseline () const
 Get maximum baseline. More...
 
double getInnerRadius () const
 Get inner radius. More...
 
double getOuterRadius () const
 Get outer radius. More...
 
double getCosth (const double L) const
 Get cosine zenith angle for a given baseline. More...
 
double getBaseline (const double costh) const
 Get baseline for a given cosine zenith angle. More...
 
double operator() (const double costh) const
 Get baseline for a given cosine zenith angle. More...
 

Protected Attributes

double Lmin
 Minimum baseline [km]. More...
 
double Lmax
 Maximum baseline [km]. More...
 

Friends

std::istream & operator>> (std::istream &in, JBaselineComputer &object)
 Stream input of baseline calculator. More...
 
std::ostream & operator<< (std::ostream &out, const JBaselineComputer &object)
 Stream output of baseline calculator. More...
 

Detailed Description

Auxiliary data structure for storing and calculating baselines.

Definition at line 23 of file JBaselineComputer.hh.

Constructor & Destructor Documentation

◆ JBaselineComputer() [1/2]

JOSCPROB::JBaselineComputer::JBaselineComputer ( )
inline

Default constructor.

Definition at line 28 of file JBaselineComputer.hh.

28  :
29  Lmin(0.0),
30  Lmax(0.0)
31  {}
double Lmax
Maximum baseline [km].
double Lmin
Minimum baseline [km].

◆ JBaselineComputer() [2/2]

JOSCPROB::JBaselineComputer::JBaselineComputer ( const double  Lmin,
const double  Lmax 
)
inline

Constructor.

Parameters
LminMinimum baseline [km]
LmaxMaximum baseline [km]

Definition at line 40 of file JBaselineComputer.hh.

41  :
42  Lmin(Lmin),
43  Lmax(Lmax)
44  {}

Member Function Documentation

◆ getMinimumBaseline()

double JOSCPROB::JBaselineComputer::getMinimumBaseline ( ) const
inline

Get minimum baseline.

Returns
maximum baseline [km]

Definition at line 52 of file JBaselineComputer.hh.

53  {
54  return Lmin;
55  }

◆ getMaximumBaseline()

double JOSCPROB::JBaselineComputer::getMaximumBaseline ( ) const
inline

Get maximum baseline.

Returns
maximum baseline [km]

Definition at line 63 of file JBaselineComputer.hh.

64  {
65  return Lmax;
66  }

◆ getInnerRadius()

double JOSCPROB::JBaselineComputer::getInnerRadius ( ) const
inline

Get inner radius.

Returns
inner radius [km]

Definition at line 74 of file JBaselineComputer.hh.

75  {
76  return 0.5 * (Lmax - Lmin);
77  }

◆ getOuterRadius()

double JOSCPROB::JBaselineComputer::getOuterRadius ( ) const
inline

Get outer radius.

Returns
outer radius [km]

Definition at line 85 of file JBaselineComputer.hh.

86  {
87  return 0.5 * (Lmax + Lmin);;
88  }

◆ getCosth()

double JOSCPROB::JBaselineComputer::getCosth ( const double  L) const
inline

Get cosine zenith angle for a given baseline.

Parameters
Lbaseline [km]
Returns
cosine zenith angle

Definition at line 97 of file JBaselineComputer.hh.

98  {
99  const double r = getInnerRadius();
100  const double R = getOuterRadius();
101 
102  return (R*R - r*r - L*L) / (2*L*r);
103  }
data_type r[M+1]
Definition: JPolint.hh:868
double getInnerRadius() const
Get inner radius.
double getOuterRadius() const
Get outer radius.

◆ getBaseline()

double JOSCPROB::JBaselineComputer::getBaseline ( const double  costh) const
inline

Get baseline for a given cosine zenith angle.

Parameters
costhcosine zenith angle
Returns
baseline [km]

Definition at line 112 of file JBaselineComputer.hh.

113  {
114  const double r = getInnerRadius();
115  const double R = getOuterRadius();
116 
117  const double ct = (fabs(costh) < 1.0 ? costh : (costh < 0 ? -1.0 : 1.0));
118 
119  return (-r * ct + sqrt(R*R - r*r * (1 - ct) * (1 + ct)));
120  }

◆ operator()()

double JOSCPROB::JBaselineComputer::operator() ( const double  costh) const
inline

Get baseline for a given cosine zenith angle.

Parameters
costhcosine zenith angle
Returns
baseline [km]

Definition at line 129 of file JBaselineComputer.hh.

130  {
131  return getBaseline(costh);
132  }
double getBaseline(const double costh) const
Get baseline for a given cosine zenith angle.

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  in,
JBaselineComputer object 
)
friend

Stream input of baseline calculator.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 142 of file JBaselineComputer.hh.

143  {
144  return in >> object.Lmin >> object.Lmax;
145  }

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const JBaselineComputer object 
)
friend

Stream output of baseline calculator.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 155 of file JBaselineComputer.hh.

156  {
157  using namespace JPP;
158 
159  return out << FIXED(15,5) << object.Lmin << FIXED(15,5) << object.Lmax;
160  }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:448

Member Data Documentation

◆ Lmin

double JOSCPROB::JBaselineComputer::Lmin
protected

Minimum baseline [km].

Definition at line 165 of file JBaselineComputer.hh.

◆ Lmax

double JOSCPROB::JBaselineComputer::Lmax
protected

Maximum baseline [km].

Definition at line 166 of file JBaselineComputer.hh.


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