Logo ROOT   6.14/05
Reference Guide
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  *****************************************************************************/
9 #ifndef ROOPOISSON
10 #define ROOPOISSON
12 #include "RooAbsPdf.h"
13 #include "RooRealProxy.h"
14 #include "RooCategoryProxy.h"
15 #include "RooAbsReal.h"
16 #include "RooAbsCategory.h"
17 #include "RooTrace.h"
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 { return new RooPoisson(*this,newname); }
25  inline virtual ~RooPoisson() { }
27  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
28  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
30  Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const;
31  void generateEvent(Int_t code);
33  void setNoRounding(bool flag = kTRUE){_noRounding = flag;}
34  void protectNegativeMean(bool flag = kTRUE){_protectNegative = flag;}
36  Double_t getLogVal(const RooArgSet* set=0) const ;
38 protected:
45  Double_t evaluate() const ;
46  Double_t evaluate(Double_t k) const;
49 private:
51  ClassDef(RooPoisson,3) // A Poisson PDF
52 };
54 #endif
Poisson pdf.
Definition: RooPoisson.h:19
RooRealProxy x
Definition: RooPoisson.h:40
Bool_t _noRounding
Definition: RooPoisson.h:42
void generateEvent(Int_t code)
Implement internal generator using TRandom::Poisson.
Definition: RooPoisson.cxx:212
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported...
Definition: RooPoisson.cxx:119
virtual ~RooPoisson()
Definition: RooPoisson.h:25
RooRealProxy mean
Definition: RooPoisson.h:41
virtual TObject * clone(const char *newname) const
Definition: RooPoisson.h:24
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:320
void protectNegativeMean(bool flag=kTRUE)
Definition: RooPoisson.h:34
Double_t getLogVal(const RooArgSet *set=0) const
calculate and return the negative log-likelihood of the Poisson
Definition: RooPoisson.cxx:73
Double_t evaluate() const
Implementation in terms of the TMath Poisson function.
Definition: RooPoisson.cxx:62
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
Definition: RooPoisson.cxx:128
void setNoRounding(bool flag=kTRUE)
Definition: RooPoisson.h:33
const Bool_t kFALSE
Definition: RtypesCore.h:88
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Mother of all ROOT objects.
Definition: TObject.h:37
Bool_t _protectNegative
Definition: RooPoisson.h:43
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Advertise internal generator in x.
Definition: RooPoisson.cxx:203
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
Definition: RooRealProxy.h:23
const Bool_t kTRUE
Definition: RtypesCore.h:87
char name[80]
Definition: TGX11.cxx:109