The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
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
23#include <GaudiKernel/SmartIF.h>
24
25// Forward declarations
26class IRndmEngine;
27
50class RndmGen : public implements<IRndmGen> {
51
52protected:
54 std::unique_ptr<IRndmGen::Param> m_params;
57
59 RndmGen( IInterface* engine );
60
61public:
64 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};
Definition of the basic interface.
Definition IInterface.h:225
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition IRndmEngine.h:25
Interface ID class.
Definition IInterface.h:38
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition RndmGen.h:56
long ID() const override
Random number generator ID.
Definition RndmGen.h:70
RndmGen(IInterface *engine)
Standard Constructor.
Definition RndmGen.cpp:33
StatusCode finalize() override
Finalize the generator.
Definition RndmGen.cpp:41
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition RndmGen.h:54
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
const InterfaceID & type() const override
Random number generator type.
Definition RndmGen.h:68
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition RndmGen.cpp:36
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition RndmGen.h:72
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64