Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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() = default;
31 RooArgProxy(const char* name, const char* desc, RooAbsArg* owner,
32 bool valueServer, bool shapeServer, bool proxyOwnsArg=false) ;
33 RooArgProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsArg& arg,
34 bool valueServer, bool shapeServer, bool proxyOwnsArg=false) ;
35 RooArgProxy(const char* name, RooAbsArg* owner, const RooArgProxy& other) ;
36 ~RooArgProxy() override ;
37
38 // Delete copy/move construction and assignment, because it will always
39 // result in invalid proxies.
40 RooArgProxy(RooArgProxy const& other) = delete;
41 RooArgProxy(RooArgProxy && other) = delete;
42 RooArgProxy& operator=(RooArgProxy const& other) = delete;
43 RooArgProxy& operator=(RooArgProxy && other) = delete;
44
45 /// Return pointer to contained argument
46 inline RooAbsArg* absArg() const {
47 return _arg ;
48 }
49
50 /// Return name of proxy
51 const char* name() const override {
52 return GetName() ;
53 }
54 void print(std::ostream& os, bool addContents=false) const override ;
55
56 /// Returns the owner of this proxy.
57 RooAbsArg* owner() const { return _owner; }
58
59 /// Returns true of contents is value server of owner
60 inline bool isValueServer() const {
61 return _valueServer ;
62 }
63 /// Returns true if contents is shape server of owner
64 inline bool isShapeServer() const {
65 return _shapeServer ;
66 }
67
68protected:
69
70 friend class RooRealIntegral;
71
72 bool changePointer(const RooAbsCollection& newServerSet, bool nameChange=false, bool factoryInitMode=false) override ;
73 bool changePointer(std::unordered_map<RooAbsArg*, RooAbsArg*> const& replacements) 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:346
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:79
Abstract container object that can hold multiple RooAbsArg objects.
Abstract interface for proxy classes.
Definition RooAbsProxy.h:37
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:64
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:51
RooAbsArg * _owner
Pointer to owner of proxy.
Definition RooArgProxy.h:77
~RooArgProxy() override
Destructor.
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.
RooArgProxy()=default
Default constructor.
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:46
RooAbsArg * owner() const
Returns the owner of this proxy.
Definition RooArgProxy.h:57
RooArgProxy(RooArgProxy const &other)=delete
bool isValueServer() const
Returns true of contents is value server of owner.
Definition RooArgProxy.h:60
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:24
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