Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-25 08:59:12

0001 
0002 
0003 /*****************************************************************************
0004  * Project: RooFit                                                           *
0005  * Package: RooFitModels                                                     *
0006  *    File: $Id$
0007  * Authors:                                                                  *
0008  *    Tristan du Pree, Nikhef, Amsterdam, tdupree@nikhef.nl                  *
0009  *                                                                           *
0010  * Copyright (c) 2000-2005, Stanford University. All rights reserved.        *
0011  *
0012  *                                                                           *
0013  * Redistribution and use in source and binary forms,                        *
0014  * with or without modification, are permitted according to the terms        *
0015  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0016  *****************************************************************************/
0017 #ifndef ROO_STEP_FUNCTION
0018 #define ROO_STEP_FUNCTION
0019 
0020 #include <RooAbsReal.h>
0021 #include <RooListProxy.h>
0022 #include <RooRealProxy.h>
0023 
0024 class RooArgList ;
0025 
0026 class RooStepFunction : public RooAbsReal {
0027  public:
0028 
0029   RooStepFunction() {}
0030   RooStepFunction(const char *name, const char *title,
0031         RooAbsReal& x, const RooArgList& coefList, const RooArgList& limits, bool interpolate=false) ;
0032 
0033   RooStepFunction(const RooStepFunction& other, const char *name = nullptr);
0034   TObject* clone(const char* newname=nullptr) const override { return new RooStepFunction(*this, newname); }
0035 
0036   const RooArgList& coefficients() { return _coefList; }
0037   const RooArgList& boundaries() { return _boundaryList; }
0038 
0039   std::list<double>* plotSamplingHint(RooAbsRealLValue& obs, double xlo, double xhi) const override ;
0040 
0041   int getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const override;
0042   double analyticalIntegral(int code, const char* rangeName=nullptr) const override;
0043 
0044  protected:
0045 
0046   double evaluate() const override;
0047 
0048  private:
0049 
0050   RooRealProxy _x;
0051   RooListProxy _coefList ;
0052   RooListProxy _boundaryList ;
0053   bool       _interpolate = false;
0054   mutable std::vector<double> _coefCache; //!
0055   mutable std::vector<double> _boundaryCache; //!
0056 
0057   ClassDefOverride(RooStepFunction,1) //  Step Function
0058 };
0059 
0060 #endif