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 ROOFUNCTORBINDING
0014 #define ROOFUNCTORBINDING
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 namespace RooFit {
0025 
0026 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor,const RooArgList& vars) ;
0027 RooAbsPdf*  bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
0028 
0029 }
0030 
0031 class RooFunctorBinding : public RooAbsReal {
0032 public:
0033   RooFunctorBinding() = default;
0034   RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
0035   RooFunctorBinding(const RooFunctorBinding& other, const char* name=nullptr) ;
0036   TObject* clone(const char* newname) const override { return new RooFunctorBinding(*this,newname); }
0037   inline ~RooFunctorBinding() override { delete[] x ; }
0038   void printArgs(std::ostream& os) const override ;
0039 
0040 protected:
0041 
0042   double evaluate() const override ;
0043 
0044   const ROOT::Math::IBaseFunctionMultiDim* func = nullptr; // Functor
0045   RooListProxy vars; // Argument reference
0046   double *x = nullptr; // Argument value array
0047 
0048 
0049 private:
0050 
0051   ClassDefOverride(RooFunctorBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionMultiDim
0052 };
0053 
0054 
0055 
0056 class RooFunctorPdfBinding : public RooAbsPdf {
0057 public:
0058   RooFunctorPdfBinding() = default;
0059   RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
0060   RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=nullptr) ;
0061   TObject* clone(const char* newname) const override { return new RooFunctorPdfBinding(*this,newname); }
0062   inline ~RooFunctorPdfBinding() override { delete[] x ; }
0063   void printArgs(std::ostream& os) const override ;
0064 
0065 protected:
0066 
0067   double evaluate() const override ;
0068 
0069   const ROOT::Math::IBaseFunctionMultiDim* func = nullptr;    // Functor
0070   RooListProxy vars ;    // Argument reference
0071   double *x = nullptr; // Argument value array
0072 
0073 
0074 private:
0075 
0076   ClassDefOverride(RooFunctorPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionMultiDim
0077 };
0078 
0079 
0080 #endif