Logo ROOT  
Reference Guide
RooMomentMorphFuncND.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * *
4 * This code was autogenerated by RooClassFactory *
5 *****************************************************************************/
6
7#ifndef ROOMOMENTMORPHFUNCND
8#define ROOMOMENTMORPHFUNCND
9
10#include "RooAbsPdf.h"
11#include "RooRealProxy.h"
12#include "RooCategoryProxy.h"
13#include "RooAbsReal.h"
14#include "RooAbsCategory.h"
15#include "RooSetProxy.h"
16#include "RooListProxy.h"
17#include "RooArgList.h"
18#include "RooBinning.h"
19
20#include "TMatrixD.h"
21#include "TMap.h"
22
23#include <vector>
24#include <map>
25
27
29
30public:
31 class Grid2 {
32 public:
33 Grid2(){};
34 Grid2(const Grid2 &other);
35 Grid2(const RooAbsBinning &binning_x) { _grid.push_back(binning_x.clone()); };
36 Grid2(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y)
37 {
38 _grid.push_back(binning_x.clone());
39 _grid.push_back(binning_y.clone());
40 };
41 Grid2(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y, const RooAbsBinning &binning_z)
42 {
43 _grid.push_back(binning_x.clone());
44 _grid.push_back(binning_y.clone());
45 _grid.push_back(binning_z.clone());
46 };
47 Grid2(const std::vector<RooAbsBinning *> binnings)
48 {
49 for (unsigned int i = 0; i < binnings.size(); i++) {
50 _grid.push_back(binnings[i]->clone());
51 }
52 };
53
54 virtual ~Grid2();
55
56 void addPdf(const RooAbsReal &func, int bin_x);
57 void addPdf(const RooAbsReal &func, int bin_x, int bin_y);
58 void addPdf(const RooAbsReal &func, int bin_x, int bin_y, int bin_z);
59 void addPdf(const RooAbsReal &func, std::vector<int> bins);
60 void addBinning(const RooAbsBinning &binning) { _grid.push_back(binning.clone()); };
61
62 mutable std::vector<RooAbsBinning *> _grid;
64 mutable std::map<std::vector<int>, int> _pdfMap;
65
66 mutable std::vector<std::vector<double>> _nref;
67 mutable std::vector<int> _nnuis;
68
70 };
71
72protected:
74 public:
76 : _sumFunc(&sumFunc), _tracker(&tracker)
77 {
78 _frac.add(flist);
79 };
80 virtual ~CacheElem();
85
86 RooRealVar *frac(int i);
87 const RooRealVar *frac(int i) const;
89 };
90
91public:
93
95 RooMomentMorphFuncND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
96 const RooArgList &pdfList, const RooArgList &mrefList, Setting setting);
97 RooMomentMorphFuncND(const char *name, const char *title, const RooArgList &parList, const RooArgList &obsList,
98 const Grid2 &referenceGrid, const Setting &setting);
99 RooMomentMorphFuncND(const RooMomentMorphFuncND &other, const char *name = 0);
100 RooMomentMorphFuncND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
101 const RooArgList &pdfList, const TVectorD &mrefpoints, Setting setting);
102 virtual ~RooMomentMorphFuncND();
103 virtual TObject *clone(const char *newname) const { return new RooMomentMorphFuncND(*this, newname); }
104
105 void setMode(const Setting &setting) { _setting = setting; }
106 virtual Bool_t selfNormalized() const { return kTRUE; }
109
110 Double_t evaluate() const;
111 virtual Double_t getVal(const RooArgSet *set = 0) const;
112
113protected:
114 void initialize();
115 void initializeParameters(const RooArgList &parList);
116 void initializeObservables(const RooArgList &obsList);
117
118 RooAbsReal *sumFunc(const RooArgSet *nset);
119 CacheElem *getCache(const RooArgSet *nset) const;
120
121 template <typename T>
122 struct Digits {
123 typename std::vector<T>::const_iterator begin;
124 typename std::vector<T>::const_iterator end;
125 typename std::vector<T>::const_iterator me;
126 };
127
128 template <typename T>
129 static void cartesian_product(std::vector<std::vector<T>> &out, std::vector<std::vector<T>> &in);
130 template <typename Iterator>
131 static bool next_combination(const Iterator first, Iterator k, const Iterator last);
132 void findShape(const std::vector<double> &x) const;
133
134 friend class CacheElem;
135 friend class Grid2;
136
137 mutable RooObjCacheManager _cacheMgr; ///<! Transient cache manager
139
142 // RooListProxy _pdfList ;
143 TIterator *_parItr; //! do not persist
147
148 mutable TMatrixD *_M;
149 mutable TMatrixD *_MSqr;
150 mutable std::vector<std::vector<double>> _squareVec;
151 mutable std::vector<int> _squareIdx;
152
155
156 inline int sij(const int &i, const int &j) const { return (i * _obsList.getSize() + j); }
157
159};
160
161#endif
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassDef(name, id)
Definition: Rtypes.h:325
char name[80]
Definition: TGX11.cxx:110
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
Definition: RooAbsBinning.h:26
virtual RooAbsBinning * clone(const char *name=0) const =0
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Int_t getSize() const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
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:35
RooChangeTracker is a meta object that tracks value changes in a given set of RooAbsArgs by registeri...
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
virtual RooArgList containedArgs(Action)
CacheElem(RooAbsReal &sumFunc, RooChangeTracker &tracker, const RooArgList &flist)
void calculateFractions(const RooMomentMorphFuncND &self, Bool_t verbose=kTRUE) const
Grid2(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y)
void addBinning(const RooAbsBinning &binning)
std::vector< RooAbsBinning * > _grid
Grid2(const std::vector< RooAbsBinning * > binnings)
std::map< std::vector< int >, int > _pdfMap
Grid2(const RooAbsBinning &binning_x)
Grid2(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y, const RooAbsBinning &binning_z)
std::vector< std::vector< double > > _nref
void addPdf(const RooAbsReal &func, int bin_x)
RooAbsReal * sumFunc(const RooArgSet *nset)
RooObjCacheManager _cacheMgr
! Transient cache manager
void findShape(const std::vector< double > &x) const
Bool_t setBinIntegrator(RooArgSet &allVars)
void initializeParameters(const RooArgList &parList)
static bool next_combination(const Iterator first, Iterator k, const Iterator last)
CacheElem * getCache(const RooArgSet *nset) const
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
static void cartesian_product(std::vector< std::vector< T > > &out, std::vector< std::vector< T > > &in)
virtual Double_t getVal(const RooArgSet *set=0) const
void useHorizontalMorphing(Bool_t val)
void initializeObservables(const RooArgList &obsList)
virtual Bool_t selfNormalized() const
virtual TObject * clone(const char *newname) const
void setMode(const Setting &setting)
std::vector< std::vector< double > > _squareVec
int sij(const int &i, const int &j) const
TIterator * _obsItr
do not persist
std::vector< int > _squareIdx
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:39
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
Iterator abstract base class.
Definition: TIterator.h:30
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t x[n]
Definition: legend1.C:17
Definition: first.py:1
std::vector< T >::const_iterator end
std::vector< T >::const_iterator me
std::vector< T >::const_iterator begin