Logo ROOT   6.14/05
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 
26 class RooChangeTracker;
27 
28 class RooMomentMorphND : public RooAbsPdf {
29 
30 public:
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 
70 protected:
71  class CacheElem : public RooAbsCacheElement {
72  public:
74  : _sumPdf(&sumPdf), _tracker(&tracker)
75  {
76  _frac.add(flist);
77  };
79  virtual ~CacheElem();
80  virtual RooArgList containedArgs(Action);
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 
90 public:
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 
112 protected:
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
virtual Bool_t selfNormalized() const
virtual Double_t getVal(const RooArgSet *set=0) const
Grid(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y, const RooAbsBinning &binning_z)
void addPdf(const RooAbsPdf &pdf, int bin_x)
TIterator * _obsItr
Do not persist.
Grid(const RooAbsBinning &binning_x, const RooAbsBinning &binning_y)
RooSetProxy _obsList
std::vector< int > _nnuis
bool Bool_t
Definition: RtypesCore.h:59
void useHorizontalMorphing(Bool_t val)
void addBinning(const RooAbsBinning &binning)
void findShape(const std::vector< double > &x) const
RooListProxy _pdfList
virtual RooAbsBinning * clone(const char *name=0) const =0
Iterator abstract base class.
Definition: TIterator.h:30
void operModeHook(RooAbsArg::OperMode)
Interface for operation mode change calls.
Double_t x[n]
Definition: legend1.C:17
CacheElem(RooAbsPdf &sumPdf, RooChangeTracker &tracker, const RooArgList &flist)
#define ClassDef(name, id)
Definition: Rtypes.h:320
Grid(const std::vector< RooAbsBinning *> binnings)
void initializeParameters(const RooArgList &parList)
RooListProxy _parList
RooArgSet * _curNormSet
std::vector< int > _squareIdx
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:36
void setMode(const Setting &setting)
Grid(const RooAbsBinning &binning_x)
Int_t getSize() const
std::vector< std::vector< double > > _squareVec
Grid _referenceGrid
Do not persist.
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Bool_t setBinIntegrator(RooArgSet &allVars)
CacheElem * getCache(const RooArgSet *nset) const
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
RooChangeTracker * _tracker
RooAbsPdf * sumPdf(const RooArgSet *nset)
RooObjCacheManager _cacheMgr
std::vector< RooAbsBinning * > _grid
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Double_t evaluate() const
int sij(const int &i, const int &j) const
RooChangeTracker is a meta object that tracks value changes in a given set of RooAbsArgs by registeri...
virtual TObject * clone(const char *newname) const
Mother of all ROOT objects.
Definition: TObject.h:37
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
std::vector< std::vector< double > > _nref
std::map< std::vector< int >, int > _pdfMap
const Bool_t kTRUE
Definition: RtypesCore.h:87
void initializeObservables(const RooArgList &obsList)
char name[80]
Definition: TGX11.cxx:109