Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooScaledFunc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooScaledFunc.h,v 1.6 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_SCALED_FUNC
17#define ROO_SCALED_FUNC
18
19#include "RooAbsFunc.h"
20#include <list>
21
22class RooScaledFunc : public RooAbsFunc {
23public:
24 inline RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor) :
25 RooAbsFunc(func.getDimension()), _func(&func), _scaleFactor(scaleFactor) { }
26 inline virtual ~RooScaledFunc() { }
27
28 inline virtual Double_t operator()(const Double_t xvector[]) const {
29 return _scaleFactor*(*_func)(xvector);
30 }
31 inline virtual Double_t getMinLimit(UInt_t index) const { return _func->getMinLimit(index); }
32 inline virtual Double_t getMaxLimit(UInt_t index) const { return _func->getMaxLimit(index); }
33
34 virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const {
35 return _func->plotSamplingHint(obs,xlo,xhi) ;
36 }
37
38protected:
41
42 ClassDef(RooScaledFunc,0) // Function binding applying scaling to another function binding
43};
44
45#endif
46
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
virtual Double_t getMinLimit(UInt_t dimension) const =0
virtual Double_t getMaxLimit(UInt_t dimension) const =0
UInt_t getDimension() const
Definition RooAbsFunc.h:33
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition RooAbsFunc.h:73
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Lightweight RooAbsFunction implementation that applies a constant scale factor to another RooAbsFunc.
const RooAbsFunc * _func
virtual ~RooScaledFunc()
virtual Double_t getMaxLimit(UInt_t index) const
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
virtual Double_t operator()(const Double_t xvector[]) const
virtual Double_t getMinLimit(UInt_t index) const
Double_t _scaleFactor
RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor)