Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// $Id: Geant4Converter.cpp 603 2013-06-13 21:15:14Z markus.frank $
//====================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------
//
// Author : M.Frank
//
//====================================================================
// Framework include files
#include "DD4hep/Printout.h"
#include "DD4hep/InstanceCount.h"
#include "DDG4/Geant4Random.h"
#include "TRandom1.h"
// C/C++ include files
#include <cmath>
using namespace std;
using namespace DD4hep::Simulation;
/// Default constructor
Geant4Random::Geant4Random() {
if ( 0 == gRandom ) gRandom = new TRandom1();
InstanceCount::increment(this);
}
/// Default destructor
Geant4Random::~Geant4Random() {
InstanceCount::decrement(this);
}
void Geant4Random::circle(double &x, double &y, double r) {
gRandom->Circle(x,y,r);
}
//
double Geant4Random::exp(double tau) {
return gRandom->Exp(tau);
}
//
double Geant4Random::gauss(double mean, double sigma) {
return gRandom->Gaus(mean,sigma);
}
//
double Geant4Random::landau(double mean, double sigma) {
return gRandom->Landau(mean,sigma);
}
//
double Geant4Random::rndm(int i) {
return gRandom->Rndm(i);
}
//
void Geant4Random::rndmArray(int n, float *array) {
gRandom->RndmArray(n,array);
}
//
void Geant4Random::rndmArray(int n, double *array) {
gRandom->RndmArray(n,array);
}
//
void Geant4Random::sphere(double &x, double &y, double &z, double r) {
gRandom->Sphere(x,y,z,r);
}
//
double Geant4Random::uniform(double x1) {
return gRandom->Uniform(x1);
}
//
double Geant4Random::uniform(double x1, double x2) {
return gRandom->Uniform(x1,x2);
}