Logo ROOT  
Reference Guide
RooArgProxy.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooArgProxy.h,v 1.21 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_ARG_PROXY
17#define ROO_ARG_PROXY
18
19#include "TNamed.h"
20#include "RooAbsProxy.h"
21#include "RooAbsArg.h"
22
23
24class RooArgProxy : public TNamed, public RooAbsProxy {
25public:
26
27 // Constructors, assignment etc.
28
29 /// Default constructor
30 RooArgProxy() : _owner(0), _arg(0), _valueServer(false), _shapeServer(false), _isFund(true), _ownArg(false) {
31 } ;
32 RooArgProxy(const char* name, const char* desc, RooAbsArg* owner,
33 bool valueServer, bool shapeServer, bool proxyOwnsArg=false) ;
34 RooArgProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsArg& arg,
35 bool valueServer, bool shapeServer, bool proxyOwnsArg=false) ;
36 RooArgProxy(const char* name, RooAbsArg* owner, const RooArgProxy& other) ;
37 ~RooArgProxy() override ;
38
39 /// Return pointer to contained argument
40 inline RooAbsArg* absArg() const {
41 return _arg ;
42 }
43
44 /// Return name of proxy
45 const char* name() const override {
46 return GetName() ;
47 }
48 void print(std::ostream& os, bool addContents=false) const override ;
49
50 /// Returns the owner of this proxy.
51 RooAbsArg* owner() const { return _owner; }
52
53protected:
54
55 friend class RooSimultaneous ;
56 RooAbsArg* _owner ; ///< Pointer to owner of proxy
57 RooAbsArg* _arg ; ///< Pointer to content of proxy
58
59 bool _valueServer ; ///< If true contents is value server of owner
60 bool _shapeServer ; ///< If true contents is shape server of owner
61 bool _isFund ; ///< If true proxy contains an lvalue
62 bool _ownArg ; ///< If true proxy owns contents
63
64 friend class RooAbsArg ;
65
66 /// Returns true of contents is value server of owner
67 inline bool isValueServer() const {
68 return _valueServer ;
69 }
70 /// Returns true if contents is shape server of owner
71 inline bool isShapeServer() const {
72 return _shapeServer ;
73 }
74 bool changePointer(const RooAbsCollection& newServerSet, bool nameChange=false, bool factoryInitMode=false) override ;
75
76 virtual void changeDataSet(const RooArgSet* newNormSet) ;
77
78 ClassDefOverride(RooArgProxy,1) // Abstract proxy for RooAbsArg objects
79};
80
81#endif
82
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:30
RooArgProxy is the abstract interface for RooAbsArg proxy classes.
Definition: RooArgProxy.h:24
bool isShapeServer() const
Returns true if contents is shape server of owner.
Definition: RooArgProxy.h:71
void print(std::ostream &os, bool addContents=false) const override
Print the name of the proxy on ostream.
const char * name() const override
Return name of proxy.
Definition: RooArgProxy.h:45
RooAbsArg * _owner
Pointer to owner of proxy.
Definition: RooArgProxy.h:56
~RooArgProxy() override
Destructor.
Definition: RooArgProxy.cxx:93
bool _ownArg
If true proxy owns contents.
Definition: RooArgProxy.h:62
virtual void changeDataSet(const RooArgSet *newNormSet)
Change the normalization set that should be offered to the content objects getVal() when evaluated.
bool _isFund
If true proxy contains an lvalue.
Definition: RooArgProxy.h:61
bool _valueServer
If true contents is value server of owner.
Definition: RooArgProxy.h:59
RooAbsArg * absArg() const
Return pointer to contained argument.
Definition: RooArgProxy.h:40
RooAbsArg * owner() const
Returns the owner of this proxy.
Definition: RooArgProxy.h:51
RooArgProxy()
Default constructor.
Definition: RooArgProxy.h:30
bool isValueServer() const
Returns true of contents is value server of owner.
Definition: RooArgProxy.h:67
RooAbsArg * _arg
Pointer to content of proxy.
Definition: RooArgProxy.h:57
bool _shapeServer
If true contents is shape server of owner.
Definition: RooArgProxy.h:60
bool changePointer(const RooAbsCollection &newServerSet, bool nameChange=false, bool factoryInitMode=false) override
Change proxied object to object of same name in given list.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47