RooRealProxy.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooRealProxy.h,v 1.23 2007/07/12 20:30:28 wouter 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_REAL_PROXY
00017 #define ROO_REAL_PROXY
00018 
00019 #include "RooAbsReal.h"
00020 #include "RooArgProxy.h"
00021 #include "RooAbsRealLValue.h"
00022 
00023 class RooRealProxy : public RooArgProxy {
00024 public:
00025 
00026   // Constructors, assignment etc.
00027   RooRealProxy() {} ;
00028   RooRealProxy(const char* name, const char* desc, RooAbsArg* owner,
00029                Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
00030   RooRealProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsReal& ref,
00031                Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
00032   RooRealProxy(const char* name, RooAbsArg* owner, const RooRealProxy& other) ;
00033   virtual TObject* Clone(const char* newName=0) const { return new RooRealProxy(newName,_owner,*this); }
00034   virtual ~RooRealProxy();
00035 
00036   // Accessors
00037   inline operator Double_t() const { return _isFund?((RooAbsReal*)_arg)->_value:((RooAbsReal*)_arg)->getVal(_nset) ; }
00038   inline const RooAbsReal& arg() const { return (RooAbsReal&)*_arg ; }
00039 
00040   // Modifier
00041   virtual Bool_t setArg(RooAbsReal& newRef) ;
00042 
00043 protected:
00044 
00045   RooAbsRealLValue* lvptr() const ;
00046 
00047 public:
00048 
00049   // LValue operations 
00050   RooRealProxy& operator=(const Double_t& value) { lvptr()->setVal(value) ; return *this ; }
00051   Double_t min(const char* rname=0) const { return lvptr()->getMin(rname) ; }
00052   Double_t max(const char* rname=0) const { return lvptr()->getMax(rname) ; }
00053   Bool_t hasMin(const char* rname=0) const { return lvptr()->hasMin(rname) ; }
00054   Bool_t hasMax(const char* rname=0) const { return lvptr()->hasMax(rname) ; }
00055 
00056 
00057   ClassDef(RooRealProxy,1) // Proxy for a RooAbsReal object
00058 };
00059 
00060 #endif

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