Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooRealSumFunc.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooRealSumFunc.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_REAL_SUM_FUNC
0017 #define ROO_REAL_SUM_FUNC
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooListProxy.h"
0021 #include "RooAICRegistry.h"
0022 #include "RooObjCacheManager.h"
0023 
0024 #include <list>
0025 
0026 class RooRealSumFunc : public RooAbsReal {
0027 public:
0028    RooRealSumFunc();
0029    RooRealSumFunc(const char *name, const char *title);
0030    RooRealSumFunc(const char *name, const char *title, const RooArgList &funcList, const RooArgList &coefList);
0031    RooRealSumFunc(const char *name, const char *title, RooAbsReal &func1, RooAbsReal &func2, RooAbsReal &coef1);
0032    RooRealSumFunc(const RooRealSumFunc &other, const char *name = nullptr);
0033    TObject *clone(const char *newname) const override { return new RooRealSumFunc(*this, newname); }
0034    ~RooRealSumFunc() override;
0035 
0036    double evaluate() const override;
0037    bool checkObservables(const RooArgSet *nset) const override;
0038 
0039    bool forceAnalyticalInt(const RooAbsArg &arg) const override { return arg.isFundamental(); }
0040    Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet,
0041                                  const char *rangeName = nullptr) const override;
0042    double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName = nullptr) const override;
0043 
0044    const RooArgList &funcList() const { return _funcList; }
0045    const RooArgList &coefList() const { return _coefList; }
0046 
0047    void printMetaArgs(std::ostream &os) const override;
0048 
0049    std::list<double> *binBoundaries(RooAbsRealLValue & /*obs*/, double /*xlo*/, double /*xhi*/) const override;
0050    std::list<double> *plotSamplingHint(RooAbsRealLValue & /*obs*/, double /*xlo*/, double /*xhi*/) const override;
0051    bool isBinnedDistribution(const RooArgSet &obs) const override;
0052 
0053    void setFloor(bool flag) { _doFloor = flag; }
0054    bool getFloor() const { return _doFloor; }
0055    static void setFloorGlobal(bool flag) { _doFloorGlobal = flag; }
0056    static bool getFloorGlobal() { return _doFloorGlobal; }
0057 
0058    CacheMode canNodeBeCached() const override { return RooAbsArg::NotAdvised; };
0059    void setCacheAndTrackHints(RooArgSet &) override;
0060 
0061    std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
0062 
0063    void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0064 
0065 protected:
0066    mutable RooObjCacheManager _normIntMgr; //! The integration cache manager
0067 
0068    bool _haveLastCoef;
0069 
0070    RooListProxy _funcList; ///<  List of component FUNCs
0071    RooListProxy _coefList; ///<  List of coefficients
0072 
0073    bool _doFloor = false;           ///< Introduce floor at zero in pdf
0074    mutable bool _haveWarned{false}; ///<!
0075    static bool _doFloorGlobal;      ///< Global flag for introducing floor at zero in pdf
0076 
0077 private:
0078    ClassDefOverride(RooRealSumFunc, 4) // PDF constructed from a sum of (non-pdf) functions
0079 };
0080 
0081 #endif