Newer
Older
Markus Frank
committed
//==========================================================================
// AIDA Detector description implementation for LCD
Markus Frank
committed
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
Markus Frank
committed
// All rights reserved.
Markus Frank
committed
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
Markus Frank
committed
// Author : M.Frank
//
//==========================================================================
// Framework include files
#include "DD4hep/Printout.h"
#include "DD4hep/InstanceCount.h"
#include "DDG4/Geant4Random.h"
Markus Frank
committed
// ROOT include files
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
83
84
85
86
87
88
#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);
}