Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAddHelpers.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 *
4 * Copyright (c) 2022, CERN
5 *
6 * Redistribution and use in source and binary forms,
7 * with or without modification, are permitted according to the terms
8 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
9 */
10
11#ifndef RooFit_RooFitCore_RooAddHelpers_h
12#define RooFit_RooFitCore_RooAddHelpers_h
13
14#include <RooAbsCacheElement.h>
15#include <RooArgList.h>
16#include <RooAbsReal.h>
17
18class RooAbsPdf;
19class RooArgSet;
20
22public:
23 AddCacheElem(RooAbsPdf const &addPdf, RooArgList const &pdfList, RooArgList const &coefList, const RooArgSet *nset,
24 const RooArgSet *iset, RooArgSet const &refCoefNormSet, std::string const &refCoefNormRange,
25 int verboseEval);
26
28
29 inline double suppNormVal(std::size_t idx) const { return _suppNormList[idx] ? _suppNormList[idx]->getVal() : 1.0; }
30
31 inline bool doProjection() const { return !_projList.empty(); }
32
33 inline double projVal(std::size_t idx) const { return _projList[idx] ? _projList[idx]->getVal() : 1.0; }
34
35 inline double projSuppNormVal(std::size_t idx) const
36 {
37 return _suppProjList[idx] ? _suppProjList[idx]->getVal() : 1.0;
38 }
39
40 inline double rangeProjScaleFactor(std::size_t idx) const
41 {
42 return _rangeProjList[idx] ? _rangeProjList[idx]->getVal() : 1.0;
43 }
44
45 void print() const;
46
47private:
48 using OwningArgVector = std::vector<std::unique_ptr<RooAbsReal>>;
49
50 OwningArgVector _suppNormList; ///< Supplemental normalization list
51 OwningArgVector _projList; ///< Projection integrals to be multiplied with coefficients
52 OwningArgVector _suppProjList; ///< Projection integrals to multiply with coefficients for supplemental normalization
53 OwningArgVector _rangeProjList; ///< Range integrals to be multiplied with coefficients (reference to target range)
54};
55
57public:
58 static void updateCoefficients(RooAbsPdf const &addPdf, std::vector<double> &coefCache, RooArgList const &pdfList,
59 bool haveLastCoef, AddCacheElem &cache, const RooArgSet *nset,
60 RooArgSet const &refCoefNormSet, bool allExtendable, int &coefErrCount);
61};
62
63#endif
double projVal(std::size_t idx) const
OwningArgVector _projList
Projection integrals to be multiplied with coefficients.
double projSuppNormVal(std::size_t idx) const
void print() const
RooArgList containedArgs(Action) override
List all RooAbsArg derived contents in this cache element.
OwningArgVector _rangeProjList
Range integrals to be multiplied with coefficients (reference to target range)
double rangeProjScaleFactor(std::size_t idx) const
OwningArgVector _suppNormList
Supplemental normalization list.
bool doProjection() const
OwningArgVector _suppProjList
Projection integrals to multiply with coefficients for supplemental normalization.
double suppNormVal(std::size_t idx) const
std::vector< std::unique_ptr< RooAbsReal > > OwningArgVector
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
static void updateCoefficients(RooAbsPdf const &addPdf, std::vector< double > &coefCache, RooArgList const &pdfList, bool haveLastCoef, AddCacheElem &cache, const RooArgSet *nset, RooArgSet const &refCoefNormSet, bool allExtendable, int &coefErrCount)
Update the RooAddPdf coefficients for a given normalization set and projection configuration.
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:55