43using std::cout, std::endl, std::string, std::vector;
59 _parList(
"parList",
"List of morph parameters",
this),
60 _obsList(
"obsList",
"List of observables",
this),
62 _pdfList(
"pdfList",
"List of pdfs",
this),
85 _parList(
"parList",
"List of morph parameters",
this),
86 _obsList(
"obsList",
"List of observables",
this),
87 _pdfList(
"pdfList",
"List of pdfs",
this),
95 for (
int i = 0; i <
mrefpoints.GetNrows(); ++i) {
125 _parList(
"parList",
"List of morph parameters",
this),
126 _obsList(
"obsList",
"List of observables",
this),
127 _pdfList(
"pdfList",
"List of pdfs",
this),
136 coutE(InputArguments) <<
"RooMomentMorphFuncND::ctor(" <<
GetName() <<
") ERROR: mref " <<
mref->GetName()
137 <<
" is not of type RooAbsReal" << endl;
138 throw string(
"RooMomentMorphFuncND::ctor() ERROR mref is not of type RooAbsReal");
141 coutW(InputArguments) <<
"RooMomentMorphFuncND::ctor(" <<
GetName() <<
") WARNING mref point " << i
142 <<
" is not a constant, taking a snapshot of its value" << endl;
179 _parList(
"parList",
this,
other._parList),
180 _obsList(
"obsList",
this,
other._obsList),
181 _referenceGrid(
other._referenceGrid),
182 _pdfList(
"pdfList",
this,
other._pdfList),
183 _setting(
other._setting),
184 _useHorizMorph(
other._useHorizMorph),
185 _isPdfMode{
other._isPdfMode}
211 int depth = std::pow(2, nPar);
214 coutE(InputArguments) <<
"RooMomentMorphFuncND::initialize(" <<
GetName() <<
") ERROR: nPar != nDim"
215 <<
": " << nPar <<
" !=" <<
nDim << endl;
220 coutE(InputArguments) <<
"RooMomentMorphFuncND::initialize(" <<
GetName() <<
") ERROR: nPdf != nRef"
221 <<
": " <<
nPdf <<
" !=" <<
nRef << endl;
232 for (
int k = 0; k <
nPdf; ++k) {
236 dm2.push_back(delta);
255 for (
int k = 0; k <
nPdf; ++k) {
257 for (
int i = 0; i <
nCombs; i++) {
259 for (
int ix = 0;
ix < nPar;
ix++) {
260 double delta = dm[k][
ix];
261 tmpDm *= std::pow(delta,
static_cast<double>(
output[i][
ix]));
281 for (
unsigned int i = 0; i <
other._grid.size(); i++) {
340 int nBins = bins.size();
342 for (
int i = 0; i < nBins; i++) {
379 for (
int i = 0; i < 3 *
nPdf; ++i) {
387 }
else if (i < 2 *
nPdf) {
395 std::unique_ptr<RooAbsReal>
theSum;
402 for (
int i = 0; i <
nPdf; ++i) {
403 for (
int j = 0;
j < nObs; ++
j) {
407 mom->setLocalNoDirtyInhibit(
true);
408 mom->mean()->setLocalNoDirtyInhibit(
true);
418 for (
int j = 0;
j < nObs; ++
j) {
421 for (
int i = 0; i <
nPdf; ++i) {
455 *offsets[
sij(i,
j)]);
526 if (cache->
_tracker->hasChanged(
true)) {
529 return cache->
_sum.get();
537 if (cache->
_tracker->hasChanged(
true)) {
549 return static_cast<RooRealVar *
>(_frac.at(i));
555 return static_cast<RooRealVar *
>(_frac.at(i));
562 int nPar =
self._parList.size();
572 dm2.push_back(delta);
592 for (
int i = 0; i <
nCombs; i++) {
594 for (
int ix = 0;
ix < nPar;
ix++) {
595 double delta =
dm2[
ix];
596 tmpDm *= std::pow(delta,
static_cast<double>(
output[i][
ix]));
603 for (
int i = 0; i <
nPdf; ++i) {
606 for (
int j = 0;
j <
nPdf; ++
j) {
624 cout <<
"NonLinear fraction " <<
ffrac << endl;
626 frac(
nPdf + i)->Print();
627 frac(2 *
nPdf + i)->Print();
632 for (
int i = 0; i <
nPdf; ++i) {
633 if (frac(i)->
getVal() < 0)
634 const_cast<RooRealVar *
>(frac(i))->setVal(0.);
643 for (
int i = 0; i <
nPdf; ++i) {
650 std::vector<double>
mtmp;
654 mtmp.push_back(
m->getVal());
659 int depth = std::pow(2, nPar);
666 for (
int ix = 0;
ix < nPar;
ix++) {
683 for (
int i = 0; i <
depth; ++i) {
696 frac(
nPdf +
self._squareIdx[i])->getVal();
702 cout <<
"Linear fraction " <<
ffrac << endl;
703 frac(
self._squareIdx[i])->Print();
704 frac(
nPdf +
self._squareIdx[i])->Print();
705 frac(2 *
nPdf +
self._squareIdx[i])->Print();
728 int depth = std::pow(2, nPar);
735 boundaries[
idim].push_back(lo);
736 boundaries[
idim].push_back(
hi);
768 for (
int ix = 0;
ix < nPar;
ix++) {
772 for (
int k = 0; k <
depth; ++k) {
791 (*_MSqr) = M.Invert();
797 if (allVars.
size() == 1) {
804 cout <<
"Currently BinIntegrator only knows how to deal with 1-d " << endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
const_iterator begin() const
const_iterator end() const
Abstract base class for RooRealVar binning definitions.
Abstract container object that can hold multiple RooAbsArg objects.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
RooAbsArg * first() const
bool addTyped(const RooAbsCollection &list, bool silent=false)
Adds elements of a given RooAbsCollection to the container if they match the specified type.
const RooArgSet * nset() const
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual double getValV(const RooArgSet *normalisationSet=nullptr) const
Return value of object.
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
Calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Implements a RooAbsBinning in terms of an array of boundary values, posing no constraints on the choi...
double * array() const override
Return array of boundary values.
Int_t numBoundaries() const override
Return the number boundaries.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=nullptr)
Setter function without integration set.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=nullptr, const TNamed *isetRangeName=nullptr)
Getter function without integration set.
bool setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
Represents a constant real-valued object.
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
RooLinearVar is the most general form of a derived real-valued object that can be used by RooRealInte...
void calculateFractions(const RooMomentMorphFuncND &self, bool verbose=true) const
std::unique_ptr< RooChangeTracker > _tracker
std::unique_ptr< RooAbsReal > _sum
RooArgList containedArgs(Action) override
CacheElem(std::unique_ptr< RooAbsReal > &&sumFunc, std::unique_ptr< RooChangeTracker > &&tracker, const RooArgList &flist)
std::vector< int > _nnuis
void addBinning(const RooAbsBinning &binning)
std::vector< RooAbsBinning * > _grid
std::vector< std::vector< double > > _nref
void addPdf(const RooAbsReal &func, int bin_x)
RooObjCacheManager _cacheMgr
! Transient cache manager
std::unique_ptr< TMatrixD > _MSqr
void findShape(const std::vector< double > &x) const
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
RooAbsReal * sumFunc(const RooArgSet *nset)
CacheElem * getCache(const RooArgSet *nset) const
std::unique_ptr< TMatrixD > _M
RooArgSet * _curNormSet
! Transient cache manager
bool setBinIntegrator(RooArgSet &allVars)
double getValV(const RooArgSet *set=nullptr) const override
Return value of object.
std::vector< std::vector< double > > _squareVec
int sij(const int &i, const int &j) const
~RooMomentMorphFuncND() override
std::vector< int > _squareIdx
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
Variable that can be changed from the outside.
const char * GetName() const override
Returns name of object.
void cartesianProduct(std::vector< std::vector< T > > &out, std::vector< std::vector< T > > &in)
bool nextCombination(const Iterator first, Iterator k, const Iterator last)