RooScaledFunc.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooScaledFunc.h,v 1.6 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_SCALED_FUNC
00017 #define ROO_SCALED_FUNC
00018 
00019 #include "RooAbsFunc.h"
00020 
00021 class RooScaledFunc : public RooAbsFunc {
00022 public:
00023   inline RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor) :
00024     RooAbsFunc(func.getDimension()), _func(&func), _scaleFactor(scaleFactor) { }
00025   inline virtual ~RooScaledFunc() { }
00026 
00027   inline virtual Double_t operator()(const Double_t xvector[]) const {
00028     return _scaleFactor*(*_func)(xvector);
00029   }
00030   inline virtual Double_t getMinLimit(UInt_t index) const { return _func->getMinLimit(index); }
00031   inline virtual Double_t getMaxLimit(UInt_t index) const { return _func->getMaxLimit(index); }
00032 
00033   virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const {
00034     return _func->plotSamplingHint(obs,xlo,xhi) ; 
00035   }
00036 
00037 protected:
00038   const RooAbsFunc *_func;
00039   Double_t _scaleFactor;
00040 
00041   ClassDef(RooScaledFunc,0) // Function binding applying scaling to another function binding
00042 };
00043 
00044 #endif
00045 

Generated on Tue Jul 5 14:26:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1