Docs | All | Real | Category | PDF | DataSet | Plot | Container | Misc | Aux | User |
RooProdPdfclass description - source file - inheritance tree (.pdf) class RooProdPdf : public RooAbsPdf
protected: Data Membersprotected: Class DescriptionRooProdPdf is an efficient implementation of a product of PDFs of the form PDF_1 * PDF_2 * ... * PDF_N PDFs may share observables. If that is the case any irreducable subset of PDFS that share observables will be normalized with explicit numeric integration as any built-in normalization will no longer be valid. Alternatively, products using conditional PDFs can be defined, e.g. F(x|y) * G(y) meaning a pdf F(x) _given_ y and a PDF G(y). In this contruction F is only normalized w.r.t x and G is normalized w.r.t y. The product in this construction is properly normalized. If exactly one of the component PDFs supports extended likelihood fits, the product will also be usable in extended mode, returning the number of expected events from the extendable component PDF. The extendable component does not have to appear in any specific place in the list. RooProdPdf(const char *name, const char *title, Double_t cutOff) : RooAbsPdf(name,title), _partListMgr(10), _partOwnedListMgr(10), _genCode(10), _cutOff(cutOff), _pdfList("_pdfList","List of PDFs",this), _extendedIndex(-1), _useDefaultGen(kFALSE) Dummy constructor RooProdPdf(const char *name, const char *title, RooAbsPdf& pdf1, RooAbsPdf& pdf2, Double_t cutOff) : RooAbsPdf(name,title), _partListMgr(10), _partOwnedListMgr(10), _genCode(10), _cutOff(cutOff), _pdfList("_pdfList","List of PDFs",this), _pdfIter(_pdfList.createIterator()), _extendedIndex(-1), _useDefaultGen(kFALSE) Constructor with 2 PDFs (most frequent use case). The optional cutOff parameter can be used as a speed optimization if one or more of the PDF have sizable regions with very small values, which would pull the entire product of PDFs to zero in those regions. After each PDF multiplication, the running product is compared with the cutOff parameter. If the running product is smaller than the cutOff value, the product series is terminated and remaining PDFs are not evaluated. There is no magic value of the cutOff, the user should experiment to find the appropriate balance between speed and precision. If a cutoff is specified, the PDFs most likely to be small should be put first in the product. The default cutOff value is zero. RooProdPdf(const char* name, const char* title, const RooArgList& pdfList, Double_t cutOff) : RooAbsPdf(name,title), _partListMgr(10), _partOwnedListMgr(10), _genCode(10), _cutOff(cutOff), _pdfList("_pdfList","List of PDFs",this), _pdfIter(_pdfList.createIterator()), _extendedIndex(-1), _useDefaultGen(kFALSE) Constructor from a list of PDFs The optional cutOff parameter can be used as a speed optimization if one or more of the PDF have sizable regions with very small values, which would pull the entire product of PDFs to zero in those regions. After each PDF multiplication, the running product is compared with the cutOff parameter. If the running product is smaller than the cutOff value, the product series is terminated and remaining PDFs are not evaluated. There is no magic value of the cutOff, the user should experiment to find the appropriate balance between speed and precision. If a cutoff is specified, the PDFs most likely to be small should be put first in the product. The default cutOff value is zero. RooProdPdf(const char* name, const char* title, const RooArgSet& fullPdfSet, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3, const RooCmdArg& arg4, const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) : RooAbsPdf(name,title), _partListMgr(10), _partOwnedListMgr(10), _genCode(10), _cutOff(0), _pdfList("_pdfList","List of PDFs",this), _pdfIter(_pdfList.createIterator()), _extendedIndex(-1), _useDefaultGen(kFALSE) Constructor from named argument list fullPdf -- Set of 'regular' PDFS that are normalized over all their observables ConditionalPdf(pdfSet,depSet) -- Add PDF to product with condition that it only be normalized over specified observables any remaining observables will be conditional observables For example, given a PDF F(x,y) and G(y) RooProdPdf("P","P",G,Partial(F,x)) will construct a 2-dimensional PDF as follows: P(x,y) = G(y)/Int[y]G(y) * F(x,y)/Int[x]G(x,y) which is a well normalized and properly defined PDF, but different from the P'(x,y) = F(x,y)*G(y) / Int[x,y] F(x,y)*G(y) In the former case the y distribution of P is identical to that of G, while F only is used to determine the correlation between X and Y. In the latter case the Y distribution is defined by the product of F and G. This P(x,y) construction is analoguous to generating events from F(x,y) with a prototype dataset sampled from G(y) RooProdPdf(const char* name, const char* title, const RooArgSet& fullPdfSet, const RooLinkedList& cmdArgList) : RooAbsPdf(name,title), _partListMgr(10), _partOwnedListMgr(10), _genCode(10), _cutOff(0), _pdfList("_pdfList","List of PDFs",this), _pdfIter(_pdfList.createIterator()), _extendedIndex(-1), _useDefaultGen(kFALSE) cout << "RooProdPdf::ctor" << endl ; cmdArgList.Print("v") ; RooProdPdf(const RooProdPdf& other, const char* name) : RooAbsPdf(other,name), _partListMgr(other._partListMgr,kTRUE), _partOwnedListMgr(other._partOwnedListMgr,kTRUE), _genCode(other._genCode), _cutOff(other._cutOff), _pdfList("_pdfList",this,other._pdfList), _pdfIter(_pdfList.createIterator()), _extendedIndex(other._extendedIndex), _useDefaultGen(other._useDefaultGen) Copy constructor void initializeFromCmdArgList(const RooArgSet& fullPdfSet, const RooLinkedList& l) Initialize RooProdPdf from a list of RooCmdArg configuration arguments ~RooProdPdf() Destructor Double_t getVal(const RooArgSet* set) const Double_t evaluate() const Calculate current unnormalized value of object Double_t calculate(const RooArgList* partIntList, const RooLinkedList* normSetList) const Calculate running product of pdfs, skipping factorized components void factorizeProduct(const RooArgSet& normSet, const RooArgSet& intSet, RooLinkedList& termList, RooLinkedList& normList, RooLinkedList& impDepList, RooLinkedList& crossDepList, RooLinkedList& intList) const Factorize product in irreducible terms for given choice of integration/normalization void getPartIntList(const RooArgSet* nset, const RooArgSet* iset, pRooArgList& partList, pRooLinkedList& nsetList, Int_t& code, const char* isetRangeName) const Check if this configuration was created before void groupProductTerms(RooLinkedList& groupedTerms, RooArgSet& outerIntDeps, const RooLinkedList& terms, const RooLinkedList& norms, const RooLinkedList& imps, const RooLinkedList& ints, const RooLinkedList& /*cross*/) const Start out with each term in its own group RooAbsReal* processProductTerm(const RooArgSet* nset, const RooArgSet* iset, const char* isetRangeName, const RooArgSet* term,const RooArgSet& termNSet, const RooArgSet& termISet, Bool_t& isOwned, Bool_t forceWrap) const CASE I: factorizing term: term is integrated over all normalizing observables ----------------------------------------------------------------------------- Check if all observbales of this term are integrated. If so the term cancels const char* makeRGPPName(const char* pfx, const RooArgSet& term, const RooArgSet& iset, const RooArgSet& nset, const char* isetRangeName) const Make an appropriate name for a RooGenProdProj object in getPartIntList() Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName) const Determine which part (if any) of given integral can be performed analytically. If any analytical integration is possible, return integration scenario code. RooProdPdf implements two strategies in implementing analytical integrals First, PDF components whose entire set of dependents are requested to be integrated can be dropped from the product, as they will integrate out to 1 by construction : Second, RooProdPdf queries each remaining component PDF for its analytical integration capability of the requested set ('allVars'). It finds the largest common set of variables that can be integrated by all remaining components. If such a set exists, it reconfirms that each component is capable of analytically integrating the common set, and combines the components individual integration codes into a single integration code valid for RooProdPdf. Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName) const Return analytical integral defined by given scenario code Bool_t checkObservables(const RooArgSet* /*nset*/) const Check that none of the PDFs have overlapping dependents RooAbsPdf::ExtendMode extendMode() const Double_t expectedEvents(const RooArgSet* nset) const RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype, const RooArgSet* auxProto, Bool_t verbose) const Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK) const void initGenerator(Int_t code) void generateEvent(Int_t code) void operModeHook() void clearCache() cout << "RooProdPdf::clearCache(" << GetName() << ") sterilizing cache content" << endl ; Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) Throw away cache, as figuring out redirections on the cache is an unsolvable problem. void printCompactTreeHook(ostream& os, const char* indent) Bool_t isDirectGenSafe(const RooAbsArg& arg) const Only override base class behaviour if default generator method is enabled RooArgSet* findPdfNSet(RooAbsPdf& pdf) const Look up user specified normalization set for given input PDF component Inline FunctionsTObject* clone(const char* newname) const Bool_t selfNormalized() const Double_t expectedEvents(const RooArgSet& nset) const const RooArgList& pdfList() const void useDefaultGen(Bool_t flag = kTRUE) TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)
|
Page maintained by Wouter Verkerke and David Kirkby |