Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
JPHYSICS::JPDF::JRoot Class Reference

Auxiliary class to find solution(s) to $ z $ of the square root expression:

\begin{eqnarray*} ct(z=0) & = & z + n \sqrt(z^2 + R^2) \end{eqnarray*}

where $ n = 1/\cos(\theta_{c}) $ is the index of refraction. More...

#include <JPDF.hh>

Public Member Functions

 JRoot (const double R, const double n, const double t)
 Determine solution(s) of quadratic equation. More...
 
double operator[] (const int i) const
 Get result by index. More...
 

Public Attributes

bool is_valid
 validity of solutions More...
 
double first
 most upstream solution More...
 
double second
 most downstream solution More...
 

Detailed Description

Auxiliary class to find solution(s) to $ z $ of the square root expression:

\begin{eqnarray*} ct(z=0) & = & z + n \sqrt(z^2 + R^2) \end{eqnarray*}

where $ n = 1/\cos(\theta_{c}) $ is the index of refraction.

Definition at line 1971 of file JPDF.hh.

Constructor & Destructor Documentation

JPHYSICS::JPDF::JRoot::JRoot ( const double  R,
const double  n,
const double  t 
)
inline

Determine solution(s) of quadratic equation.

Parameters
Rminimal distance of approach [m]
nindex of refraction
ttime at z = 0 [ns]

Definition at line 1980 of file JPDF.hh.

1982  :
1983  is_valid(false),
1984  first (0.0),
1985  second(0.0)
1986  {
1987  const double a = n*n - 1.0;
1988  const double b = 2*C*t;
1989  const double c = R*n * R*n - C*t * C*t;
1990 
1991  const double q = b*b - 4*a*c;
1992 
1993  if (q >= 0.0) {
1994 
1995  first = (-b - sqrt(q)) / (2*a);
1996  second = (-b + sqrt(q)) / (2*a);
1997 
1998  is_valid = C*t > second;
1999  }
2000  }
double second
most downstream solution
Definition: JPDF.hh:2026
static const double C
Physics constants.
const int n
Definition: JPolint.hh:786
then JCalibrateToT a
Definition: JTuneHV.sh:107
bool is_valid
validity of solutions
Definition: JPDF.hh:2024
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
double first
most upstream solution
Definition: JPDF.hh:2025

Member Function Documentation

double JPHYSICS::JPDF::JRoot::operator[] ( const int  i) const
inline

Get result by index.

Parameters
iindex (0 or 1)
Returns
i == 0, first; i == 1, second; else throws exception

Definition at line 2009 of file JPDF.hh.

2010  {
2011  switch (i) {
2012 
2013  case 0:
2014  return first;
2015 
2016  case 1:
2017  return second;
2018 
2019  default:
2020  THROW(JException, "JRoot::operator[] invalid index");
2021  }
2022  }
double second
most downstream solution
Definition: JPDF.hh:2026
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
double first
most upstream solution
Definition: JPDF.hh:2025

Member Data Documentation

bool JPHYSICS::JPDF::JRoot::is_valid

validity of solutions

Definition at line 2024 of file JPDF.hh.

double JPHYSICS::JPDF::JRoot::first

most upstream solution

Definition at line 2025 of file JPDF.hh.

double JPHYSICS::JPDF::JRoot::second

most downstream solution

Definition at line 2026 of file JPDF.hh.


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