ATLAS Offline Software
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 
12 namespace CLHEP {
13 
18 class RandBinomialFixedP : public RandBinomial {
19 
20 public:
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 
72 protected:
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
82 using namespace CLHEP;
83 #endif
84 
85 #include "RandBinomialFixedP.icc"
86 
87 #endif
CLHEP::RandBinomialFixedP::shootArray
static void shootArray(HepRandomEngine *anEngine, const int size, double *vect, long n=1, double p=0.5)=delete
RandBinomialFixedP.icc
CLHEP::RandBinomialFixedP::LookupTable
std::vector< std::vector< double > > LookupTable
Definition: RandBinomialFixedP.h:74
CLHEP::RandBinomialFixedP::fire
double fire(long n)
CLHEP::RandBinomialFixedP::~RandBinomialFixedP
virtual ~RandBinomialFixedP()
Definition: RandBinomialFixedP.cxx:16
CLHEP::RandBinomialFixedP::initLookupTable
void initLookupTable(long Nmaxlookup, double p)
Definition: RandBinomialFixedP.cxx:23
CLHEP::RandBinomialFixedP::distributionName
static std::string distributionName()
Definition: RandBinomialFixedP.h:57
CLHEP::RandBinomialFixedP::shootArray
static void shootArray(const int size, double *vect, long n=1, double p=0.5)=delete
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
CLHEP::RandBinomialFixedP::operator()
double operator()()
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CLHEP::RandBinomialFixedP::fire
double fire()
beamspotman.n
n
Definition: beamspotman.py:731
CLHEP::RandBinomialFixedP::RandBinomialFixedP
RandBinomialFixedP(HepRandomEngine *anEngine, long n=1, double p=0.5, long Nmaxlookup=10)
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
CLHEP::RandBinomialFixedP::shoot
static double shoot(long n, double p)=delete
CLHEP::RandBinomialFixedP
Definition: RandBinomialFixedP.h:18
CLHEP::RandBinomialFixedP::operator()
double operator()(long n)
CLHEP::RandBinomialFixedP::shoot
static double shoot(HepRandomEngine *anEngine)=delete
CLHEP::RandBinomialFixedP::shoot
static double shoot(HepRandomEngine *anEngine, long n, double p)=delete
CLHEP::RandBinomialFixedP::RandBinomialFixedP
RandBinomialFixedP(HepRandomEngine &anEngine, long n=1, double p=0.5, long Nmaxlookup=10)
CLHEP::RandBinomialFixedP::fireArray
void fireArray(const int size, double *vect)
Definition: RandBinomialFixedP.cxx:55
CLHEP::RandBinomialFixedP::name
std::string name() const
Definition: RandBinomialFixedP.cxx:14
CLHEP::RandBinomialFixedP::shoot
static double shoot()=delete