Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RndmGen.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 RndmGen class definition
13 //--------------------------------------------------------------------
14 //
15 // Package : Gaudi/RndmGen ( The LHCb Offline System)
16 // Author : M.Frank
17 //====================================================================
18 #pragma once
19 
20 #include <memory>
21 // Framework include files
22 #include <GaudiKernel/IRndmGen.h>
23 #include <GaudiKernel/SmartIF.h>
24 
25 // Forward declarations
26 class IRndmEngine;
27 
50 class RndmGen : public implements<IRndmGen> {
51 
52 protected:
54  std::unique_ptr<IRndmGen::Param> m_params;
57 
59  RndmGen( IInterface* engine );
60 
61 public:
63  StatusCode initialize( const IRndmGen::Param& par ) override;
66  StatusCode finalize() override;
68  const InterfaceID& type() const override { return ( m_params != 0 ) ? m_params->type() : IID_IRndmFlat; }
70  long ID() const override { return long( this ); }
72  const IRndmGen::Param* parameters() const override { return m_params.get(); }
78  StatusCode shootArray( std::vector<double>& array, long howmany, long start ) const override;
79 };
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:41
RndmGen::type
const InterfaceID & type() const override
Random number generator type.
Definition: RndmGen.h:68
IRndmEngine
Definition: IRndmEngine.h:25
IOTest.start
start
Definition: IOTest.py:110
RndmGen::ID
long ID() const override
Random number generator ID.
Definition: RndmGen.h:70
RndmGen::RndmGen
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:33
compareOutputFiles.par
par
Definition: compareOutputFiles.py:477
RndmGen::parameters
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition: RndmGen.h:72
SmartIF.h
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation
Definition: RndmGen.cpp:36
IRndmGen.h
RndmGen
Random Generator definition.
Definition: RndmGen.h:50
StatusCode
Definition: StatusCode.h:64
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:56
IRndmGen::Param
Definition: IRndmGen.h:45
SmartIF< IRndmEngine >
implements
Base class used to implement the interfaces.
Definition: implements.h:19
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:29
IInterface
Definition: IInterface.h:225
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:54
InterfaceID
Definition: IInterface.h:38
RndmGen::shootArray
StatusCode shootArray(std::vector< double > &array, long howmany, long start) const override
Multiple shots returning vector with random number according to specified distribution.
Definition: RndmGen.cpp:44