Garfield++ 4.0
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
3#include <vector>
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
13namespace Heed {
14
15double chispre(std::vector<double> &f, int s_allow_zero_f = 0);
16// here intervals are unit
17// function p is a constant along these intervals.
18// last point x[q] is the end of last interval.
19// p and f must have dimensions q.
20// f is return array.
21// f[n] is normalized integral till the end of n'th interval or till
22// x[n+1].
23// Normalization is such that f[q-1]=1.0;
24// Return value is the true integral.
25// Sun of f should be always more than zero.
26// if s_allow_zero_f = 1, some values of f are allowed to be
27// negative and they are made zero with diagnostic printed.
28// (this have sence only for debug.)
29
30double chisran(double flat_random_number, const std::vector<double> &f);
31}
32
33#endif
Definition: BGMesh.cpp:6
double chisran(double flat_random_number, const std::vector< double > &f)
Definition: chisran.cpp:32
double chispre(std::vector< double > &f, int s_allow_zero_f)
Definition: chisran.cpp:8