Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
21 class RooScaledFunc : public RooAbsFunc {
22 public:
23  inline RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor) :
24  RooAbsFunc(func.getDimension()), _func(&func), _scaleFactor(scaleFactor) { }
25  inline virtual ~RooScaledFunc() { }
26 
27  inline virtual Double_t operator()(const Double_t xvector[]) const {
28  return _scaleFactor*(*_func)(xvector);
29  }
30  inline virtual Double_t getMinLimit(UInt_t index) const { return _func->getMinLimit(index); }
31  inline virtual Double_t getMaxLimit(UInt_t index) const { return _func->getMaxLimit(index); }
32 
33  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const {
34  return _func->plotSamplingHint(obs,xlo,xhi) ;
35  }
36 
37 protected:
38  const RooAbsFunc *_func;
39  Double_t _scaleFactor;
40 
41  ClassDef(RooScaledFunc,0) // Function binding applying scaling to another function binding
42 };
43 
44 #endif
45