8 #include "CLHEP/Random/Ranlux64Engine.h"
9 #include "CLHEP/Random/RanecuEngine.h"
10 #include "CLHEP/Random/MTwistEngine.h"
11 #include "CLHEP/Random/RandGauss.h"
12 #include "CLHEP/Random/RandGaussQ.h"
13 #include "CLHEP/Random/RandExponential.h"
14 #include "CLHEP/Random/RandGaussZiggurat.h"
15 #include "CLHEP/Random/RandExpZiggurat.h"
20 #include "GaudiKernel/DataSvc.h"
21 #include "GaudiKernel/Chrono.h"
22 #include "GaudiKernel/ISvcLocator.h"
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/TypeNameString.h"
39 m_rndmSvc1(
"AtRanluxGenSvc",
name),
41 m_randomEngineName1(
"rnd_AtRanluxGenSvc"),
42 m_rndmSvc2(
"AtDSFMTGenSvc",
name),
44 m_randomEngineName2(
"rnd_AtDSFMTGenSvc")
56 SmartIF<IChronoStatSvc> smartChrono{serviceLocator()->service(
"ChronoStatSvc")};
60 return StatusCode::FAILURE;
70 return StatusCode::FAILURE;
74 return StatusCode::FAILURE;
81 return StatusCode::FAILURE;
86 return StatusCode::FAILURE;
88 SmartIF<ITHistSvc> smartHistSvc{serviceLocator()->service(
"THistSvc")};
91 msg(MSG::ERROR) <<
"Cannot allocate THistSvc service" <<
endmsg;
92 return StatusCode::FAILURE;
95 m_hflat=
new TH1D(
"RandFlat",
"RandFlat",1000,0,1);
97 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hflat->GetName() <<
endmsg;
100 m_hgauss1=
new TH1D(
"RandGauss",
"RandGauss",700,-7,7);
102 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hgauss1->GetName() <<
endmsg;
105 m_hgauss2=
new TH1D(
"RandGaussQ",
"RandGaussQ",700,-7,7);
107 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hgauss2->GetName() <<
endmsg;
110 m_hgauss3=
new TH1D(
"RandGaussZigurat",
"RandGaussZigurat",700,-7,7);
112 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hgauss3->GetName() <<
endmsg;
115 m_hexp1=
new TH1D(
"RandExponential",
"RandExponential",900,0,30);
117 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hexp1->GetName() <<
endmsg;
120 m_hexp2=
new TH1D(
"RandExpZiggurat",
"RandExpZiggurat",900,0,30);
122 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hexp2->GetName() <<
endmsg;
125 m_hbin1=
new TH1D(
"RandBinomial",
"RandBinomial",4,-0.5,3.5);
127 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hbin1->GetName() <<
endmsg;
130 m_hbin2=
new TH1D(
"RandBinomialFixedP",
"RandBinomialFixedP",4,-0.5,3.5);
132 msg(MSG::WARNING) <<
"Could not register histogram "<<
m_hbin2->GetName() <<
endmsg;
136 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
154 for(
int i=0;
i<ntest;++
i) {
163 m_chrono -> chronoStart(
"RandGauss");
165 for(
int i=0;
i<ntest;++
i) {
171 m_chrono -> chronoStop(
"RandGauss");
174 m_chrono -> chronoStart(
"RandGaussQ");
176 for(
int i=0;
i<ntest;++
i) {
182 m_chrono -> chronoStop(
"RandGaussQ");
185 m_chrono -> chronoStart(
"RandGaussZiggurat");
187 for(
int i=0;
i<ntest;++
i) {
193 m_chrono -> chronoStop(
"RandGaussZiggurat");
196 m_chrono -> chronoStart(
"RandExponential");
198 for(
int i=0;
i<ntest;++
i) {
204 m_chrono -> chronoStop(
"RandExponential");
207 m_chrono -> chronoStart(
"RandExpZiggurat");
209 for(
int i=0;
i<ntest;++
i) {
215 m_chrono -> chronoStop(
"RandExpZiggurat");
220 for(
int n=1;
n<6;
n+=1) {
223 for(
int i=0;
i<ntest;++
i) {
234 for(
int i=0;
i<ntest;++
i) {
299 return StatusCode::SUCCESS;