Go to the documentation of this file.
25 #include <AIDA/IHistogram1D.h>
26 using AIDA::IHistogram1D;
47 if ( cmd.
find(
"genconf" ) != std::string::npos )
return;
56 if ( !status )
return status;
67 gen->shootArray( numbers, 5000 ).ignore();
68 IHistogram1D* his =
histoSvc()->book(
"1",
"Gauss", 40, 0., 3. );
69 for (
unsigned int i = 0; i < numbers.
size(); i++ ) his->fill( numbers[i], 1.0 );
71 for (
int j = 0;
j < 5000;
j++ ) his->fill( gen->shoot(), 1.0 );
79 IHistogram1D* his =
histoSvc()->book(
"2",
"Exponential", 40, 0., 3. );
80 for (
long j = 0;
j < 5000;
j++ ) his->fill( exponential(), 1.0 );
90 if ( !status.
isSuccess() ) {
return status; }
96 IHistogram1D* hispoisson =
histoSvc()->book(
"3",
"Poisson", 40, 0., 3. );
97 for (
long j = 0;
j < 5000;
j++ ) hispoisson->fill(
m_numbers(), 1.0 );
103 if ( gaussiantail ) {
104 IHistogram1D* his =
histoSvc()->book(
"4",
"GaussianTail", 50, 0., 50. );
105 for (
long j = 0;
j < 50009;
j++ ) his->fill( gaussiantail(), 1.0 );
114 m_ntuple =
ntupleSvc()->book(
"/NTUPLES/FILE1/100", CLID_RowWiseTuple,
"Hello World" );
127 static int count = 0;
134 auto scale = []( uint32_t x, uint32_t
size ) {
135 const uint32_t denom = boost::integer_traits<uint32_t>::const_max /
size;
146 if ( !status.
isSuccess() ) { error() <<
"Cannot fill NTuple" <<
endmsg; }
NTuple::Item< uint32_t > m_deter
constexpr auto size(const T &, Args &&...) noexcept
SmartIF< IRndmGenSvc > & randSvc() const
The standard RandomGen service, Return a pointer to the service if present.
NTuple::Item< float > m_gauss
const std::string & name() const override
The identifying name of the algorithm object.
uint32_t m_initial
Initial seed to fill deterministic random numbers.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Alias for backward compatibility.
SmartIF< IHistogramSvc > & histoSvc() const
The standard histogram service.
StatusCode execute() override
Event callback.
Parameters for the Gaussian tail number generation.
NTuple::Item< int > m_int
N-tuple items.
Rndm::Numbers m_numbers
Allocate wrapper for random number generator.
Parameters for the Gauss random number generation.
Random number accessor This small class encapsulates the use of the random number generator.
virtual StatusCode write()=0
Write record of the NTuple (Shortcut of writeRecord)
virtual StatusCode finalize()
Finalization.
uint32_t mixString(uint32_t state, const std::string &extra)
mix some 'extra' entropy into 'state' and return result
~RandomNumberAlg() override
Standard Destructor.
StatusCode finalize() override
Customized finalisation.
uint32_t mix32(uint32_t state, uint32_t extra)
mix some 'extra' entropy into 'state' and return result
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
StatusCode initialize() override
Customized initialisation.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
virtual StatusCode initialize(const SmartIF< IRndmGenSvc > &svc, const IRndmGen::Param &par)
Initialization.
constexpr static const auto SUCCESS
#define DECLARE_COMPONENT(type)
GAUDI_API const std::vector< std::string > cmdLineArgs()
Command line arguments including executable name as arg[0] as vector of strings.
Parameters for the Gauss random number generation.
NTuple::Item< float > m_poisson
Parameters for the Poisson distributed random number generation with a given mean.
constexpr static const auto FAILURE
NTuple::Item< float > m_exponential
NTuple::Tuple * m_ntuple
Pointer to N-tuple.
SmartIF< INTupleSvc > & ntupleSvc() const
The standard N tuple service.