Logo ROOT  
Reference Guide
RooPoisson.h
Go to the documentation of this file.
1  /*****************************************************************************
2  * Project: RooFit *
3  * *
4  * Simple Poisson PDF
5  * author: Kyle Cranmer <cranmer@cern.ch>
6  * *
7  *****************************************************************************/
8 
9 #ifndef ROOPOISSON
10 #define ROOPOISSON
11 
12 #include "RooAbsPdf.h"
13 #include "RooRealProxy.h"
14 #include "RooCategoryProxy.h"
15 #include "RooAbsReal.h"
16 #include "RooAbsCategory.h"
17 #include "RooTrace.h"
18 
19 class RooPoisson : public RooAbsPdf {
20 public:
22  RooPoisson(const char *name, const char *title, RooAbsReal& _x, RooAbsReal& _mean, Bool_t noRounding=kFALSE);
23  RooPoisson(const RooPoisson& other, const char* name=0) ;
24  virtual TObject* clone(const char* newname) const override { return new RooPoisson(*this,newname); }
25  inline virtual ~RooPoisson() { }
26 
27  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const override;
28  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const override;
29 
30  Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const override;
31  void generateEvent(Int_t code) override;
32 
33  /// Switch off/on rounding of `x` to the nearest integer.
34  void setNoRounding(bool flag = kTRUE) {_noRounding = flag;}
35  /// Switch on or off protection against negative means.
36  void protectNegativeMean(bool flag = kTRUE) {_protectNegative = flag;}
37 
38 protected:
39 
44 
45  Double_t evaluate() const override;
46  RooSpan<double> evaluateSpan(RooBatchCompute::RunContext& evalData, const RooArgSet* normSet) const override;
47 
48  ClassDefOverride(RooPoisson,3) // A Poisson PDF
49 };
50 
51 #endif
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
RooAbsReal.h
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
bool
RooPoisson::getAnalyticalIntegral
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Definition: RooPoisson.cxx:73
RooPoisson::x
RooRealProxy x
Definition: RooPoisson.h:40
RooTrace.h
RooPoisson::_protectNegative
Bool_t _protectNegative
Definition: RooPoisson.h:43
RooPoisson::evaluate
Double_t evaluate() const override
Implementation in terms of the TMath::Poisson() function.
Definition: RooPoisson.cxx:54
RooAbsPdf.h
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
RooPoisson::getGenerator
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const override
Advertise internal generator in x.
Definition: RooPoisson.cxx:144
RooRealProxy.h
RooPoisson
Poisson pdf.
Definition: RooPoisson.h:19
RooPoisson::_noRounding
Bool_t _noRounding
Definition: RooPoisson.h:42
RooCategoryProxy.h
RooPoisson::evaluateSpan
RooSpan< double > evaluateSpan(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet) const override
Compute multiple values of the Poisson distribution.
Definition: RooPoisson.cxx:67
RooPoisson::~RooPoisson
virtual ~RooPoisson()
Definition: RooPoisson.h:25
RooPoisson::clone
virtual TObject * clone(const char *newname) const override
Definition: RooPoisson.h:24
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsCategory.h
RooPoisson::mean
RooRealProxy mean
Definition: RooPoisson.h:41
RooPoisson::generateEvent
void generateEvent(Int_t code) override
Implement internal generator using TRandom::Poisson.
Definition: RooPoisson.cxx:153
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
RooPoisson::RooPoisson
RooPoisson()
Definition: RooPoisson.h:21
name
char name[80]
Definition: TGX11.cxx:110
RooPoisson::protectNegativeMean
void protectNegativeMean(bool flag=kTRUE)
Switch on or off protection against negative means.
Definition: RooPoisson.h:36
RooAbsPdf
Definition: RooAbsPdf.h:41
RooBatchCompute::RunContext
This struct enables passing computation data around between elements of a computation graph.
Definition: RunContext.h:31
RooPoisson::setNoRounding
void setNoRounding(bool flag=kTRUE)
Switch off/on rounding of x to the nearest integer.
Definition: RooPoisson.h:34
RooSpan
A simple container to hold a batch of data values.
Definition: RooSpan.h:34
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
RooPoisson::analyticalIntegral
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Definition: RooPoisson.cxx:82
int