Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RooAddHelpers.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*
4 * Project: RooFit
5 *
6 * Copyright (c) 2022, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RooFit_RooFitCore_RooAddHelpers_h
14#define RooFit_RooFitCore_RooAddHelpers_h
15
16#include <RooAbsCacheElement.h>
17#include <RooArgList.h>
18#include <RooAbsReal.h>
19
20class RooAbsPdf;
21class RooArgSet;
22
23class AddCacheElem : public RooAbsCacheElement {
24public:
25 AddCacheElem(RooAbsPdf const &addPdf, RooArgList const &pdfList, RooArgList const &coefList, const RooArgSet *nset,
26 const RooArgSet *iset, RooArgSet const &refCoefNormSet, std::string const &refCoefNormRange,
27 int verboseEval);
28
29 RooArgList containedArgs(Action) override;
30
31 inline double suppNormVal(std::size_t idx) const { return _suppNormList[idx] ? _suppNormList[idx]->getVal() : 1.0; }
32
33 inline bool doProjection() const { return !_projList.empty(); }
34
35 inline double projVal(std::size_t idx) const { return _projList[idx] ? _projList[idx]->getVal() : 1.0; }
36
37 inline double projSuppNormVal(std::size_t idx) const
38 {
39 return _suppProjList[idx] ? _suppProjList[idx]->getVal() : 1.0;
40 }
41
42 inline double rangeProjScaleFactor(std::size_t idx) const
43 {
44 return _rangeProjList[idx] ? _rangeProjList[idx]->getVal() : 1.0;
45 }
46
47 void print() const;
48
49private:
50 using OwningArgVector = std::vector<std::unique_ptr<RooAbsReal>>;
51
52 OwningArgVector _suppNormList; ///< Supplemental normalization list
53 OwningArgVector _projList; ///< Projection integrals to be multiplied with coefficients
54 OwningArgVector _suppProjList; ///< Projection integrals to multiply with coefficients for supplemental normalization
55 OwningArgVector _rangeProjList; ///< Range integrals to be multiplied with coefficients (reference to target range)
56};
57
58class RooAddHelpers {
59public:
60 static void updateCoefficients(RooAbsPdf const &addPdf, std::vector<double> &coefCache, RooArgList const &pdfList,
61 bool haveLastCoef, AddCacheElem &cache, const RooArgSet *nset,
63};
64
65#endif
66
67/// \endcond
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Abstract base class for objects to be stored in RooAbsCache cache manager objects.
virtual RooArgList containedArgs(Action)=0
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
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:24