RooAbsAnaConvPdf.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooAbsAnaConvPdf.h,v 1.8 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_ABS_ANA_CONV_PDF
00017 #define ROO_ABS_ANA_CONV_PDF
00018 
00019 
00020 class TIterator  ;
00021 #include "RooAbsPdf.h"
00022 #include "RooRealProxy.h"
00023 #include "RooListProxy.h"
00024 #include "RooDataSet.h"
00025 #include "RooAICRegistry.h"
00026 #include "RooObjCacheManager.h"
00027 #include "RooAbsCacheElement.h"
00028 
00029 class RooResolutionModel ;
00030 class RooRealVar ;
00031 class RooAbsGenContext ;
00032 class RooConvGenContext ;
00033 
00034 class RooAbsAnaConvPdf : public RooAbsPdf {
00035 public:
00036 
00037   // Constructors, assignment etc
00038   RooAbsAnaConvPdf() ;
00039   RooAbsAnaConvPdf(const char *name, const char *title, 
00040                    const RooResolutionModel& model, 
00041                    RooRealVar& convVar) ;
00042 
00043   RooAbsAnaConvPdf(const RooAbsAnaConvPdf& other, const char* name=0);
00044   virtual ~RooAbsAnaConvPdf();
00045 
00046   Int_t declareBasis(const char* expression, const RooArgList& params) ;
00047   virtual void printMultiline(ostream& stream, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
00048 
00049   // Coefficient normalization access
00050   inline Double_t getCoefNorm(Int_t coefIdx, const RooArgSet& nset, const char* rangeName) const { 
00051     // Returns normalization integral for coefficient coefIdx for observables nset in range rangeNae
00052     return getCoefNorm(coefIdx,&nset,rangeName) ; 
00053   }
00054   Double_t getCoefNorm(Int_t coefIdx, const RooArgSet* nset=0, const char* rangeName=0) const ;
00055 
00056   // Analytical integration support
00057   virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const ;
00058   virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
00059   
00060   // Coefficient Analytical integration support
00061   virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
00062   virtual Double_t coefAnalyticalIntegral(Int_t coef, Int_t code, const char* rangeName=0) const ;
00063   virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ; 
00064   
00065   virtual Double_t coefficient(Int_t basisIndex) const = 0 ;
00066   virtual RooArgSet* coefVars(Int_t coefIdx) const ;
00067 
00068   virtual Bool_t isDirectGenSafe(const RooAbsArg& arg) const ;
00069     
00070 protected:
00071 
00072   Bool_t _isCopy ;
00073 
00074   virtual Double_t evaluate() const ;
00075 
00076   void makeCoefVarList(RooArgList&) const ;
00077 
00078   friend class RooConvGenContext ;
00079   Bool_t changeModel(const RooResolutionModel& newModel) ;
00080   virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=0, 
00081                                        const RooArgSet* auxProto=0, Bool_t verbose= kFALSE) const ;
00082 
00083   // Following pointers are only used during 
00084   // construction and need not to be proxied
00085   RooResolutionModel* _model   ; //! Original resolution model
00086   RooRealVar* _convVar ;         //! Convolution variable
00087 
00088   RooArgSet* parseIntegrationRequest(const RooArgSet& intSet, Int_t& coefCode, RooArgSet* analVars=0) const ;
00089 
00090   const RooRealVar* convVar() const ;  //  Convolution variable 
00091 
00092   RooListProxy _convSet  ;             //  Set of (resModel (x) basisFunc) convolution objects
00093   RooArgList _basisList ;              //!  List of created basis functions
00094   mutable RooArgSet* _convNormSet ;    //!  Subset of last normalization that applies to convolutions
00095   mutable TIterator* _convSetIter ;    //! Iterator over _convNormSet
00096 
00097 
00098   class CacheElem : public RooAbsCacheElement {
00099   public:
00100     virtual ~CacheElem() {} ;
00101 
00102     RooArgList containedArgs(Action) { 
00103       RooArgList l(_coefVarList) ; 
00104       l.add(_normList) ; 
00105       return l ; 
00106     }
00107 
00108     RooArgList _coefVarList ;
00109     RooArgList _normList ;
00110   } ;
00111   mutable RooObjCacheManager _coefNormMgr ; // Coefficient normalization manager
00112 
00113   mutable RooAICRegistry _codeReg ;   //! Registry of analytical integration codes
00114 
00115   ClassDef(RooAbsAnaConvPdf,1) // Abstract Composite Convoluted PDF
00116 };
00117 
00118 #endif

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