Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooMultiReal.h
Go to the documentation of this file.
1#ifndef ROO_MULTIREAL
2#define ROO_MULTIREAL
3
4#include "RooAbsReal.h"
5#include "RooCategory.h"
6#include "RooCategoryProxy.h"
7#include "RooListProxy.h"
8
9class RooMultiReal : public RooAbsReal {
10public:
11 RooMultiReal() = default;
12 RooMultiReal(const char *name, const char *title, RooCategory &indexCat, const RooArgList &models);
13 RooMultiReal(const RooMultiReal &other, const char *name = nullptr);
14 virtual ~RooMultiReal() {}
15
16 TObject *clone(const char *newname) const override { return new RooMultiReal(*this, newname); }
17
18 inline int getCurrentIndex() const { return static_cast<int>(_index); }
19 inline RooAbsReal *getCurrentReal() const { return static_cast<RooAbsReal *>(_models.at(getCurrentIndex())); }
20 inline int getNumModels() const { return _models.getSize(); }
21 inline const RooCategoryProxy &indexCategory() const { return _index; }
22 inline const RooListProxy &getModelList() const { return _models; }
23
24 void getParametersHook(const RooArgSet *nset, RooArgSet *list, bool stripDisconnected) const override;
25
26protected:
27 RooListProxy _models; // list of RooAbsReal models
28 RooCategoryProxy _index; // index category proxy
29
30 Double_t evaluate() const override;
31
32private:
34};
35
36#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:110
Int_t getSize() const
Return the number of elements in the collection.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
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
RooCategoryProxy _index
RooAbsReal * getCurrentReal() const
int getNumModels() const
virtual ~RooMultiReal()
const RooListProxy & getModelList() const
RooMultiReal()=default
TObject * clone(const char *newname) const override
void getParametersHook(const RooArgSet *nset, RooArgSet *list, bool stripDisconnected) const override
RooListProxy _models
Double_t evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
int getCurrentIndex() const
const RooCategoryProxy & indexCategory() const
Mother of all ROOT objects.
Definition TObject.h:41