ROOT logo
 /***************************************************************************** 
  * Project: RooFit                                                           * 
  *                                                                           * 
  * Simple Poisson PDF
  * author: Kyle Cranmer <cranmer@cern.ch>
  *                                                                           * 
  *****************************************************************************/ 

#ifndef ROOPOISSON
#define ROOPOISSON

#include "RooAbsPdf.h"
#include "RooRealProxy.h"
#include "RooCategoryProxy.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include "RooTrace.h"
 
class RooPoisson : public RooAbsPdf {
public:
  RooPoisson() { _noRounding = kFALSE ;  TRACE_CREATE } ;
  RooPoisson(const char *name, const char *title, RooAbsReal& _x, RooAbsReal& _mean, Bool_t noRounding=kFALSE);
  RooPoisson(const RooPoisson& other, const char* name=0) ;
  virtual TObject* clone(const char* newname) const { return new RooPoisson(*this,newname); }
  inline virtual ~RooPoisson() { TRACE_DESTROY }

  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;

  Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const;
  void generateEvent(Int_t code);
  
  void setNoRounding(bool flag = kTRUE){_noRounding = flag;}
  void protectNegativeMean(bool flag = kTRUE){_protectNegative = flag;}

  Double_t getLogVal(const RooArgSet* set=0) const ;

protected:

  RooRealProxy x ;
  RooRealProxy mean ;
  Bool_t  _noRounding ;
  Bool_t  _protectNegative ;
  
  Double_t evaluate() const ;
  Double_t evaluate(Double_t k) const;
  

private:

  ClassDef(RooPoisson,3) // A Poisson PDF
};
 
#endif
 RooPoisson.h:1
 RooPoisson.h:2
 RooPoisson.h:3
 RooPoisson.h:4
 RooPoisson.h:5
 RooPoisson.h:6
 RooPoisson.h:7
 RooPoisson.h:8
 RooPoisson.h:9
 RooPoisson.h:10
 RooPoisson.h:11
 RooPoisson.h:12
 RooPoisson.h:13
 RooPoisson.h:14
 RooPoisson.h:15
 RooPoisson.h:16
 RooPoisson.h:17
 RooPoisson.h:18
 RooPoisson.h:19
 RooPoisson.h:20
 RooPoisson.h:21
 RooPoisson.h:22
 RooPoisson.h:23
 RooPoisson.h:24
 RooPoisson.h:25
 RooPoisson.h:26
 RooPoisson.h:27
 RooPoisson.h:28
 RooPoisson.h:29
 RooPoisson.h:30
 RooPoisson.h:31
 RooPoisson.h:32
 RooPoisson.h:33
 RooPoisson.h:34
 RooPoisson.h:35
 RooPoisson.h:36
 RooPoisson.h:37
 RooPoisson.h:38
 RooPoisson.h:39
 RooPoisson.h:40
 RooPoisson.h:41
 RooPoisson.h:42
 RooPoisson.h:43
 RooPoisson.h:44
 RooPoisson.h:45
 RooPoisson.h:46
 RooPoisson.h:47
 RooPoisson.h:48
 RooPoisson.h:49
 RooPoisson.h:50
 RooPoisson.h:51
 RooPoisson.h:52
 RooPoisson.h:53
 RooPoisson.h:54