00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooInvTransform.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_INV_TRANSFORM 00017 #define ROO_INV_TRANSFORM 00018 00019 #include "RooAbsFunc.h" 00020 00021 class RooInvTransform : public RooAbsFunc { 00022 public: 00023 RooInvTransform(const RooAbsFunc &func); 00024 inline virtual ~RooInvTransform() { } 00025 00026 inline virtual Double_t operator()(const Double_t xvector[]) const { 00027 Double_t xinv= 1./xvector[0]; 00028 return (*_func)(&xinv)*xinv*xinv; 00029 } 00030 inline virtual Double_t getMinLimit(UInt_t index) const { return 1/_func->getMaxLimit(index); } 00031 inline virtual Double_t getMaxLimit(UInt_t index) const { return 1/_func->getMinLimit(index); } 00032 00033 protected: 00034 const RooAbsFunc *_func; // Input function binding 00035 00036 ClassDef(RooInvTransform,0) // Function binding returning inverse of other function binding 00037 }; 00038 00039 #endif 00040