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 };
81 virtual ~CacheElem();
86
87 RooRealVar *frac(int i);
88 const RooRealVar *frac(int i) const;
90 };
91
92public:
94
96 RooMomentMorphFuncND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
97 const RooArgList &pdfList, const RooArgList &mrefList, Setting setting);
98 RooMomentMorphFuncND(const char *name, const char *title, const RooArgList &parList, const RooArgList &obsList,
99 const Grid2 &referenceGrid, const Setting &setting);
100 RooMomentMorphFuncND(const RooMomentMorphFuncND &other, const char *name = 0);
101 RooMomentMorphFuncND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
102 const RooArgList &pdfList, const TVectorD &mrefpoints, Setting setting);
103 virtual ~RooMomentMorphFuncND();
104 virtual TObject *clone(const char *newname) const { return new RooMomentMorphFuncND(*this, newname); }
105
106 void setMode(const Setting &setting) { _setting = setting; }
107 virtual Bool_t selfNormalized() const { return kTRUE; }
110
111 Double_t evaluate() const;
112 virtual Double_t getVal(const RooArgSet *set = 0) const;
113
114protected:
115 void initialize();
116 void initializeParameters(const RooArgList &parList);
117 void initializeObservables(const RooArgList &obsList);
118
119 RooAbsReal *sumFunc(const RooArgSet *nset);
120 CacheElem *getCache(const RooArgSet *nset) const;
121
122 template <typename T>
123 struct Digits {
124 typename std::vector<T>::const_iterator begin;
125 typename std::vector<T>::const_iterator end;
126 typename std::vector<T>::const_iterator me;
127 };
128
129 template <typename T>
130 static void cartesian_product(std::vector<std::vector<T>> &out, std::vector<std::vector<T>> &in);
131 template <typename Iterator>
132 static bool next_combination(const Iterator first, Iterator k, const Iterator last);
133 void findShape(const std::vector<double> &x) const;
134
135 friend class CacheElem;
136 friend class Grid2;
137
140
143 // RooListProxy _pdfList ;
144 TIterator *_parItr; //! do not persist
148
149 mutable TMatrixD *_M;
150 mutable TMatrixD *_MSqr;
151 mutable std::vector<std::vector<double>> _squareVec;
152 mutable std::vector<int> _squareIdx;
153
156
157 inline int sij(const int &i, const int &j) const { return (i * _obsList.getSize() + j); }
158
160};
161
162#endif
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassDef(name, id)
Definition: Rtypes.h:322
char name[80]
Definition: TGX11.cxx:109
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
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:60
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
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:25
virtual RooArgList containedArgs(Action)
void operModeHook(RooAbsArg::OperMode)
Interface for operation mode change calls.
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
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:35
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
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