Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
chisran.h
Go to the documentation of this file.
1#ifndef CHISRAN_H
2#define CHISRAN_H
4
5// Remake of CERN's subroutine hisran for generation of random numbers
6// according to histogram
7// I. B. Smirnov, 2003.
8
9// This is old programs.
10// The new ones are in wcpplib/math/tline.h
11// They are more generic, although the old ones should be working as well.
12
13float chispre(float *x, float *p, float *f, long q);
14// here x is a left side of interval on which
15// function p is a constant.
16// last point x[q] is the end of last interval.
17// p and f must have dimensions q.
18// x must have dimension q + 1
19// f is return array.
20// f[n] is normalized integral till the end of n'th interval or till
21// x[n+1].
22// Normalization is such that f[q-1]=1.0;
23// Return value is the true integral.
24
25float chisran(float flat_random_number, float *x, float *f, long q);
26
27double chispre(DynLinArr<double> &f, int s_allow_zero_f = 0);
28// here intervals are unit
29// function p is a constant along these intervals.
30// last point x[q] is the end of last interval.
31// p and f must have dimensions q.
32// f is return array.
33// f[n] is normalized integral till the end of n'th interval or till
34// x[n+1].
35// Normalization is such that f[q-1]=1.0;
36// Return value is the true integral.
37// Sun of f should be always more than zero.
38// if s_allow_zero_f = 1, some values of f are allowed to be
39// negative and they are made zero with diagnostic printed.
40// (this have sence only for debug.)
41
42double chisran(double flat_random_number, DynLinArr<double> f);
43
44#endif
float chispre(float *x, float *p, float *f, long q)
Definition: chisran.cpp:7
float chisran(float flat_random_number, float *x, float *f, long q)
Definition: chisran.cpp:22