RooExtendPdf.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooExtendPdf.h,v 1.12 2007/07/16 21:04:28 wouter Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_EXTEND_PDF
00017 #define ROO_EXTEND_PDF
00018 
00019 #include "RooAbsPdf.h"
00020 #include "RooRealProxy.h"
00021 
00022 class RooExtendPdf : public RooAbsPdf {
00023 public:
00024 
00025   RooExtendPdf() ;
00026   RooExtendPdf(const char *name, const char *title, const RooAbsPdf& pdf, 
00027                const RooAbsReal& norm, const char* rangeName=0) ;
00028   RooExtendPdf(const RooExtendPdf& other, const char* name=0) ;
00029   virtual TObject* clone(const char* newname) const { return new RooExtendPdf(*this,newname) ; }
00030   virtual ~RooExtendPdf() ;
00031 
00032   Double_t evaluate() const { return _pdf ; }
00033 
00034   Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const { return kTRUE ; }
00035   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const {
00036     // Forward determination of analytical integration capabilities to input p.d.f
00037     return ((RooAbsPdf&)_pdf.arg()).getAnalyticalIntegralWN(allVars, analVars, normSet, rangeName) ;
00038   }
00039   Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const {
00040     // Forward calculation of analytical integrals to input p.d.f
00041     return ((RooAbsPdf&)_pdf.arg()).analyticalIntegralWN(code, normSet, rangeName) ;
00042   }
00043   
00044   virtual Bool_t selfNormalized() const { return kTRUE ; }
00045   virtual ExtendMode extendMode() const { return CanBeExtended ; }
00046   virtual Double_t expectedEvents(const RooArgSet* nset) const ;
00047   virtual Double_t expectedEvents(const RooArgSet& nset) const { return expectedEvents(&nset) ; }
00048 
00049 protected:
00050 
00051   RooRealProxy _pdf ;        // Input p.d.f
00052   RooRealProxy _n ;          // Number of expected events
00053   const TNamed* _rangeName ; // Name of subset range
00054 
00055 
00056   ClassDef(RooExtendPdf,1) // Wrapper p.d.f adding an extended likelihood term to an existing p.d.f
00057 };
00058 
00059 #endif

Generated on Tue Jul 5 14:26:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1