Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:25:26

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id$
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl                         *
0007  *                                                                           *
0008  * Copyright (c) 2000-2008, NIKHEF, Regents of the University of California  *
0009  *                          and Stanford University. All rights reserved.    *
0010  *                                                                           *
0011  *****************************************************************************/
0012 
0013 #ifndef ROOFUNCTOR1DBINDING
0014 #define ROOFUNCTOR1DBINDING
0015 
0016 #include "RooAbsReal.h"
0017 #include "RooArgList.h"
0018 #include "RooListProxy.h"
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 #include "Math/IFunction.h"
0022 
0023 
0024 namespace RooFit {
0025 
0026 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
0027 RooAbsPdf*  bindPdf(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
0028 
0029 }
0030 
0031 
0032 class RooFunctor1DBinding : public RooAbsReal {
0033 public:
0034   RooFunctor1DBinding() = default;
0035   RooFunctor1DBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& var);
0036   RooFunctor1DBinding(const RooFunctor1DBinding& other, const char* name=nullptr) ;
0037   TObject* clone(const char* newname=nullptr) const override { return new RooFunctor1DBinding(*this,newname); }
0038   void printArgs(std::ostream& os) const override ;
0039 
0040   ROOT::Math::IBaseFunctionOneDim const *function() const { return func; }
0041   RooAbsReal const &variable() const { return *var; }
0042 
0043 protected:
0044 
0045   double evaluate() const override ;
0046 
0047   const ROOT::Math::IBaseFunctionOneDim *func = nullptr; // Functor
0048   RooRealProxy                       var ;    // Argument reference
0049 
0050   ClassDefOverride(RooFunctor1DBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionOneDim
0051 };
0052 
0053 
0054 
0055 class RooFunctor1DPdfBinding : public RooAbsPdf {
0056 public:
0057   RooFunctor1DPdfBinding() = default;
0058   RooFunctor1DPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars);
0059   RooFunctor1DPdfBinding(const RooFunctor1DPdfBinding& other, const char* name=nullptr) ;
0060   TObject* clone(const char* newname=nullptr) const override { return new RooFunctor1DPdfBinding(*this,newname); }
0061   void printArgs(std::ostream& os) const override ;
0062 
0063   ROOT::Math::IBaseFunctionOneDim const *function() const { return func; }
0064   RooAbsReal const &variable() const { return *var; }
0065 
0066 protected:
0067 
0068   double evaluate() const override ;
0069 
0070   ROOT::Math::IBaseFunctionOneDim const *func = nullptr; // Functor
0071   RooRealProxy                           var ;    // Argument reference
0072 
0073   ClassDefOverride(RooFunctor1DPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionOneDim
0074 };
0075 
0076 
0077 #endif