Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooMultiPdf.h
Go to the documentation of this file.
1#ifndef ROO_MULTIPDF
2#define ROO_MULTIPDF
3
4#include "RooAbsPdf.h"
5#include "RooCategory.h"
6#include "RooCategoryProxy.h"
7#include "RooListProxy.h"
8
9class RooMultiPdf : public RooAbsPdf {
10public:
16 RooMultiPdf(const char *name, const char *title, RooCategory &, const RooArgList &_c);
17 RooMultiPdf(const RooMultiPdf &other, const char *name = nullptr);
18 TObject *clone(const char *newname) const override { return new RooMultiPdf(*this, newname); }
19
20 inline bool checkIndexDirty() const { return _oldIndex != x; }
21 inline double getCorrection() const override { return cFactor * static_cast<RooAbsReal *>(corr.at(x))->getVal(); }
22 inline RooAbsPdf *getCurrentPdf() const { return getPdf(getCurrentIndex()); }
23 int getNumPdfs() const { return c.size(); }
24
25 inline const RooCategoryProxy &indexCategory() const { return x; }
26 inline const RooListProxy &getPdfList() const { return c; }
27
30 inline int getCurrentIndex() const { return static_cast<int>(x); }
31 inline RooAbsPdf *getPdf(int index) const { return static_cast<RooAbsPdf *>(c.at(index)); }
32 // Always normalized because each pdf is normalized
33 bool selfNormalized() const override { return true; }
34
35 void getParametersHook(const RooArgSet *nset, RooArgSet *list, bool stripDisconnected) const override;
36
37protected:
41
42 int fIndex; // sigh, there should be a better way than this
43 int nPdfs; // not used, kept so we didn't have to change the class layout for IO
45
46 Double_t evaluate() const override;
47 Double_t getLogVal(const RooArgSet *set = nullptr) const override;
48 double cFactor = 0.5; // correction to 2*NLL by default is -> 2*0.5 per param
49
50private:
52};
53#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char name[80]
Definition TGX11.cxx:110
Storage_t::size_type size() const
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:32
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:107
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition RooArgList.h:110
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Object to represent discrete states.
Definition RooCategory.h:28
The class RooMultiPdf allows for the creation of a RooMultiPdf object, which can switch between previ...
Definition RooMultiPdf.h:9
RooCategoryProxy x
Definition RooMultiPdf.h:40
void setCorrectionFactor(PenaltyScheme penal)
Definition RooMultiPdf.h:28
RooListProxy c
Definition RooMultiPdf.h:38
void getParametersHook(const RooArgSet *nset, RooArgSet *list, bool stripDisconnected) const override
RooAbsPdf * getCurrentPdf() const
Definition RooMultiPdf.h:22
RooListProxy corr
Definition RooMultiPdf.h:39
Double_t evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
bool checkIndexDirty() const
Definition RooMultiPdf.h:20
const RooCategoryProxy & indexCategory() const
Definition RooMultiPdf.h:25
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
Definition RooMultiPdf.h:33
double getCorrection() const override
This function returns the penalty term.
Definition RooMultiPdf.h:21
RooAbsPdf * getPdf(int index) const
Definition RooMultiPdf.h:31
int getNumPdfs() const
Definition RooMultiPdf.h:23
TObject * clone(const char *newname) const override
Definition RooMultiPdf.h:18
Double_t getLogVal(const RooArgSet *set=nullptr) const override
Return the log of the current value with given normalization An error message is printed if the argum...
int getCurrentIndex() const
Definition RooMultiPdf.h:30
double cFactor
Definition RooMultiPdf.h:48
Int_t _oldIndex
Definition RooMultiPdf.h:44
void setCorrectionFactor(double penal)
Definition RooMultiPdf.h:29
const RooListProxy & getPdfList() const
Definition RooMultiPdf.h:26
Mother of all ROOT objects.
Definition TObject.h:41