Warning, file /include/root/RooAddModel.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_ADD_MODEL
0017 #define ROO_ADD_MODEL
0018
0019 #include "RooResolutionModel.h"
0020 #include "RooListProxy.h"
0021 #include "RooSetProxy.h"
0022 #include "RooAICRegistry.h"
0023 #include "RooObjCacheManager.h"
0024
0025 class AddCacheElem;
0026
0027 class RooAddModel : public RooResolutionModel {
0028 public:
0029
0030 RooAddModel() ;
0031 RooAddModel(const char *name, const char *title, const RooArgList& pdfList, const RooArgList& coefList, bool ownPdfList=false) ;
0032 RooAddModel(const RooAddModel& other, const char* name=nullptr) ;
0033 TObject* clone(const char* newname) const override { return new RooAddModel(*this,newname) ; }
0034 RooResolutionModel* convolution(RooFormulaVar* basis, RooAbsArg* owner) const override ;
0035
0036 double evaluate() const override ;
0037 bool checkObservables(const RooArgSet* nset) const override ;
0038
0039 void doEval(RooFit::EvalContext &) const override;
0040 inline bool canComputeBatchWithCuda() const override { return true; }
0041
0042 Int_t basisCode(const char* name) const override ;
0043
0044 bool forceAnalyticalInt(const RooAbsArg& ) const override {
0045
0046 return true ;
0047 }
0048 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
0049 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
0050
0051
0052 bool selfNormalized() const override {
0053 return _basisCode==0 ? true : false ;
0054 }
0055
0056
0057 ExtendMode extendMode() const override {
0058 return (_haveLastCoef || _allExtendable) ? MustBeExtended : CanNotBeExtended;
0059 }
0060
0061
0062
0063 double expectedEvents(const RooArgSet* nset) const override ;
0064
0065
0066 const RooArgList& pdfList() const {
0067 return _pdfList ;
0068 }
0069
0070
0071 const RooArgList& coefList() const {
0072 return _coefList ;
0073 }
0074
0075 bool isDirectGenSafe(const RooAbsArg& arg) const override ;
0076
0077 Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, bool staticInitOK=true) const override;
0078 void generateEvent(Int_t code) override;
0079
0080
0081 void fixCoefNormalization(const RooArgSet& refCoefNorm) ;
0082 void fixCoefRange(const char* rangeName) ;
0083 void resetErrorCounters(Int_t resetValue=10) override ;
0084
0085 void printMetaArgs(std::ostream& os) const override ;
0086
0087 protected:
0088
0089 friend class RooAddGenContext ;
0090 RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr,
0091 const RooArgSet* auxProto=nullptr, bool verbose= false) const override ;
0092
0093 void selectNormalization(const RooArgSet* depSet=nullptr, bool force=false) override ;
0094 void selectNormalizationRange(const char* rangeName=nullptr, bool force=false) override ;
0095
0096 mutable RooSetProxy _refCoefNorm ;
0097 mutable TNamed* _refCoefRangeName = nullptr;
0098
0099 mutable std::vector<double> _coefCache;
0100
0101
0102 mutable RooObjCacheManager _projCacheMgr ;
0103 AddCacheElem* getProjCache(const RooArgSet* nset, const RooArgSet* iset=nullptr) const ;
0104 void updateCoefficients(AddCacheElem& cache, const RooArgSet* nset) const ;
0105
0106 typedef RooArgList* pRooArgList ;
0107 void getCompIntList(const RooArgSet* nset, const RooArgSet* iset, pRooArgList& compIntList, Int_t& code, const char* isetRangeName) const ;
0108 class IntCacheElem : public RooAbsCacheElement {
0109 public:
0110 RooArgList _intList ;
0111 RooArgList containedArgs(Action) override ;
0112 } ;
0113
0114 mutable RooObjCacheManager _intCacheMgr ;
0115
0116 mutable RooAICRegistry _codeReg = 10;
0117
0118 RooListProxy _pdfList ;
0119 RooListProxy _coefList ;
0120 mutable RooArgList* _snormList{nullptr};
0121
0122 bool _haveLastCoef = false;
0123 bool _allExtendable = false;
0124
0125 mutable Int_t _coefErrCount ;
0126
0127 mutable RooArgSet _ownedComps ;
0128
0129 private:
0130
0131 ClassDefOverride(RooAddModel,3)
0132 };
0133
0134 #endif