The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
RndmEngine.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11//====================================================================
12// Random Engine implementation
13//--------------------------------------------------------------------
14//
15// Package : Gaudi/RndmGen ( The LHCb Offline System)
16// Author : M.Frank
17// History :
18// +---------+----------------------------------------------+---------
19// | Date | Comment | Who
20// +---------+----------------------------------------------+---------
21// | 29/10/99| Initial version | MF
22// +---------+----------------------------------------------+---------
23//
24//====================================================================
25#define GAUDI_RANDOMGENSVC_RndmEngine_CPP
26
27// STL include files
28#include <cfloat>
29
30// Framework include files
31#include "RndmEngine.h"
39
43
45StreamBuffer& RndmEngine::serialize( StreamBuffer& str ) const { return str; }
46
48double RndmEngine::rndm() const { return DBL_MAX; }
49
56StatusCode RndmEngine::rndmArray( std::vector<double>& array, long howmany, long start ) const {
57 array.resize( start + howmany );
58 std::generate_n( std::next( array.begin(), start ), howmany, [&]() { return this->rndm(); } );
60}
StreamBuffer & serialize(StreamBuffer &str) override
Input serialization from stream buffer.
StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const override
Multiple shots returning vector with flat random numbers.
double rndm() const override
Single shot returning single random number.
StatusCode start() override
Definition Service.cpp:187
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto SUCCESS
Definition StatusCode.h:99
The stream buffer is a small object collecting object data.