Logo ROOT  
Reference Guide
RooMomentMorphND.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * *
4 * This code was autogenerated by RooClassFactory *
5 *****************************************************************************/
6
7#ifndef ROOMOMENTMORPHND
8#define ROOMOMENTMORPHND
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 Grid {
32 public:
33 Grid(){};
34 Grid(const Grid &other);
35 Grid(const RooAbsBinning &binning_x) { _grid.push_back(binning_x.clone()); };
36 Grid(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 Grid(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 Grid(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 ~Grid();
55
56 void addPdf(const RooAbsPdf &pdf, int bin_x);
57 void addPdf(const RooAbsPdf &pdf, int bin_x, int bin_y);
58 void addPdf(const RooAbsPdf &pdf, int bin_x, int bin_y, int bin_z);
59 void addPdf(const RooAbsPdf &pdf, 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 };
69
70protected:
72 public:
74 : _sumPdf(&sumPdf), _tracker(&tracker)
75 {
76 _frac.add(flist);
77 };
79 virtual ~CacheElem();
84
85 RooRealVar *frac(int i);
86 const RooRealVar *frac(int i) const;
87 void calculateFractions(const RooMomentMorphND &self, Bool_t verbose = kTRUE) const;
88 };
89
90public:
92
94 RooMomentMorphND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
95 const RooArgList &pdfList, const RooArgList &mrefList, Setting setting);
96 RooMomentMorphND(const char *name, const char *title, const RooArgList &parList, const RooArgList &obsList,
97 const Grid &referenceGrid, const Setting &setting);
98 RooMomentMorphND(const RooMomentMorphND &other, const char *name = 0);
99 RooMomentMorphND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
100 const RooArgList &pdfList, const TVectorD &mrefpoints, Setting setting);
101 virtual ~RooMomentMorphND();
102 virtual TObject *clone(const char *newname) const { return new RooMomentMorphND(*this, newname); }
103
104 void setMode(const Setting &setting) { _setting = setting; }
105 virtual Bool_t selfNormalized() const { return kTRUE; }
108
109 Double_t evaluate() const;
110 virtual Double_t getVal(const RooArgSet *set = 0) const;
111
112protected:
113 void initialize();
114 void initializeParameters(const RooArgList &parList);
115 void initializeObservables(const RooArgList &obsList);
116
117 RooAbsPdf *sumPdf(const RooArgSet *nset);
118 CacheElem *getCache(const RooArgSet *nset) const;
119
120 void findShape(const std::vector<double> &x) const;
121
122 friend class CacheElem;
123 friend class Grid;
124
127
130 // RooListProxy _pdfList ;
131 TIterator *_parItr; //! Do not persist
132 TIterator *_obsItr; //! Do not persist
135
136 mutable TMatrixD *_M;
137 mutable TMatrixD *_MSqr;
138 mutable std::vector<std::vector<double>> _squareVec;
139 mutable std::vector<int> _squareIdx;
140
143
144 inline int sij(const int &i, const int &j) const { return (i * _obsList.getSize() + j); }
145
147};
148
149#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
RooChangeTracker * _tracker
CacheElem(RooAbsPdf &sumPdf, RooChangeTracker &tracker, const RooArgList &flist)
virtual RooArgList containedArgs(Action)
void operModeHook(RooAbsArg::OperMode)
Interface for operation mode change calls.
void calculateFractions(const RooMomentMorphND &self, Bool_t verbose=kTRUE) const
void addBinning(const RooAbsBinning &binning)
std::vector< std::vector< double > > _nref
Grid(const RooAbsBinning &binning_x)
std::map< std::vector< int >, int > _pdfMap
Grid(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y, const RooAbsBinning &binning_z)
Grid(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y)
Grid(const std::vector< RooAbsBinning * > binnings)
std::vector< RooAbsBinning * > _grid
void addPdf(const RooAbsPdf &pdf, int bin_x)
std::vector< int > _nnuis
virtual Double_t getVal(const RooArgSet *set=0) const
std::vector< int > _squareIdx
Grid _referenceGrid
Do not persist.
CacheElem * getCache(const RooArgSet *nset) const
RooObjCacheManager _cacheMgr
RooArgSet * _curNormSet
friend class CacheElem
Bool_t setBinIntegrator(RooArgSet &allVars)
std::vector< std::vector< double > > _squareVec
void useHorizontalMorphing(Bool_t val)
void initializeObservables(const RooArgList &obsList)
virtual TObject * clone(const char *newname) const
void setMode(const Setting &setting)
int sij(const int &i, const int &j) const
void findShape(const std::vector< double > &x) const
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
TIterator * _obsItr
Do not persist.
RooSetProxy _obsList
virtual Bool_t selfNormalized() const
RooAbsPdf * sumPdf(const RooArgSet *nset)
void initializeParameters(const RooArgList &parList)
RooListProxy _parList
RooListProxy _pdfList
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