The Gaudi Framework  master (da3d77e1)
RndmGen.h
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 RndmGen class definition
13 //--------------------------------------------------------------------
14 //
15 // Package : Gaudi/RndmGen ( The LHCb Offline System)
16 // Author : M.Frank
17 //====================================================================
18 #ifndef GAUDI_RANDOMGENSVC_RNDMGEN_H
19 #define GAUDI_RANDOMGENSVC_RNDMGEN_H 1
20 
21 #include <memory>
22 // Framework include files
23 #include <GaudiKernel/IRndmGen.h>
24 #include <GaudiKernel/SmartIF.h>
25 
26 // Forward declarations
27 class IRndmEngine;
28 
51 class RndmGen : public implements<IRndmGen> {
52 
53 protected:
58 
60  RndmGen( IInterface* engine );
61 
62 public:
64  StatusCode initialize( const IRndmGen::Param& par ) override;
67  StatusCode finalize() override;
69  const InterfaceID& type() const override { return ( m_params != 0 ) ? m_params->type() : IID_IRndmFlat; }
71  long ID() const override { return long( this ); }
73  const IRndmGen::Param* parameters() const override { return m_params.get(); }
79  StatusCode shootArray( std::vector<double>& array, long howmany, long start ) const override;
80 };
81 
82 #endif // GAUDI_RANDOMGENSVC_RNDMGEN_H
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:69
std::vector< double >
std::unique_ptr::get
T get(T... args)
IRndmEngine
Definition: IRndmEngine.h:29
IOTest.start
start
Definition: IOTest.py:110
RndmGen::ID
long ID() const override
Random number generator ID.
Definition: RndmGen.h:71
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:73
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:51
StatusCode
Definition: StatusCode.h:65
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:57
IRndmGen::Param
Definition: IRndmGen.h:49
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:37
IInterface
Definition: IInterface.h:239
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:55
InterfaceID
Definition: IInterface.h:39
std::unique_ptr< IRndmGen::Param >
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
IRndmGen::Param::type
virtual const InterfaceID & type() const
Parameter's type.
Definition: IRndmGen.h:60