Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
arsenal.cpp File Reference
#include <vector>
#include <iostream>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <cmath>
#include <iomanip>
#include <cstdarg>
#include "arsenal.h"
+ Include dependency graph for arsenal.cpp:

Go to the source code of this file.

Macros

#define OUTPUT_PRECISION   10
 
#define D1   -0.5772156649015328605195174
 
#define D2   0.4227843350984671393993777
 
#define D4   1.791759469228055000094023
 
#define SQRTPI   0.9189385332046727417803297
 
#define FRTBIG   1.42E+09
 
#define PNT68   0.6796875
 
#define XBIG   4.08E+36
 
#define MACHINE_EPSILON   2.22044604925031e-016
 

Functions

double sixPoint2dInterp (double x, double y, double v00, double v01, double v02, double v10, double v11, double v20)
 
double interpCubicDirect (vector< double > *x, vector< double > *y, double x0)
 
double interpLinearDirect (vector< double > *x, vector< double > *y, double x0)
 
double interpNearestDirect (vector< double > *x, vector< double > *y, double x0)
 
double interpCubicMono (vector< double > *x, vector< double > *y, double xx)
 
double interpLinearMono (vector< double > *x, vector< double > *y, double xx)
 
double interpNearestMono (vector< double > *x, vector< double > *y, double xx)
 
double invertFunc (double(*func)(double), double y, double xL, double xR, double dx, double x0, double relative_accuracy)
 
double invertTableDirect_hook (double xx)
 
double invertTableDirect (vector< double > *x, vector< double > *y, double y0, double x0, double relative_accuracy)
 
vector< doublestringToDoubles (string str)
 
double stringToDouble (string str)
 
vector< vector< double > * > * readBlockData (istream &stream_in)
 
void releaseBlockData (vector< vector< double > * > *data)
 
double adaptiveSimpsonsAux (double(*f)(double), double a, double b, double epsilon, double S, double fa, double fb, double fc, int bottom)
 
double adaptiveSimpsons (double(*f)(double), double a, double b, double epsilon, int maxRecursionDepth)
 
double qiu_simpsons (double(*f)(double), double a, double b, double epsilon, int maxRecursionDepth)
 
double qiu_simpsonsRel (double(*f)(double), double a, double b, double epsilon, int maxRecursionDepth)
 
string toLower (string str)
 
string trim (string str)
 
long binarySearch (vector< double > *A, double value, bool skip_out_of_range)
 
long double gamma_function (long double x)
 
long double log_gamma_function (long double x)
 
double beta_function (double x, double y)
 
double binomial_coefficient (double n, double k)
 
void print_progressbar (double percentage, int length, string symbol)
 
void formatedPrint (ostream &os, int count,...)
 
void display_logo (int which)
 
void GaussLegendre_getWeight (int npts, double *xg, double *wg, double A, double B, int iop)
 
void get_bin_average_and_count (istream &is, ostream &os, vector< double > *bins, long col_to_bin, void(*func)(vector< double > *), long wanted_data_columns, bool silence)
 

Variables

vector< double > * zq_x_global
 
vector< double > * zq_y_global
 

Macro Definition Documentation

#define D1   -0.5772156649015328605195174

Definition at line 21 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 21 of file arsenal.cpp

Referenced by log_gamma_function(), and genfit::MplTrackRep::RKPropagate().

#define D2   0.4227843350984671393993777

Definition at line 22 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 22 of file arsenal.cpp

Referenced by log_gamma_function(), and genfit::MplTrackRep::RKPropagate().

#define D4   1.791759469228055000094023

Definition at line 23 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 23 of file arsenal.cpp

Referenced by log_gamma_function(), and genfit::MplTrackRep::RKPropagate().

#define FRTBIG   1.42E+09

Definition at line 25 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 25 of file arsenal.cpp

Referenced by log_gamma_function().

#define MACHINE_EPSILON   2.22044604925031e-016

Definition at line 28 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 28 of file arsenal.cpp

Referenced by log_gamma_function().

#define OUTPUT_PRECISION   10

Definition at line 18 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 18 of file arsenal.cpp

Referenced by formatedPrint(), and get_bin_average_and_count().

#define PNT68   0.6796875

Definition at line 26 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 26 of file arsenal.cpp

Referenced by log_gamma_function().

#define SQRTPI   0.9189385332046727417803297

Definition at line 24 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 24 of file arsenal.cpp

Referenced by log_gamma_function().

