Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:18

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooArgProxy.h,v 1.21 2007/07/12 20:30:28 wouter Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_ARG_PROXY
0017 #define ROO_ARG_PROXY
0018 
0019 #include "TNamed.h"
0020 #include "RooAbsProxy.h"
0021 
0022 class RooAbsArg;
0023 
0024 class RooArgProxy : public TNamed, public RooAbsProxy  {
0025 public:
0026 
0027   // Constructors, assignment etc.
0028 
0029   /// Default constructor
0030   RooArgProxy() = default;
0031   RooArgProxy(const char* name, const char* desc, RooAbsArg* owner,
0032          bool valueServer, bool shapeServer, bool proxyOwnsArg=false) ;
0033   RooArgProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsArg& arg,
0034          bool valueServer, bool shapeServer, bool proxyOwnsArg=false) ;
0035   RooArgProxy(const char* name, RooAbsArg* owner, const RooArgProxy& other) ;
0036   ~RooArgProxy() override ;
0037 
0038   // Delete copy/move construction and assignment, because it will always
0039   // result in invalid proxies.
0040   RooArgProxy(RooArgProxy const& other) = delete;
0041   RooArgProxy(RooArgProxy && other) = delete;
0042   RooArgProxy& operator=(RooArgProxy const& other) = delete;
0043   RooArgProxy& operator=(RooArgProxy && other) = delete;
0044 
0045   /// Return pointer to contained argument
0046   inline RooAbsArg* absArg() const {
0047     return _arg ;
0048   }
0049 
0050   /// Return name of proxy
0051   const char* name() const override {
0052     return GetName() ;
0053   }
0054   void print(std::ostream& os, bool addContents=false) const override ;
0055 
0056   /// Returns the owner of this proxy.
0057   RooAbsArg* owner() const { return _owner; }
0058 
0059   /// Returns true of contents is value server of owner
0060   inline bool isValueServer() const {
0061     return _valueServer ;
0062   }
0063   /// Returns true if contents is shape server of owner
0064   inline bool isShapeServer() const {
0065     return _shapeServer ;
0066   }
0067 
0068 protected:
0069 
0070   friend class RooRealIntegral;
0071 
0072   bool changePointer(const RooAbsCollection& newServerSet, bool nameChange=false, bool factoryInitMode=false) override ;
0073   bool changePointer(std::unordered_map<RooAbsArg*, RooAbsArg*> const& replacements) override;
0074 
0075   virtual void changeDataSet(const RooArgSet* newNormSet) ;
0076 
0077   RooAbsArg* _owner = nullptr;  ///< Pointer to owner of proxy
0078   RooAbsArg* _arg = nullptr;    ///< Pointer to content of proxy
0079 
0080   bool _valueServer = false;    ///< If true contents is value server of owner
0081   bool _shapeServer = false;    ///< If true contents is shape server of owner
0082   bool _isFund = true;          ///< If true proxy contains an lvalue
0083   bool _ownArg = false;         ///< If true proxy owns contents
0084 
0085   ClassDefOverride(RooArgProxy,1) // Abstract proxy for RooAbsArg objects
0086 };
0087 
0088 #endif
0089