ATLAS Offline Software
Loading...
Searching...
No Matches
RandBinomialFixedP.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef RandBinomialFixedP_h
6#define RandBinomialFixedP_h 1
7
8#include <vector>
9
10#include "CLHEP/Random/RandBinomial.h"
11
12namespace CLHEP {
13
18class RandBinomialFixedP : public RandBinomial {
19
20public:
21
22 inline RandBinomialFixedP ( HepRandomEngine& anEngine, long n=1,
23 double p=0.5, long Nmaxlookup=10 );
24 inline RandBinomialFixedP ( HepRandomEngine* anEngine, long n=1,
25 double p=0.5, long Nmaxlookup=10 );
26 // These constructors should be used to instantiate a RandBinomialFixedP
27 // distribution object defining a local engine for it.
28 // The static generator will be skipped using the non-static methods
29 // defined below. Only the non static method run with the fixed p value optimization
30 // If the engine is passed by pointer the corresponding engine object
31 // will be deleted by the RandBinomialFixedP destructor.
32 // If the engine is passed by reference the corresponding engine object
33 // will not be deleted by the RandBinomialFixedP destructor.
34
35 virtual ~RandBinomialFixedP();
36 // Destructor
37
38 // Methods using the localEngine to shoot random values, by-passing
39 // the static generator.
40
41 void initLookupTable(long Nmaxlookup, double p);
42
43 inline double fire();
44
45 double fire( long n);
46
47 double fire( HepRandomEngine* anEngine, long n);
48
49 void fireArray ( const int size, double* vect);
50 void fireArray ( const int size, double* vect,
51 long n);
52 inline double operator()();
53 inline double operator()( long n );
54
55 std::string name() const;
56
57 static std::string distributionName() {return "RandBinomialFixedP";}
58 // Provides the name of this distribution class
59
60 static double shoot() = delete;
61
62 static double shoot( long n, double p ) = delete;
63
64 static void shootArray ( const int size, double* vect, long n=1, double p=0.5 ) = delete;
65
66 static inline double shoot( HepRandomEngine* anEngine ) = delete;
67
68 static double shoot( HepRandomEngine* anEngine, long n, double p ) = delete;
69
70 static void shootArray ( HepRandomEngine* anEngine, const int size, double* vect, long n=1, double p=0.5 ) = delete;
71
72protected:
73
74 std::vector< std::vector< double > > LookupTable;
75
76};
77
78} // namespace CLHEP
79
80#ifdef ENABLE_BACKWARDS_COMPATIBILITY
81// backwards compatibility will be enabled ONLY in CLHEP 1.9
82using namespace CLHEP;
83#endif
84
86
87#endif
static void shootArray(HepRandomEngine *anEngine, const int size, double *vect, long n=1, double p=0.5)=delete
std::vector< std::vector< double > > LookupTable
static std::string distributionName()
RandBinomialFixedP(HepRandomEngine *anEngine, long n=1, double p=0.5, long Nmaxlookup=10)
static double shoot(HepRandomEngine *anEngine, long n, double p)=delete
double operator()(long n)
static void shootArray(const int size, double *vect, long n=1, double p=0.5)=delete
void fireArray(const int size, double *vect)
RandBinomialFixedP(HepRandomEngine &anEngine, long n=1, double p=0.5, long Nmaxlookup=10)
static double shoot(HepRandomEngine *anEngine)=delete
void initLookupTable(long Nmaxlookup, double p)
static double shoot()=delete
static double shoot(long n, double p)=delete