Vincia Tools
Here will be documented the numerical integrators, spliners, root
finders, clustering maps etc, that Vincia uses, along with how small
utility functions, such as num2str
, work. The idea is to
help people who look in the code themselves and/or who wish to modify
it themselves.
The VinClu clustering map
The VinClu clustering map is a 3->2 clustering
map rather similar to that of the Arclus jet clustering algorithm.
Its principal advantage is that it
contains the exact inverses of the Vincia kinematics mappings, and
hence it can be used to "undo" branchings and/or reconstruct the exact
intermediate shower states from a given momentum configuration. The
clustering is invoked using:
-
void VinClu(int iMap, vector pIn, int a, int r, int
b, vector& pClu);
Here iMap
is the
index number of the kinematics map to be used (the numbering follows
Vincia:kineMapType
), pIn
is a vector of
arbitrary size containing the state of particles to be clustered,
and the indices a
, r
, b
represent the 3 particles to be clustered in the backwards
reconstruction of AB->arb. The reconstructed momenta of the
parents, A and B, are returned
in pClu[0]
and pClu[1]
, respectively.
Rambo Generator
double Rambo(double S,int N,double p[4][8]);
Text Output Utilities
string num2str(x, int width)
converts a
number, x
(int
or double
) to a
string of width width
for formatted output.
string bool2str(bool b)
converts a
bool to a string ("y"/"n") for formatted output.
void printOut(int verbLevel, string place, string
message);
if the current verbose
setting is
greater than or equal to verbLevel
, this command
prints the string message
to stdout
,
prefaced by place
in parenthesis.
void printErr(int verbLevel, string place, string
message);
same as above but prints to stderr
instead of stdout
.
Mathematical Functions and Constants
Binomial and Factorial
The binomial coefficients, (n,m), and the
factorial, n!, are available inside namespace
Vincia
as:
int factorial(int n)
int binomial(int n, int m)
Dilogarithms
The dilogarithm, Li2(x), is available inside namespace
Vincia
as:
double Li2(double x, double kmax, double xerr)
The Gamma Function
The Gamma function, Gamma(x) is implemented for x >
0, and is based on the approximation by Lanczos (see Numerical
Recipes). Two function calls are availabe inside namespace
Vincia
:
double lnGamma(double x)
double Gamma(double x)
The former is often more useful in calculations involving ratios of
the Gamma function with large numbers, which would be cast as
differences of logs.
Numerical Integration and Root Finding
double integrateGauss(double (*fun)(double), double xlo, double xhi,
double tol);
double zbrent(double (*fun)(double), double r, double x1, double
x2, double tol);
One-dimensional Splines
-
void makeSpline(vector& x, vector& y,
vector& y2);
double getSpline(const double x, vector& xa,
vector& ya, vector&
y2a);
Last modified: