ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooScaledFunc.h,v 1.6 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_SCALED_FUNC
#define ROO_SCALED_FUNC

#include "RooAbsFunc.h"

class RooScaledFunc : public RooAbsFunc {
public:
  inline RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor) :
    RooAbsFunc(func.getDimension()), _func(&func), _scaleFactor(scaleFactor) { }
  inline virtual ~RooScaledFunc() { }

  inline virtual Double_t operator()(const Double_t xvector[]) const {
    return _scaleFactor*(*_func)(xvector);
  }
  inline virtual Double_t getMinLimit(UInt_t index) const { return _func->getMinLimit(index); }
  inline virtual Double_t getMaxLimit(UInt_t index) const { return _func->getMaxLimit(index); }

  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const {
    return _func->plotSamplingHint(obs,xlo,xhi) ; 
  }

protected:
  const RooAbsFunc *_func;
  Double_t _scaleFactor;

  ClassDef(RooScaledFunc,0) // Function binding applying scaling to another function binding
};

#endif

 RooScaledFunc.h:1
 RooScaledFunc.h:2
 RooScaledFunc.h:3
 RooScaledFunc.h:4
 RooScaledFunc.h:5
 RooScaledFunc.h:6
 RooScaledFunc.h:7
 RooScaledFunc.h:8
 RooScaledFunc.h:9
 RooScaledFunc.h:10
 RooScaledFunc.h:11
 RooScaledFunc.h:12
 RooScaledFunc.h:13
 RooScaledFunc.h:14
 RooScaledFunc.h:15
 RooScaledFunc.h:16
 RooScaledFunc.h:17
 RooScaledFunc.h:18
 RooScaledFunc.h:19
 RooScaledFunc.h:20
 RooScaledFunc.h:21
 RooScaledFunc.h:22
 RooScaledFunc.h:23
 RooScaledFunc.h:24
 RooScaledFunc.h:25
 RooScaledFunc.h:26
 RooScaledFunc.h:27
 RooScaledFunc.h:28
 RooScaledFunc.h:29
 RooScaledFunc.h:30
 RooScaledFunc.h:31
 RooScaledFunc.h:32
 RooScaledFunc.h:33
 RooScaledFunc.h:34
 RooScaledFunc.h:35
 RooScaledFunc.h:36
 RooScaledFunc.h:37
 RooScaledFunc.h:38
 RooScaledFunc.h:39
 RooScaledFunc.h:40
 RooScaledFunc.h:41
 RooScaledFunc.h:42
 RooScaledFunc.h:43
 RooScaledFunc.h:44
 RooScaledFunc.h:45