Logo ROOT   6.18/05
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
23class RooRealProxy : public RooArgProxy {
24public:
25
26 // Constructors, assignment etc.
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
48protected:
49
50 RooAbsRealLValue* lvptr() const ;
51
52public:
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
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:70
Bool_t _fast
Definition: RooAbsArg.h:620
Bool_t inhibitDirty() const
Delete watch flag.
Definition: RooAbsArg.cxx:84
static Bool_t _inhibitDirty
Definition: RooAbsArg.h:602
RooArgSet * _nset
Definition: RooAbsProxy.h:54
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
Bool_t hasMax(const char *name=0) const
Check if variable has an upper bound.
virtual void setVal(Double_t value)=0
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
RooArgProxy is the abstact interface for RooAbsArg proxy classes.
Definition: RooArgProxy.h:24
RooAbsArg * _owner
Definition: RooArgProxy.h:51
virtual const char * name() const
Definition: RooArgProxy.h:42
RooAbsArg * _arg
Definition: RooArgProxy.h:52
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
Definition: RooRealProxy.h:23
virtual TObject * Clone(const char *newName=0) const
Make a clone of an object using the Streamer facility.
Definition: RooRealProxy.h:33
Bool_t hasMax(const char *rname=0) const
Definition: RooRealProxy.h:59
virtual ~RooRealProxy()
Destructor.
Double_t min(const char *rname=0) const
Definition: RooRealProxy.h:56
Bool_t hasMin(const char *rname=0) const
Definition: RooRealProxy.h:58
const RooAbsReal & arg() const
Definition: RooRealProxy.h:43
virtual Bool_t setArg(RooAbsReal &newRef)
Change object held in proxy into newRef.
RooAbsRealLValue * lvptr() const
Return l-value pointer to contents, if contents is in fact an l-value.
Double_t max(const char *rname=0) const
Definition: RooRealProxy.h:57
RooRealProxy & operator=(const Double_t &value)
Definition: RooRealProxy.h:55
Mother of all ROOT objects.
Definition: TObject.h:37