/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * File: $Id: RooAddPdf.h,v 1.46 2007/07/12 20:30:28 wouter Exp $ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * * * Copyright (c) 2000-2005, Regents of the University of California * * and Stanford University. All rights reserved. * * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ #ifndef ROO_ADD_MODEL #define ROO_ADD_MODEL #include "RooResolutionModel.h" #include "RooListProxy.h" #include "RooSetProxy.h" #include "RooAICRegistry.h" #include "RooObjCacheManager.h" class AddCacheElem; class RooAddModel : public RooResolutionModel { public: RooAddModel() ; RooAddModel(const char *name, const char *title, const RooArgList& pdfList, const RooArgList& coefList, bool ownPdfList=false) ; RooAddModel(const RooAddModel& other, const char* name=nullptr) ; TObject* clone(const char* newname) const override { return new RooAddModel(*this,newname) ; } RooResolutionModel* convolution(RooFormulaVar* basis, RooAbsArg* owner) const override ; double evaluate() const override ; bool checkObservables(const RooArgSet* nset) const override ; void computeBatch(double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override; inline bool canComputeBatchWithCuda() const override { return true; } Int_t basisCode(const char* name) const override ; bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override { // Force RooRealIntegral to offer all observables for internal integration return true ; } Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override ; double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override ; /// Model is self normalized when used as p.d.f bool selfNormalized() const override { return _basisCode==0 ? true : false ; } /// Return extended mode capabilities ExtendMode extendMode() const override { return (_haveLastCoef || _allExtendable) ? MustBeExtended : CanNotBeExtended; } /// Return expected number of events for extended likelihood calculation, which /// is the sum of all coefficients. double expectedEvents(const RooArgSet* nset) const override ; /// Return list of component p.d.fs const RooArgList& pdfList() const { return _pdfList ; } /// Return list of coefficients of component p.d.f.s const RooArgList& coefList() const { return _coefList ; } bool isDirectGenSafe(const RooAbsArg& arg) const override ; Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, bool staticInitOK=true) const override; void generateEvent(Int_t code) override; void fixCoefNormalization(const RooArgSet& refCoefNorm) ; void fixCoefRange(const char* rangeName) ; void resetErrorCounters(Int_t resetValue=10) override ; void printMetaArgs(std::ostream& os) const override ; protected: friend class RooAddGenContext ; RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet* auxProto=nullptr, bool verbose= false) const override ; void selectNormalization(const RooArgSet* depSet=nullptr, bool force=false) override ; void selectNormalizationRange(const char* rangeName=nullptr, bool force=false) override ; mutable RooSetProxy _refCoefNorm ; /// _coefCache; ///