Jpp - 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 1966 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 1975 of file JPDF.hh.

1977  :
1978  is_valid(false),
1979  first (0.0),
1980  second(0.0)
1981  {
1982  const double a = n*n - 1.0;
1983  const double b = 2*C*t;
1984  const double c = R*n * R*n - C*t * C*t;
1985 
1986  const double q = b*b - 4*a*c;
1987 
1988  if (q >= 0.0) {
1989 
1990  first = (-b - sqrt(q)) / (2*a);
1991  second = (-b + sqrt(q)) / (2*a);
1992 
1993  is_valid = C*t > second;
1994  }
1995  }
double second
most downstream solution
Definition: JPDF.hh:2021
static const double C
Physics constants.
bool is_valid
validity of solutions
Definition: JPDF.hh:2019
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable NORTH set_variable EAST set_variable SOUTH set_variable WEST set_variable WORKDIR tmp set_variable R set_variable CT set_variable YMAX set_variable YMIN if do_usage *then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:35
then JCalibrateToT a
Definition: JTuneHV.sh:116
alias put_queue eval echo n
Definition: qlib.csh:19
double first
most upstream solution
Definition: JPDF.hh:2020

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 2004 of file JPDF.hh.

2005  {
2006  switch (i) {
2007 
2008  case 0:
2009  return first;
2010 
2011  case 1:
2012  return second;
2013 
2014  default:
2015  throw JException("JRoot::operator[] invalid index");
2016  }
2017  }
double second
most downstream solution
Definition: JPDF.hh:2021
double first
most upstream solution
Definition: JPDF.hh:2020

Member Data Documentation

bool JPHYSICS::JPDF::JRoot::is_valid

validity of solutions

Definition at line 2019 of file JPDF.hh.

double JPHYSICS::JPDF::JRoot::first

most upstream solution

Definition at line 2020 of file JPDF.hh.

double JPHYSICS::JPDF::JRoot::second

most downstream solution

Definition at line 2021 of file JPDF.hh.


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