The Gaudi Framework  master (37c0b60a)
IRndmGen.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 #ifndef GAUDIKERNEL_IRNDMGEN_H
12 #define GAUDIKERNEL_IRNDMGEN_H
13 
14 // STL include files
15 #include <string>
16 #include <vector>
17 
18 // Framework include files
19 #include <GaudiKernel/IInterface.h>
20 
21 // Declaration of the interface ID ( interface id, major version, minor version)
22 static const InterfaceID IID_IRndmBit( 150, 1, 0 );
23 static const InterfaceID IID_IRndmFlat( 151, 1, 0 );
24 static const InterfaceID IID_IRndmChi2( 152, 1, 0 );
25 static const InterfaceID IID_IRndmGamma( 153, 1, 0 );
26 static const InterfaceID IID_IRndmGauss( 154, 1, 0 );
27 static const InterfaceID IID_IRndmLandau( 155, 1, 0 );
28 static const InterfaceID IID_IRndmPoisson( 156, 1, 0 );
29 static const InterfaceID IID_IRndmStudentT( 157, 1, 0 );
30 static const InterfaceID IID_IRndmBinomial( 158, 1, 0 );
31 static const InterfaceID IID_IRndmExponential( 159, 1, 0 );
32 static const InterfaceID IID_IRndmBreitWigner( 160, 1, 0 );
33 static const InterfaceID IID_IRndmBreitWignerCutOff( 161, 1, 0 );
34 static const InterfaceID IID_IRndmDefinedPdf( 162, 1, 0 );
35 static const InterfaceID IID_IRndmGaussianTail( 163, 1, 0 );
36 
44 class GAUDI_API IRndmGen : virtual public IInterface {
45 public:
48 
49  class Param {
50  protected:
53 
54  public:
56  Param( const InterfaceID& type = IID_IRndmFlat ) : m_type( type ) {}
58  virtual ~Param() = default;
60  virtual const InterfaceID& type() const { return m_type; }
62  virtual Param* clone() const = 0;
63  };
64 
66  virtual StatusCode initialize( const IRndmGen::Param& par ) = 0;
68  virtual StatusCode finalize() = 0;
70  virtual const InterfaceID& type() const = 0;
72  virtual long ID() const = 0;
74  virtual const IRndmGen::Param* parameters() const = 0;
76  virtual double shoot() const = 0;
83  virtual StatusCode shootArray( std::vector<double>& array, long howmany, long start = 0 ) const = 0;
84 
86  virtual ~IRndmGen() = default;
87 };
88 
89 #endif // GAUDIKERNEL_IRNDMGEN_H
IRndmGen::~IRndmGen
virtual ~IRndmGen()=default
Virtual destructor.
IRndmGen::finalize
virtual StatusCode finalize()=0
Finalize the generator.
std::vector< double >
IRndmGen::Param::Param
Param(const InterfaceID &type=IID_IRndmFlat)
Standard constructor.
Definition: IRndmGen.h:56
IRndmGen::Param::clone
virtual Param * clone() const =0
Clone parameters.
IOTest.start
start
Definition: IOTest.py:110
compareOutputFiles.par
par
Definition: compareOutputFiles.py:477
StatusCode
Definition: StatusCode.h:65
IInterface.h
IRndmGen::Param::m_type
const InterfaceID m_type
Type of the generator.
Definition: IRndmGen.h:52
IRndmGen::Param
Definition: IRndmGen.h:49
IRndmGen::shootArray
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.
IRndmGen::type
virtual const InterfaceID & type() const =0
Random number generator type.
IRndmGen::DeclareInterfaceID
DeclareInterfaceID(IRndmGen, 2, 0)
InterfaceID.
IRndmGen
Definition: IRndmGen.h:44
gaudirun.type
type
Definition: gaudirun.py:160
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:37
IRndmGen::shoot
virtual double shoot() const =0
Single shot returning single random number according to specified distribution.
IInterface
Definition: IInterface.h:239
IRndmGen::parameters
virtual const IRndmGen::Param * parameters() const =0
Access to random number generator parameters.
InterfaceID
Definition: IInterface.h:39
IRndmGen::Param::~Param
virtual ~Param()=default
Standard Destructor.
IRndmGen::ID
virtual long ID() const =0
Random generator ID.
IRndmGen::Param::type
virtual const InterfaceID & type() const
Parameter's type.
Definition: IRndmGen.h:60
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
IRndmGen::initialize
virtual StatusCode initialize(const IRndmGen::Param &par)=0
Initialize the generator.