#include "RooFit.h"
#include "RooArgProxy.h"
#include "RooArgProxy.h"
#include "RooArgSet.h"
#include "RooAbsArg.h"
ClassImp(RooArgProxy)
;
RooArgProxy::RooArgProxy(const char* inName, const char* desc, RooAbsArg* owner, RooAbsArg& arg,
			 Bool_t valueServer, Bool_t shapeServer, Bool_t proxyOwnsArg) : 
  TNamed(inName,desc), _owner(owner), _arg(&arg),
  _valueServer(valueServer), _shapeServer(shapeServer), _ownArg(proxyOwnsArg)
{
  
  _owner->registerProxy(*this) ;
  _isFund = _arg->isFundamental() ;
}
RooArgProxy::RooArgProxy(const char* inName, RooAbsArg* owner, const RooArgProxy& other) : 
  TNamed(inName,inName), RooAbsProxy(other), _owner(owner), _arg(other._arg), 
  _valueServer(other._valueServer), _shapeServer(other._shapeServer),
  _isFund(other._isFund), _ownArg(other._ownArg) 
{
  
  if (_ownArg) {
    _arg = (RooAbsArg*) _arg->Clone() ;
  }
  _owner->registerProxy(*this) ;
}
RooArgProxy::~RooArgProxy()
{
  if (_owner) _owner->unRegisterProxy(*this) ;
  if (_ownArg) delete _arg ;
}
Bool_t RooArgProxy::changePointer(const RooAbsCollection& newServerList, Bool_t nameChange) 
{
  
  RooAbsArg* newArg= _arg->findNewServer(newServerList, nameChange);
  if (newArg) {
    _arg = newArg ;
    _isFund = _arg->isFundamental() ;
  }
  return newArg?kTRUE:kFALSE ;
}
void RooArgProxy::changeDataSet(const RooArgSet* newNormSet) 
{
  RooAbsProxy::changeNormSet(newNormSet) ;
  _arg->setProxyNormSet(newNormSet) ;
}
void RooArgProxy::print(ostream& os, Bool_t addContents) const 
{ 
  os << name() << "=" << (_arg?_arg->GetName():"NULL")  ;
  if (_arg && addContents) {
    os << "=" ;
    _arg->printStream(os,RooPrintable::kValue,RooPrintable::kInline) ;
  }
}
Last change: Tue May 13 17:03:50 2008
Last generated: 2008-05-13 17:03
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.