The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
IRndmGen.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#pragma once
12
14#include <string>
15#include <vector>
16
17// Declaration of the interface ID ( interface id, major version, minor version)
18static const InterfaceID IID_IRndmBit( 150, 1, 0 );
19static const InterfaceID IID_IRndmFlat( 151, 1, 0 );
20static const InterfaceID IID_IRndmChi2( 152, 1, 0 );
21static const InterfaceID IID_IRndmGamma( 153, 1, 0 );
22static const InterfaceID IID_IRndmGauss( 154, 1, 0 );
23static const InterfaceID IID_IRndmLandau( 155, 1, 0 );
24static const InterfaceID IID_IRndmPoisson( 156, 1, 0 );
25static const InterfaceID IID_IRndmStudentT( 157, 1, 0 );
26static const InterfaceID IID_IRndmBinomial( 158, 1, 0 );
27static const InterfaceID IID_IRndmExponential( 159, 1, 0 );
28static const InterfaceID IID_IRndmBreitWigner( 160, 1, 0 );
29static const InterfaceID IID_IRndmBreitWignerCutOff( 161, 1, 0 );
30static const InterfaceID IID_IRndmDefinedPdf( 162, 1, 0 );
31static const InterfaceID IID_IRndmGaussianTail( 163, 1, 0 );
32
40class GAUDI_API IRndmGen : virtual public IInterface {
41public:
44
45 class Param {
46 protected:
49
50 public:
52 Param( const InterfaceID& type = IID_IRndmFlat ) : m_type( type ) {}
54 virtual ~Param() = default;
56 virtual const InterfaceID& type() const { return m_type; }
58 virtual Param* clone() const = 0;
59 };
60
62 virtual StatusCode initialize( const IRndmGen::Param& par ) = 0;
64 virtual StatusCode finalize() = 0;
66 virtual const InterfaceID& type() const = 0;
68 virtual long ID() const = 0;
70 virtual const IRndmGen::Param* parameters() const = 0;
72 virtual double shoot() const = 0;
79 virtual StatusCode shootArray( std::vector<double>& array, long howmany, long start = 0 ) const = 0;
80
82 virtual ~IRndmGen() = default;
83};
#define GAUDI_API
Definition Kernel.h:49
Definition of the basic interface.
Definition IInterface.h:225
virtual ~Param()=default
Standard Destructor.
virtual Param * clone() const =0
Clone parameters.
Param(const InterfaceID &type=IID_IRndmFlat)
Standard constructor.
Definition IRndmGen.h:52
virtual const InterfaceID & type() const
Parameter's type.
Definition IRndmGen.h:56
const InterfaceID m_type
Type of the generator.
Definition IRndmGen.h:48
Definition of a interface for a generic random number generators.
Definition IRndmGen.h:40
virtual ~IRndmGen()=default
Virtual destructor.
virtual StatusCode finalize()=0
Finalize the generator.
virtual StatusCode shootArray(std::vector< double > &array, long howmany, long start=0) const =0
Multiple shots returning vector with random number according to specified distribution.
virtual double shoot() const =0
Single shot returning single random number according to specified distribution.
virtual long ID() const =0
Random generator ID.
DeclareInterfaceID(IRndmGen, 2, 0)
InterfaceID.
virtual StatusCode initialize(const IRndmGen::Param &par)=0
Initialize the generator.
virtual const InterfaceID & type() const =0
Random number generator type.
virtual const IRndmGen::Param * parameters() const =0
Access to random number generator parameters.
Interface ID class.
Definition IInterface.h:38
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64