#define XBIG   4.08E+36

Definition at line 27 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 27 of file arsenal.cpp

Referenced by log_gamma_function().

Function Documentation

double adaptiveSimpsons ( double(*)(double f,
double  a,
double  b,
double  epsilon,
int  maxRecursionDepth 
)

Definition at line 519 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 519 of file arsenal.cpp

References adaptiveSimpsonsAux(), KFPMath::b, Acts::PhysicalConstants::c, f, fc, h, and S().

+ Here is the call graph for this function:

double adaptiveSimpsonsAux ( double(*)(double f,
double  a,
double  b,
double  epsilon,
double  S,
double  fa,
double  fb,
double  fc,
int  bottom 
)

Definition at line 503 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 503 of file arsenal.cpp

References adaptiveSimpsonsAux(), KFPMath::b, Acts::PhysicalConstants::c, Acts::UnitConstants::e, f, fd, and h.

Referenced by adaptiveSimpsons(), and adaptiveSimpsonsAux().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double beta_function ( double  x,
double  y 
)

Definition at line 875 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 875 of file arsenal.cpp

References log_gamma_function().

Referenced by binomial_coefficient().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

long binarySearch ( vector< double > *  A,
double  value,
bool  skip_out_of_range 
)

Definition at line 644 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 644 of file arsenal.cpp

References ambiguity_solver_full_chain::idx, G4PLUGDOOR::length, and value.

Referenced by get_bin_average_and_count(), interpCubicMono(), interpLinearMono(), and interpNearestMono().

+ Here is the caller graph for this function:

double binomial_coefficient ( double  n,
double  k 
)

Definition at line 886 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 886 of file arsenal.cpp

References beta_function().

+ Here is the call graph for this function:

void display_logo ( int  which)

Definition at line 960 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 960 of file arsenal.cpp

void formatedPrint ( ostream &  os,
int  count,
  ... 
)

Definition at line 946 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 946 of file arsenal.cpp

References test_fpe::count, j, and OUTPUT_PRECISION.

long double gamma_function ( long double  x)

Definition at line 680 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 680 of file arsenal.cpp

References Acts::UnitConstants::g, gr, i, k, Acts::UnitConstants::m, physmon_track_finding_ttbar::r, ambiguity_solver_full_chain::x, and physmon_track_finding_ttbar::z.

void GaussLegendre_getWeight ( int  npts,
double xg,
double wg,
double  A,
double  B,
int  iop 
)

Definition at line 1000 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 1000 of file arsenal.cpp

References A, i, j, Acts::UnitConstants::m, N, t, ambiguity_solver_full_chain::t1, and Acts::Test::tmp().

+ Here is the call graph for this function:

void get_bin_average_and_count ( istream &  is,
ostream &  os,
vector< double > *  bins,
long  col_to_bin,
void(*)(vector< double > *)  func,
long  wanted_data_columns,
bool  silence 
)

Definition at line 1112 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 1112 of file arsenal.cpp

References binarySearch(), Acts::UnitConstants::e, i, j, OUTPUT_PRECISION, and stringToDoubles().

+ Here is the call graph for this function:

double interpCubicDirect ( vector< double > *  x,
vector< double > *  y,
double  x0 
)

Definition at line 58 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 58 of file arsenal.cpp

References Acts::UnitConstants::e, ambiguity_solver_full_chain::idx, and size.

Referenced by invertTableDirect_hook().

+ Here is the caller graph for this function:

double interpCubicMono ( vector< double > *  x,
vector< double > *  y,
double  xx 
)

Definition at line 172 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 172 of file arsenal.cpp

References binarySearch(), Acts::UnitConstants::e, ambiguity_solver_full_chain::idx, size, and x0.

+ Here is the call graph for this function:

double interpLinearDirect ( vector< double > *  x,
vector< double > *  y,
double  x0 
)

Definition at line 110 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 110 of file arsenal.cpp

References Acts::UnitConstants::e, ambiguity_solver_full_chain::idx, and size.

double interpLinearMono ( vector< double > *  x,
vector< double > *  y,
double  xx 
)

Definition at line 258 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 258 of file arsenal.cpp

References binarySearch(), Acts::UnitConstants::e, ambiguity_solver_full_chain::idx, and size.

+ Here is the call graph for this function:

double interpNearestDirect ( vector< double > *  x,
vector< double > *  y,
double  x0 
)

Definition at line 141 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 141 of file arsenal.cpp

References Acts::UnitConstants::e, ambiguity_solver_full_chain::idx, and size.

double interpNearestMono ( vector< double > *  x,
vector< double > *  y,
double  xx 
)

Definition at line 288 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 288 of file arsenal.cpp

References binarySearch(), Acts::UnitConstants::e, ambiguity_solver_full_chain::idx, and size.

+ Here is the call graph for this function:

double invertFunc ( double(*)(double func,
double  y,
double  xL,
double  xR,
double  dx,
double  x0,
double  relative_accuracy 
)

Definition at line 318 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 318 of file arsenal.cpp

References F1, F2, F3, Acts::Test::tolerance, and x0.

Referenced by invertTableDirect().

+ Here is the caller graph for this function:

double invertTableDirect ( vector< double > *  x,
vector< double > *  y,
double  y0,
double  x0,
double  relative_accuracy 
)

Definition at line 391 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 391 of file arsenal.cpp

References invertFunc(), invertTableDirect_hook(), size, ambiguity_solver_full_chain::x, y, zq_x_global, and zq_y_global.

+ Here is the call graph for this function:

double invertTableDirect_hook ( double  xx)

Definition at line 390 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 390 of file arsenal.cpp

References interpCubicDirect(), zq_x_global, and zq_y_global.

Referenced by invertTableDirect().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

long double log_gamma_function ( long double  x)

Definition at line 763 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 763 of file arsenal.cpp

References Acts::PhysicalConstants::c, corr, D1, D2, D4, FRTBIG, MACHINE_EPSILON, merge_hashes::p, PNT68, SQRTPI, ambiguity_solver_full_chain::x, and XBIG.

Referenced by beta_function().

+ Here is the caller graph for this function:

void print_progressbar ( double  percentage,
int  length,
string  symbol 
)

Definition at line 898 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 898 of file arsenal.cpp

References i, G4PLUGDOOR::length, and utils::status.

double qiu_simpsons ( double(*)(double f,
double  a,
double  b,
double  epsilon,
int  maxRecursionDepth 
)

Definition at line 531 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 531 of file arsenal.cpp

References KFPMath::a, test_fpe::count, f, f_1, i, G4PLUGDOOR::length, and step.

double qiu_simpsonsRel ( double(*)(double f,
double  a,
double  b,
double  epsilon,
int  maxRecursionDepth 
)

Definition at line 574 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 574 of file arsenal.cpp

References KFPMath::a, test_fpe::count, f, f_1, i, G4PLUGDOOR::length, and step.

vector< vector<double>* >* readBlockData ( istream &  stream_in)

Definition at line 437 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 437 of file arsenal.cpp

References configureMap::data, i, and stringToDoubles().

+ Here is the call graph for this function:

void releaseBlockData ( vector< vector< double > * > *  data)

Definition at line 487 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 487 of file arsenal.cpp

References configureMap::data, and i.

double sixPoint2dInterp ( double  x,
double  y,
double  v00,
double  v01,
double  v02,
double  v10,
double  v11,
double  v20 
)

Definition at line 33 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 33 of file arsenal.cpp

References Acts::PhysicalConstants::c.

double stringToDouble ( string  str)

Definition at line 425 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 425 of file arsenal.cpp

Referenced by ParameterReader::phraseEquationWithoutComments().

+ Here is the caller graph for this function:

vector<double> stringToDoubles ( string  str)

Definition at line 407 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 407 of file arsenal.cpp

Referenced by get_bin_average_and_count(), and readBlockData().

+ Here is the caller graph for this function:

string toLower ( string  str)

Definition at line 618 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 618 of file arsenal.cpp

References it, str, and Acts::Test::tmp().

Referenced by ParameterReader::find(), and ParameterReader::setVal().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string trim ( string  str)

Definition at line 627 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 627 of file arsenal.cpp

References str, and Acts::Test::tmp().

Referenced by ParameterReader::find(), Fun4AllMonitoring::Get_Memory(), ParameterReader::phraseEquationWithoutComments(), ParameterReader::phraseOneLine(), and ParameterReader::setVal().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

vector<double>* zq_x_global

Definition at line 389 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 389 of file arsenal.cpp

Referenced by invertTableDirect(), and invertTableDirect_hook().

vector<double> * zq_y_global

Definition at line 389 of file arsenal.cpp.

View newest version in sPHENIX GitHub at line 389 of file arsenal.cpp

Referenced by invertTableDirect(), and invertTableDirect_hook().