Logo ROOT  
Reference Guide
RooProjectedPdf.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * *
4 * Copyright (c) 2000-2005, Regents of the University of California *
5 * and Stanford University. All rights reserved. *
6 * *
7 * Redistribution and use in source and binary forms, *
8 * with or without modification, are permitted according to the terms *
9 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
10 *****************************************************************************/
11
12#ifndef ROOPROJECTEDPDF
13#define ROOPROJECTEDPDF
14
15#include "RooAbsPdf.h"
16#include "RooRealProxy.h"
17#include "RooAbsReal.h"
18#include "RooObjCacheManager.h"
19#include "RooSetProxy.h"
20
21class RooProjectedPdf : public RooAbsPdf {
22public:
23
25 RooProjectedPdf(const char *name, const char *title, RooAbsReal& _intpdf, const RooArgSet& intObs);
26 RooProjectedPdf(const RooProjectedPdf& other, const char* name=0) ;
27 TObject* clone(const char* newname) const override { return new RooProjectedPdf(*this,newname); }
28 inline ~RooProjectedPdf() override { }
29
30 // Analytical integration support
31 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const override ;
32 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const override ;
33 bool forceAnalyticalInt(const RooAbsArg& dep) const override ;
34
35 Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, bool staticInitOK=true) const override;
36 void initGenerator(Int_t /*code*/) override {} ; // optional pre-generation initialization
37 void generateEvent(Int_t code) override;
38
39 bool selfNormalized() const override { return true ; }
40
41 // Handle projection of projection explicitly
42 RooAbsPdf* createProjection(const RooArgSet& iset) override ;
43
44 void printMetaArgs(std::ostream& os) const override ;
45
46
47protected:
48
49 RooRealProxy intpdf ; ///< p.d.f that is integrated
50 RooSetProxy intobs ; ///< observables that p.d.f is integrated over
51 RooSetProxy deps ; ///< dependents of this p.d.f
52
54 public:
55 ~CacheElem() override { delete _projection ; } ;
56 // Payload
58 // Cache management functions
60 void printCompactTreeHook(std::ostream&, const char *, Int_t, Int_t) override ;
61 } ;
62 mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
63
64 bool redirectServersHook(const RooAbsCollection& newServerList, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
65
66 const RooAbsReal* getProjection(const RooArgSet* iset, const RooArgSet* nset, const char* rangeName, int& code) const ;
67 double evaluate() const override ;
68
69private:
70
71 ClassDefOverride(RooProjectedPdf,1) // Operator p.d.f calculating projection of another p.d.f
72};
73
74#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
char name[80]
Definition: TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:64
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooArgList containedArgs(Action) override
Return RooAbsArg elements contained in projection cache element.
void printCompactTreeHook(std::ostream &, const char *, Int_t, Int_t) override
Print contents of cache when printing self as part of object tree.
Class RooProjectedPdf is a RooAbsPdf implementation that represent a projection of a given input p....
~RooProjectedPdf() override
RooRealProxy intpdf
p.d.f that is integrated
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const override
Return analytical integral represent by appropriate element of projection cache.
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
RooObjCacheManager _cacheMgr
! The cache manager
TObject * clone(const char *newname) const override
double evaluate() const override
Evaluate projected p.d.f.
bool forceAnalyticalInt(const RooAbsArg &dep) const override
Force RooRealIntegral to relegate integration of all observables to internal logic.
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const override
Mark all requested variables as internally integrated.
bool redirectServersHook(const RooAbsCollection &newServerList, bool, bool, bool) override
Intercept a server redirection all and update list of dependents if necessary Specifically update the...
void generateEvent(Int_t code) override
No internal generator is implemented.
RooAbsPdf * createProjection(const RooArgSet &iset) override
Special version of RooAbsReal::createProjection that deals with projections of projections.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
No internal generator is implemented.
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooRealIntegral to more intuitively reflect the contents of the...
RooProjectedPdf()
Default constructor.
void initGenerator(Int_t) override
Interface for one-time initialization to setup the generator for the specified code.
const RooAbsReal * getProjection(const RooArgSet *iset, const RooArgSet *nset, const char *rangeName, int &code) const
Retrieve object representing projection integral of input p.d.f over observables iset,...
RooSetProxy intobs
observables that p.d.f is integrated over
RooSetProxy deps
dependents of this p.d.f
Mother of all ROOT objects.
Definition: TObject.h:37