RooRealSumPdf.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooRealSumPdf.h,v 1.10 2007/05/11 09:11:30 verkerke 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_REAL_SUM_PDF
00017 #define ROO_REAL_SUM_PDF
00018 
00019 #include "RooAbsPdf.h"
00020 #include "RooListProxy.h"
00021 #include "RooAICRegistry.h"
00022 #include "RooObjCacheManager.h"
00023 
00024 class RooRealSumPdf : public RooAbsPdf {
00025 public:
00026 
00027   RooRealSumPdf() ;
00028   RooRealSumPdf(const char *name, const char *title);
00029   RooRealSumPdf(const char *name, const char *title, const RooArgList& funcList, const RooArgList& coefList, Bool_t extended=kFALSE) ;
00030   RooRealSumPdf(const char *name, const char *title,
00031                    RooAbsReal& func1, RooAbsReal& func2, RooAbsReal& coef1) ;
00032   RooRealSumPdf(const RooRealSumPdf& other, const char* name=0) ;
00033   virtual TObject* clone(const char* newname) const { return new RooRealSumPdf(*this,newname) ; }
00034   virtual ~RooRealSumPdf() ;
00035 
00036   Double_t evaluate() const ;
00037   virtual Bool_t checkObservables(const RooArgSet* nset) const ;        
00038 
00039   virtual Bool_t forceAnalyticalInt(const RooAbsArg&) const { return kTRUE ; }
00040   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
00041   Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
00042 
00043   const RooArgList& funcList() const { return _funcList ; }
00044   const RooArgList& coefList() const { return _coefList ; }
00045 
00046   virtual ExtendMode extendMode() const ; 
00047 
00048   virtual Double_t expectedEvents(const RooArgSet* nset) const ;
00049   virtual Double_t expectedEvents(const RooArgSet& nset) const { 
00050     // Return expected number of events for extended likelihood calculation
00051     // which is the sum of all coefficients
00052     return expectedEvents(&nset) ; 
00053   }
00054 
00055   void printMetaArgs(ostream& os) const ;
00056 
00057 protected:
00058   
00059   class CacheElem : public RooAbsCacheElement {
00060   public:
00061     CacheElem()  {} ;
00062     virtual ~CacheElem() {} ; 
00063     virtual RooArgList containedArgs(Action) { RooArgList ret(_funcIntList) ; ret.add(_funcNormList) ; return ret ; }
00064     RooArgList _funcIntList ;
00065     RooArgList _funcNormList ;
00066   } ;
00067   mutable RooObjCacheManager _normIntMgr ; // The integration cache manager
00068 
00069   Bool_t _haveLastCoef ;
00070 
00071   RooListProxy _funcList ;   //  List of component FUNCs
00072   RooListProxy _coefList ;  //  List of coefficients
00073   TIterator* _funcIter ;     //! Iterator over FUNC list
00074   TIterator* _coefIter ;    //! Iterator over coefficient list
00075   Bool_t _extended ;        // Allow use as extended p.d.f.
00076   
00077 private:
00078 
00079   ClassDef(RooRealSumPdf,2) // PDF constructed from a sum of (non-pdf) functions
00080 };
00081 
00082 #endif

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