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
22class RooAbsArg;
23
24class RooArgProxy : public TNamed, public RooAbsProxy {
25public:
26
27 // Constructors, assignment etc.
28
29 /// Default constructor
30 RooArgProxy() : _owner(nullptr), _arg(nullptr), _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 // Delete copy/move construction and assignment, because it will always
40 // result in invalid proxies.
41 RooArgProxy(RooArgProxy const& other) = delete;
42 RooArgProxy(RooArgProxy && other) = delete;
43 RooArgProxy& operator=(RooArgProxy const& other) = delete;
44 RooArgProxy& operator=(RooArgProxy && other) = delete;
45
46 /// Return pointer to contained argument
47 inline RooAbsArg* absArg() const {
48 return _arg ;
49 }
50
51 /// Return name of proxy
52 const char* name() const override {
53 return GetName() ;
54 }
55 void print(std::ostream& os, bool addContents=false) const override ;
56
57 /// Returns the owner of this proxy.
58 RooAbsArg* owner() const { return _owner; }
59
60 /// Returns true of contents is value server of owner
61 inline bool isValueServer() const {
62 return _valueServer ;
63 }
64 /// Returns true if contents is shape server of owner
65 inline bool isShapeServer() const {
66 return _shapeServer ;
67 }
68
69protected:
70
71 friend class RooRealIntegral;
72
73 bool changePointer(const RooAbsCollection& newServerSet, bool nameChange=false, bool factoryInitMode=false) override ;
74
75 virtual void changeDataSet(const RooArgSet* newNormSet) ;
76
77 RooAbsArg* _owner = nullptr; ///< Pointer to owner of proxy
78 RooAbsArg* _arg = nullptr; ///< Pointer to content of proxy
79
80 bool _valueServer = false; ///< If true contents is value server of owner
81 bool _shapeServer = false; ///< If true contents is shape server of owner
82 bool _isFund = true; ///< If true proxy contains an lvalue
83 bool _ownArg = false; ///< If true proxy owns contents
84
85 ClassDefOverride(RooArgProxy,1) // Abstract proxy for RooAbsArg objects
86};
87
88#endif
89
#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:71
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:33
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:65
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:52
RooAbsArg * _owner
Pointer to owner of proxy.
Definition: RooArgProxy.h:77
~RooArgProxy() override
Destructor.
Definition: RooArgProxy.cxx:93
bool _ownArg
If true proxy owns contents.
Definition: RooArgProxy.h:83
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:82
bool _valueServer
If true contents is value server of owner.
Definition: RooArgProxy.h:80
RooAbsArg * absArg() const
Return pointer to contained argument.
Definition: RooArgProxy.h:47
RooAbsArg * owner() const
Returns the owner of this proxy.
Definition: RooArgProxy.h:58
RooArgProxy()
Default constructor.
Definition: RooArgProxy.h:30
RooArgProxy(RooArgProxy const &other)=delete
bool isValueServer() const
Returns true of contents is value server of owner.
Definition: RooArgProxy.h:61
RooAbsArg * _arg
Pointer to content of proxy.
Definition: RooArgProxy.h:78
bool _shapeServer
If true contents is shape server of owner.
Definition: RooArgProxy.h:81
RooArgProxy & operator=(RooArgProxy &&other)=delete
RooArgProxy & operator=(RooArgProxy const &other)=delete
RooArgProxy(RooArgProxy &&other)=delete
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:56
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
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