Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooRealBinding.h,v 1.9 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_BINDING
0017 #define ROO_REAL_BINDING
0018 
0019 #include "RooAbsFunc.h"
0020 
0021 #include <ROOT/RSpan.hxx>
0022 
0023 #include <vector>
0024 #include <memory>
0025 
0026 class RooAbsRealLValue;
0027 class RooAbsReal;
0028 class RooArgSet;
0029 
0030 class RooRealBinding : public RooAbsFunc {
0031 public:
0032   RooRealBinding(const RooAbsReal& func, const RooArgSet &vars, const RooArgSet* nset=nullptr, bool clipInvalid=false, const TNamed* rangeName=nullptr);
0033   RooRealBinding(const RooRealBinding& other, const RooArgSet* nset=nullptr) ;
0034   ~RooRealBinding() override;
0035 
0036   double operator()(const double xvector[]) const override;
0037   double getMinLimit(UInt_t dimension) const override;
0038   double getMaxLimit(UInt_t dimension) const override;
0039 
0040   void saveXVec() const override ;
0041   void restoreXVec() const override ;
0042 
0043   const char* getName() const override ;
0044 
0045   std::list<double>* binBoundaries(Int_t) const override ;
0046   /// Return a pointer to the observable that defines the `i`-th dimension of the function.
0047   RooAbsRealLValue* observable(unsigned int i) const { return i < _vars.size() ? _vars[i] : nullptr; }
0048   std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
0049 
0050 protected:
0051 
0052   void loadValues(const double xvector[]) const;
0053   const RooAbsReal *_func;
0054   std::vector<RooAbsRealLValue*> _vars; ///< Non-owned pointers to variables
0055   const RooArgSet *_nset;
0056   mutable bool _xvecValid;
0057   bool _clipInvalid ;
0058   mutable std::vector<double> _xsave ;
0059   const TNamed* _rangeName ; ///<!
0060 
0061   mutable std::vector<RooAbsReal*> _compList ; ///<!
0062   mutable std::vector<double>    _compSave ; ///<!
0063   mutable double _funcSave ; ///<!
0064 
0065   ClassDefOverride(RooRealBinding,0) // Function binding to RooAbsReal object
0066 };
0067 
0068 #endif
0069