The Gaudi Framework  v33r0 (d5ea422b)
RndmGen.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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
Base class used to implement the interfaces.
Definition: implements.h:19
virtual const InterfaceID & type() const
Parameter's type.
Definition: IRndmGen.h:60
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:33
long ID() const override
Random number generator ID.
Definition: RndmGen.h:71
def start
Definition: IOTest.py:108
Interface ID class.
Definition: IInterface.h:39
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:57
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition: RndmGen.h:73
Definition of the basic interface.
Definition: IInterface.h:254
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:36
Random Generator definition.
Definition: RndmGen.h:51
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:41
T get(T... args)
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
const InterfaceID & type() const override
Random number generator type.
Definition: RndmGen.h:69
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
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:55
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition: IRndmEngine.h:29