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 };
78 virtual ~CacheElem();
83
84 RooRealVar *frac(int i);
85 const RooRealVar *frac(int i) const;
86 void calculateFractions(const RooMomentMorphND &self, Bool_t verbose = kTRUE) const;
87 };
88
89public:
91
93 RooMomentMorphND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
94 const RooArgList &pdfList, const RooArgList &mrefList, Setting setting);
95 RooMomentMorphND(const char *name, const char *title, const RooArgList &parList, const RooArgList &obsList,
96 const Grid &referenceGrid, const Setting &setting);
97 RooMomentMorphND(const RooMomentMorphND &other, const char *name = 0);
98 RooMomentMorphND(const char *name, const char *title, RooAbsReal &_m, const RooArgList &varList,
99 const RooArgList &pdfList, const TVectorD &mrefpoints, Setting setting);
100 virtual ~RooMomentMorphND();
101 virtual TObject *clone(const char *newname) const { return new RooMomentMorphND(*this, newname); }
102
103 void setMode(const Setting &setting) { _setting = setting; }
104 virtual Bool_t selfNormalized() const { return kTRUE; }
107
108 Double_t evaluate() const;
109 virtual Double_t getVal(const RooArgSet *set = 0) const;
110
111protected:
112 void initialize();
113 void initializeParameters(const RooArgList &parList);
114 void initializeObservables(const RooArgList &obsList);
115
116 RooAbsPdf *sumPdf(const RooArgSet *nset);
117 CacheElem *getCache(const RooArgSet *nset) const;
118
119 void findShape(const std::vector<double> &x) const;
120
121 friend class CacheElem;
122 friend class Grid;
123
124 mutable RooObjCacheManager _cacheMgr; ///<! Transient cache manager
126
129 // RooListProxy _pdfList ;
130 TIterator *_parItr; //! Do not persist
131 TIterator *_obsItr; //! Do not persist
134
135 mutable TMatrixD *_M;
136 mutable TMatrixD *_MSqr;
137 mutable std::vector<std::vector<double>> _squareVec;
138 mutable std::vector<int> _squareIdx;
139
142
143 inline int sij(const int &i, const int &j) const { return (i * _obsList.getSize() + j); }
144
146};
147
148#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
RooChangeTracker * _tracker
CacheElem(RooAbsPdf &sumPdf, RooChangeTracker &tracker, const RooArgList &flist)
virtual RooArgList containedArgs(Action)
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
! Transient cache manager
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
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
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: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