The Gaudi Framework  master (37c0b60a)
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"
32 #include <GaudiKernel/DataObject.h>
38 #include <GaudiKernel/MsgStream.h>
39 
41 StreamBuffer& RndmEngine::serialize( StreamBuffer& str ) { return str; }
43 
45 StreamBuffer& RndmEngine::serialize( StreamBuffer& str ) const { return str; }
46 
48 double RndmEngine::rndm() const { return DBL_MAX; }
49 
57  array.resize( start + howmany );
58  std::generate_n( std::next( array.begin(), start ), howmany, [&]() { return this->rndm(); } );
59  return StatusCode::SUCCESS;
60 }
std::generate_n
T generate_n(T... args)
RndmEngine::serialize
StreamBuffer & serialize(StreamBuffer &str) override
Input serialization from stream buffer.
Definition: RndmEngine.cpp:42
Service::start
StatusCode start() override
Definition: Service.cpp:187
std::vector< double >
IOTest.start
start
Definition: IOTest.py:110
IMessageSvc.h
IDataProviderSvc.h
StreamBuffer
Definition: StreamBuffer.h:52
IIncidentSvc.h
RndmEngine.h
StatusCode
Definition: StatusCode.h:65
IOpaqueAddress.h
RndmEngine::rndmArray
StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const override
Multiple shots returning vector with flat random numbers.
Definition: RndmEngine.cpp:56
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DataObject.h
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:37
RndmEngine::rndm
double rndm() const override
Single shot returning single random number.
Definition: RndmEngine.cpp:48
ISvcLocator.h
MsgStream.h
std::next
T next(T... args)