RooSimultaneous.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooSimultaneous.h,v 1.42 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_SIMULTANEOUS
00017 #define ROO_SIMULTANEOUS
00018 
00019 //#include "THashList.h"
00020 #include "TList.h"
00021 #include "RooAbsPdf.h"
00022 #include "RooCategoryProxy.h"
00023 #include "RooRealProxy.h"
00024 #include "RooSetProxy.h"
00025 #include "RooAICRegistry.h"
00026 #include "RooObjCacheManager.h"
00027 #include "RooAbsCacheElement.h"
00028 #include "RooArgList.h"
00029 #include <map>
00030 #include <string>
00031 class RooAbsCategoryLValue ;
00032 class RooFitResult ;
00033 class RooPlot ;
00034 class RooAbsData ;
00035 class RooLinkedList ;
00036 
00037 class RooSimultaneous : public RooAbsPdf {
00038 public:
00039 
00040   // Constructors, assignment etc
00041   inline RooSimultaneous() : _plotCoefNormRange(0) { }
00042   RooSimultaneous(const char *name, const char *title, RooAbsCategoryLValue& indexCat) ;
00043   RooSimultaneous(const char *name, const char *title, std::map<std::string,RooAbsPdf*> pdfMap, RooAbsCategoryLValue& inIndexCat) ;
00044   RooSimultaneous(const char *name, const char *title, const RooArgList& pdfList, RooAbsCategoryLValue& indexCat) ;
00045   RooSimultaneous(const RooSimultaneous& other, const char* name=0);
00046   virtual TObject* clone(const char* newname) const { return new RooSimultaneous(*this,newname) ; }
00047   virtual ~RooSimultaneous() ;
00048 
00049   virtual Double_t evaluate() const ;
00050   virtual Bool_t selfNormalized() const { return kTRUE ; }
00051   Bool_t addPdf(const RooAbsPdf& pdf, const char* catLabel) ;
00052 
00053   virtual ExtendMode extendMode() const ;
00054 
00055   virtual Double_t expectedEvents(const RooArgSet* nset) const ;
00056   virtual Double_t expectedEvents(const RooArgSet& nset) const { return expectedEvents(&nset) ; }
00057 
00058   virtual Bool_t forceAnalyticalInt(const RooAbsArg&) const { return kTRUE ; }
00059   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
00060   Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
00061 
00062   using RooAbsPdf::plotOn ;
00063   virtual RooPlot* plotOn(RooPlot* frame, 
00064                           const RooCmdArg& arg1            , const RooCmdArg& arg2=RooCmdArg(),
00065                           const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(),
00066                           const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(),
00067                           const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(),
00068                           const RooCmdArg& arg9=RooCmdArg(), const RooCmdArg& arg10=RooCmdArg()) const {
00069     return RooAbsReal::plotOn(frame,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) ;
00070   }
00071 
00072   // Backward compatibility function
00073   virtual RooPlot *plotOn(RooPlot *frame, Option_t* drawOptions, Double_t scaleFactor=1.0, 
00074                           ScaleType stype=Relative, const RooAbsData* projData=0, const RooArgSet* projSet=0,
00075                           Double_t precision=1e-3, Bool_t shiftToZero=kFALSE, const RooArgSet* projDataSet=0,
00076                           Double_t rangeLo=0, Double_t rangeHi=0, RooCurve::WingMode wmode=RooCurve::Extended) const;
00077   
00078   RooAbsPdf* getPdf(const char* catName) const ;
00079   const RooAbsCategoryLValue& indexCat() const { return (RooAbsCategoryLValue&) _indexCat.arg() ; }
00080   
00081 protected:
00082 
00083   void initialize(RooAbsCategoryLValue& inIndexCat, std::map<std::string,RooAbsPdf*> pdfMap) ;
00084   virtual RooPlot* plotOn(RooPlot* frame, RooLinkedList& cmdList) const ;
00085 
00086   virtual void selectNormalization(const RooArgSet* depSet=0, Bool_t force=kFALSE) ;
00087   virtual void selectNormalizationRange(const char* rangeName=0, Bool_t force=kFALSE) ;
00088   mutable RooSetProxy _plotCoefNormSet ;
00089   const TNamed* _plotCoefNormRange ;
00090 
00091   class CacheElem : public RooAbsCacheElement {
00092   public:
00093     virtual ~CacheElem() {} ;
00094     RooArgList containedArgs(Action) { return RooArgList(_partIntList) ; }
00095     RooArgList _partIntList ;
00096   } ;
00097   mutable RooObjCacheManager _partIntMgr ; // Component normalization manager
00098 
00099 
00100   friend class RooSimGenContext ;
00101   virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=0, 
00102                                        const RooArgSet* auxProto=0, Bool_t verbose= kFALSE) const ;
00103  
00104   RooCategoryProxy _indexCat ; // Index category
00105   TList    _pdfProxyList ;     // List of PDF proxies (named after applicable category state)
00106   Int_t    _numPdf ;           // Number of registered PDFs
00107 
00108   ClassDef(RooSimultaneous,2)  // Simultaneous operator p.d.f, functions like C++  'switch()' on input p.d.fs operating on index category5A
00109 };
00110 
00111 #endif

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