Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:22

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 "RooMsgService.h"
0022 #include "Math/IFunction.h"
0023 
0024 
0025 namespace RooFit {
0026 
0027 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
0028 RooAbsPdf*  bindPdf(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
0029 
0030 }
0031 
0032 
0033 class RooFunctor1DBinding : public RooAbsReal {
0034 public:
0035   RooFunctor1DBinding() : func(nullptr) {
0036     // Default constructor
0037   } ;
0038   RooFunctor1DBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& var);
0039   RooFunctor1DBinding(const RooFunctor1DBinding& other, const char* name=nullptr) ;
0040   TObject* clone(const char* newname) const override { return new RooFunctor1DBinding(*this,newname); }
0041   void printArgs(std::ostream& os) const override ;
0042 
0043 protected:
0044 
0045   double evaluate() const override ;
0046 
0047   const ROOT::Math::IBaseFunctionOneDim* func ;    // Functor
0048   RooRealProxy                       var ;    // Argument reference
0049 
0050 
0051 private:
0052 
0053   ClassDefOverride(RooFunctor1DBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionOneDim
0054 };
0055 
0056 
0057 
0058 class RooFunctor1DPdfBinding : public RooAbsPdf {
0059 public:
0060   RooFunctor1DPdfBinding() : func(nullptr) {
0061     // Default constructor
0062   } ;
0063   RooFunctor1DPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars);
0064   RooFunctor1DPdfBinding(const RooFunctor1DPdfBinding& other, const char* name=nullptr) ;
0065   TObject* clone(const char* newname) const override { return new RooFunctor1DPdfBinding(*this,newname); }
0066   void printArgs(std::ostream& os) const override ;
0067 
0068 protected:
0069 
0070   double evaluate() const override ;
0071 
0072   const ROOT::Math::IBaseFunctionOneDim* func ;    // Functor
0073   RooRealProxy                           var ;    // Argument reference
0074 
0075 
0076 private:
0077 
0078   ClassDefOverride(RooFunctor1DPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionOneDim
0079 };
0080 
0081 
0082 #endif