ROOT  6.06/09
Reference Guide
RooRealProxy.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooRealProxy.h,v 1.23 2007/07/12 20:30:28 wouter 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_REAL_PROXY
17 #define ROO_REAL_PROXY
18 
19 #include "RooAbsReal.h"
20 #include "RooArgProxy.h"
21 #include "RooAbsRealLValue.h"
22 
23 class RooRealProxy : public RooArgProxy {
24 public:
25 
26  // Constructors, assignment etc.
27  RooRealProxy() {} ;
28  RooRealProxy(const char* name, const char* desc, RooAbsArg* owner,
29  Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
30  RooRealProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsReal& ref,
31  Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
32  RooRealProxy(const char* name, RooAbsArg* owner, const RooRealProxy& other) ;
33  virtual TObject* Clone(const char* newName=0) const { return new RooRealProxy(newName,_owner,*this); }
34  virtual ~RooRealProxy();
35 
36  // Accessors
37 #ifndef _WIN32
38  inline operator Double_t() const { return (_arg->_fast && !_arg->_inhibitDirty) ? ((RooAbsReal*)_arg)->_value : ((RooAbsReal*)_arg)->getVal(_nset) ; }
39 #else
40  inline operator Double_t() const { return (_arg->_fast && !_arg->inhibitDirty()) ? ((RooAbsReal*)_arg)->_value : ((RooAbsReal*)_arg)->getVal(_nset) ; }
41 #endif
42 
43  inline const RooAbsReal& arg() const { return (RooAbsReal&)*_arg ; }
44 
45  // Modifier
46  virtual Bool_t setArg(RooAbsReal& newRef) ;
47 
48 protected:
49 
50  RooAbsRealLValue* lvptr() const ;
51 
52 public:
53 
54  // LValue operations
55  RooRealProxy& operator=(const Double_t& value) { lvptr()->setVal(value) ; return *this ; }
56  Double_t min(const char* rname=0) const { return lvptr()->getMin(rname) ; }
57  Double_t max(const char* rname=0) const { return lvptr()->getMax(rname) ; }
58  Bool_t hasMin(const char* rname=0) const { return lvptr()->hasMin(rname) ; }
59  Bool_t hasMax(const char* rname=0) const { return lvptr()->hasMax(rname) ; }
60 
61 
62  ClassDef(RooRealProxy,1) // Proxy for a RooAbsReal object
63 };
64 
65 #endif
RooRealProxy & operator=(const Double_t &value)
Definition: RooRealProxy.h:55
virtual ~RooRealProxy()
Destructor.
virtual const char * name() const
Definition: RooArgProxy.h:42
virtual TObject * Clone(const char *newName=0) const
Make a clone of an object using the Streamer facility.
Definition: RooRealProxy.h:33
virtual Double_t getMin(const char *name=0) const
RooAbsArg * _arg
Definition: RooArgProxy.h:52
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Bool_t _fast
Definition: RooAbsArg.h:571
const RooAbsReal & arg() const
Definition: RooRealProxy.h:43
Bool_t hasMax(const char *name=0) const
#define ClassDef(name, id)
Definition: Rtypes.h:254
RooAbsRealLValue * lvptr() const
Return l-value pointer to contents, if contents is in fact an l-value.
static Bool_t _inhibitDirty
Definition: RooAbsArg.h:553
RooArgSet * _nset
Definition: RooAbsProxy.h:55
virtual Bool_t setArg(RooAbsReal &newRef)
Change object held in proxy into newRef.
Bool_t hasMax(const char *rname=0) const
Definition: RooRealProxy.h:59
virtual void setVal(Double_t value)=0
Bool_t hasMin(const char *name=0) const
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Double_t getMax(const char *name=0) const
Double_t min(const char *rname=0) const
Definition: RooRealProxy.h:56
Bool_t inhibitDirty() const
Delete watch flag.
Definition: RooAbsArg.cxx:83
Bool_t hasMin(const char *rname=0) const
Definition: RooRealProxy.h:58
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
const Bool_t kTRUE
Definition: Rtypes.h:91
RooAbsArg * _owner
Definition: RooArgProxy.h:51
float value
Definition: math.cpp:443
Double_t max(const char *rname=0) const
Definition: RooRealProxy.h:57