Logo ROOT  
Reference Guide
RooAbsArg.cxx
Go to the documentation of this file.
1 /******************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * @(#)root/roofitcore:$Id$
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 
17 //////////////////////////////////////////////////////////////////////////////
18 /** \class RooAbsArg
19  \ingroup Roofitcore
20 
21 RooAbsArg is the common abstract base class for objects that
22 represent a value (of arbitrary type) and "shape" that in general
23 depends on (is a client of) other RooAbsArg subclasses. The only
24 state information about a value that is maintained in this base
25 class consists of named attributes and flags that track when either
26 the value or the shape of this object changes. The meaning of shape
27 depends on the client implementation but could be, for example, the
28 allowed range of a value. The base class is also responsible for
29 managing client/server links and propagating value/shape changes
30 through an expression tree. RooAbsArg implements public interfaces
31 for inspecting client/server relationships and
32 setting/clearing/testing named attributes.
33 
34 */
35 
36 #include "RooFit.h"
37 
38 #include "TBuffer.h"
39 #include "TClass.h"
40 #include "TVirtualStreamerInfo.h"
41 #include "strlcpy.h"
42 
43 #include "RooSecondMoment.h"
44 #include "RooNameSet.h"
45 #include "RooWorkspace.h"
46 
47 #include "RooMsgService.h"
48 #include "RooAbsArg.h"
49 #include "RooArgSet.h"
50 #include "RooArgProxy.h"
51 #include "RooSetProxy.h"
52 #include "RooListProxy.h"
53 #include "RooAbsData.h"
54 #include "RooAbsCategoryLValue.h"
55 #include "RooAbsRealLValue.h"
56 #include "RooTrace.h"
57 #include "RooRealIntegral.h"
58 #include "RooConstVar.h"
60 #include "RooAbsDataStore.h"
61 #include "RooResolutionModel.h"
62 #include "RooVectorDataStore.h"
63 #include "RooTreeDataStore.h"
64 #include "ROOT/RMakeUnique.hxx"
65 
66 #include <iostream>
67 #include <fstream>
68 #include <sstream>
69 #include <cstring>
70 #include <algorithm>
71 
72 using namespace std;
73 
74 #if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
75 char* operator+( streampos&, char* );
76 #endif
77 
79 ;
80 
83 Bool_t RooAbsArg::inhibitDirty() const { return _inhibitDirty && !_localNoInhibitDirty; }
84 
85 std::map<RooAbsArg*,std::unique_ptr<TRefArray>> RooAbsArg::_ioEvoList;
86 std::stack<RooAbsArg*> RooAbsArg::_ioReadStack ;
87 
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Default constructor
91 
93  : TNamed(), _deleteWatch(kFALSE), _valueDirty(kTRUE), _shapeDirty(kTRUE), _operMode(Auto), _fast(kFALSE), _ownedComponents(nullptr),
94  _prohibitServerRedirect(kFALSE), _eocache(0), _namePtr(0), _isConstant(kFALSE), _localNoInhibitDirty(kFALSE),
95  _myws(0)
96 {
98 
99 }
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// Create an object with the specified name and descriptive title.
103 /// The newly created object has no clients or servers and has its
104 /// dirty flags set.
105 
106 RooAbsArg::RooAbsArg(const char *name, const char *title)
107  : TNamed(name, title), _deleteWatch(kFALSE), _valueDirty(kTRUE), _shapeDirty(kTRUE), _operMode(Auto), _fast(kFALSE),
108  _ownedComponents(0), _prohibitServerRedirect(kFALSE), _eocache(0), _namePtr(0), _isConstant(kFALSE),
109  _localNoInhibitDirty(kFALSE), _myws(0)
110 {
111  if (name == nullptr || strlen(name) == 0) {
112  throw std::logic_error("Each RooFit object needs a name. "
113  "Objects representing the same entity (e.g. an observable 'x') are identified using their name.");
114  }
116 }
117 
118 ////////////////////////////////////////////////////////////////////////////////
119 /// Copy constructor transfers all boolean and string properties of the original
120 /// object. Transient properties and client-server links are not copied
121 
122 RooAbsArg::RooAbsArg(const RooAbsArg &other, const char *name)
123  : TNamed(other.GetName(), other.GetTitle()), RooPrintable(other), _boolAttrib(other._boolAttrib),
124  _stringAttrib(other._stringAttrib), _deleteWatch(other._deleteWatch), _operMode(Auto), _fast(kFALSE),
125  _ownedComponents(0), _prohibitServerRedirect(kFALSE), _eocache(other._eocache), _namePtr(other._namePtr),
126  _isConstant(other._isConstant), _localNoInhibitDirty(other._localNoInhibitDirty), _myws(0)
127 {
128  // Use name in argument, if supplied
129  if (name) {
132  } else {
133  // Same name, don't recalculate name pointer (expensive)
134  TNamed::SetName(other.GetName()) ;
135  _namePtr = other._namePtr ;
136  }
137 
138  // Copy server list by hand
139  Bool_t valueProp, shapeProp ;
140  for (const auto server : other._serverList) {
141  valueProp = server->_clientListValue.containsByNamePtr(&other);
142  shapeProp = server->_clientListShape.containsByNamePtr(&other);
143  addServer(*server,valueProp,shapeProp) ;
144  }
145 
146  setValueDirty() ;
147  setShapeDirty() ;
148 
149  //setAttribute(Form("CloneOf(%08x)",&other)) ;
150  //cout << "RooAbsArg::cctor(" << this << ") #bools = " << _boolAttrib.size() << " #strings = " << _stringAttrib.size() << endl ;
151 
152 }
153 
154 ////////////////////////////////////////////////////////////////////////////////
155 /// Assign all boolean and string properties of the original
156 /// object. Transient properties and client-server links are not assigned.
158  TNamed::operator=(other);
160  _boolAttrib = other._boolAttrib;
162  _deleteWatch = other._deleteWatch;
163  _operMode = other._operMode;
164  _fast = other._fast;
165  _ownedComponents = nullptr;
167  _eocache = other._eocache;
168  _namePtr = other._namePtr;
169  _isConstant = other._isConstant;
171  _myws = nullptr;
172 
173  bool valueProp, shapeProp;
174  for (const auto server : other._serverList) {
175  valueProp = server->_clientListValue.containsByNamePtr(&other);
176  shapeProp = server->_clientListShape.containsByNamePtr(&other);
177  addServer(*server,valueProp,shapeProp) ;
178  }
179 
180  setValueDirty();
181  setShapeDirty();
182 
183  return *this;
184 }
185 
186 
187 ////////////////////////////////////////////////////////////////////////////////
188 /// Destructor.
189 
191 {
192  // Notify all servers that they no longer need to serve us
193  while (!_serverList.empty()) {
195  }
196 
197  // Notify all clients that they are in limbo
198  std::vector<RooAbsArg*> clientListTmp(_clientList.begin(), _clientList.end()); // have to copy, as we invalidate iterators
199  Bool_t first(kTRUE) ;
200  for (auto client : clientListTmp) {
201  client->setAttribute("ServerDied") ;
202  TString attr("ServerDied:");
203  attr.Append(GetName());
204  attr.Append(Form("(%lx)",(ULong_t)this)) ;
205  client->setAttribute(attr.Data());
206  client->removeServer(*this,kTRUE);
207 
208  if (_verboseDirty) {
209 
210  if (first) {
211  cxcoutD(Tracing) << "RooAbsArg::dtor(" << GetName() << "," << this << ") DeleteWatch: object is being destroyed" << endl ;
212  first = kFALSE ;
213  }
214 
215  cxcoutD(Tracing) << fName << "::" << ClassName() << ":~RooAbsArg: dependent \""
216  << client->GetName() << "\" should have been deleted first" << endl ;
217  }
218  }
219 
220  if (_ownedComponents) {
221  delete _ownedComponents ;
222  _ownedComponents = 0 ;
223  }
224 
225 }
226 
227 
228 ////////////////////////////////////////////////////////////////////////////////
229 /// Control global dirty inhibit mode. When set to true no value or shape dirty
230 /// flags are propagated and cache is always considered to be dirty.
231 
233 {
234  _inhibitDirty = flag ;
235 }
236 
237 
238 ////////////////////////////////////////////////////////////////////////////////
239 /// Activate verbose messaging related to dirty flag propagation
240 
242 {
243  _verboseDirty = flag ;
244 }
245 
246 ////////////////////////////////////////////////////////////////////////////////
247 /// Check if this object was created as a clone of 'other'
248 
250 {
251  return (getAttribute(Form("CloneOf(%lx)",(ULong_t)&other)) ||
252  other.getAttribute(Form("CloneOf(%lx)",(ULong_t)this))) ;
253 }
254 
255 
256 ////////////////////////////////////////////////////////////////////////////////
257 /// Set (default) or clear a named boolean attribute of this object.
258 
260 {
261  // Preserve backward compatibility - any strong
262  if(string("Constant")==name) {
263  _isConstant = value ;
264  }
265 
266  if (value) {
267  _boolAttrib.insert(name) ;
268  } else {
269  set<string>::iterator iter = _boolAttrib.find(name) ;
270  if (iter != _boolAttrib.end()) {
271  _boolAttrib.erase(iter) ;
272  }
273 
274  }
275 
276 }
277 
278 
279 ////////////////////////////////////////////////////////////////////////////////
280 /// Check if a named attribute is set. By default, all attributes are unset.
281 
283 {
284  return (_boolAttrib.find(name) != _boolAttrib.end()) ;
285 }
286 
287 
288 ////////////////////////////////////////////////////////////////////////////////
289 /// Associate string 'value' to this object under key 'key'
290 
291 void RooAbsArg::setStringAttribute(const Text_t* key, const Text_t* value)
292 {
293  if (value) {
294  _stringAttrib[key] = value ;
295  } else {
296  _stringAttrib.erase(key) ;
297  }
298 }
299 
300 ////////////////////////////////////////////////////////////////////////////////
301 /// Get string attribute mapped under key 'key'. Returns null pointer
302 /// if no attribute exists under that key
303 
305 {
306  map<string,string>::const_iterator iter = _stringAttrib.find(key) ;
307  if (iter!=_stringAttrib.end()) {
308  return iter->second.c_str() ;
309  } else {
310  return 0 ;
311  }
312 }
313 
314 
315 ////////////////////////////////////////////////////////////////////////////////
316 /// Set (default) or clear a named boolean attribute of this object.
317 
319 {
320  if (value) {
321 
322  _boolAttribTransient.insert(name) ;
323 
324  } else {
325 
326  set<string>::iterator iter = _boolAttribTransient.find(name) ;
327  if (iter != _boolAttribTransient.end()) {
328  _boolAttribTransient.erase(iter) ;
329  }
330 
331  }
332 
333 }
334 
335 
336 ////////////////////////////////////////////////////////////////////////////////
337 /// Check if a named attribute is set. By default, all attributes
338 /// are unset.
339 
341 {
342  return (_boolAttribTransient.find(name) != _boolAttribTransient.end()) ;
343 }
344 
345 
346 
347 
348 ////////////////////////////////////////////////////////////////////////////////
349 /// Register another RooAbsArg as a server to us, ie, declare that
350 /// we depend on it.
351 /// \param server The server to be registered.
352 /// \param valueProp In addition to the basic client-server relationship, declare dependence on the server's value.
353 /// \param valueProp In addition to the basic client-server relationship, declare dependence on the server's shape.
354 /// \param refCount Optionally add with higher reference count (if multiple components depend on it)
355 
356 void RooAbsArg::addServer(RooAbsArg& server, Bool_t valueProp, Bool_t shapeProp, std::size_t refCount)
357 {
359  cxcoutF(LinkStateMgmt) << "RooAbsArg::addServer(" << this << "," << GetName()
360  << "): PROHIBITED SERVER ADDITION REQUESTED: adding server " << server.GetName()
361  << "(" << &server << ") for " << (valueProp?"value ":"") << (shapeProp?"shape":"") << endl ;
362  throw std::logic_error("PROHIBITED SERVER ADDITION REQUESTED in RooAbsArg::addServer");
363  }
364 
365  cxcoutD(LinkStateMgmt) << "RooAbsArg::addServer(" << this << "," << GetName() << "): adding server " << server.GetName()
366  << "(" << &server << ") for " << (valueProp?"value ":"") << (shapeProp?"shape":"") << endl ;
367 
368  if (server.operMode()==ADirty && operMode()!=ADirty && valueProp) {
370  }
371 
372 
373  // LM: use hash tables for larger lists
374 // if (_serverList.GetSize() > 999 && _serverList.getHashTableSize() == 0) _serverList.setHashTableSize(1000);
375 // if (server._clientList.GetSize() > 999 && server._clientList.getHashTableSize() == 0) server._clientList.setHashTableSize(1000);
376 // if (server._clientListValue.GetSize() > 999 && server._clientListValue.getHashTableSize() == 0) server._clientListValue.setHashTableSize(1000);
377 
378  // Add server link to given server
379  _serverList.Add(&server, refCount) ;
380 
381  server._clientList.Add(this, refCount);
382  if (valueProp) server._clientListValue.Add(this, refCount);
383  if (shapeProp) server._clientListShape.Add(this, refCount);
384 }
385 
386 
387 
388 ////////////////////////////////////////////////////////////////////////////////
389 /// Register a list of RooAbsArg as servers to us by calling
390 /// addServer() for each arg in the list
391 
392 void RooAbsArg::addServerList(RooAbsCollection& serverList, Bool_t valueProp, Bool_t shapeProp)
393 {
394  _serverList.reserve(_serverList.size() + serverList.size());
395 
396  for (const auto arg : serverList) {
397  addServer(*arg,valueProp,shapeProp) ;
398  }
399 }
400 
401 
402 
403 ////////////////////////////////////////////////////////////////////////////////
404 /// Unregister another RooAbsArg as a server to us, ie, declare that
405 /// we no longer depend on its value and shape.
406 
408 {
410  cxcoutF(LinkStateMgmt) << "RooAbsArg::addServer(" << this << "," << GetName() << "): PROHIBITED SERVER REMOVAL REQUESTED: removing server "
411  << server.GetName() << "(" << &server << ")" << endl ;
412  assert(0) ;
413  }
414 
415  if (_verboseDirty) {
416  cxcoutD(LinkStateMgmt) << "RooAbsArg::removeServer(" << GetName() << "): removing server "
417  << server.GetName() << "(" << &server << ")" << endl ;
418  }
419 
420  // Remove server link to given server
421  _serverList.Remove(&server, force) ;
422 
423  server._clientList.Remove(this, force) ;
424  server._clientListValue.Remove(this, force) ;
425  server._clientListShape.Remove(this, force) ;
426 }
427 
428 
429 ////////////////////////////////////////////////////////////////////////////////
430 /// Replace 'oldServer' with 'newServer'
431 
432 void RooAbsArg::replaceServer(RooAbsArg& oldServer, RooAbsArg& newServer, Bool_t propValue, Bool_t propShape)
433 {
434  Int_t count = _serverList.refCount(&oldServer);
435  removeServer(oldServer, kTRUE);
436  addServer(newServer, propValue, propShape, count);
437 }
438 
439 
440 ////////////////////////////////////////////////////////////////////////////////
441 /// Change dirty flag propagation mask for specified server
442 
443 void RooAbsArg::changeServer(RooAbsArg& server, Bool_t valueProp, Bool_t shapeProp)
444 {
445  if (!_serverList.containsByNamePtr(&server)) {
446  coutE(LinkStateMgmt) << "RooAbsArg::changeServer(" << GetName() << "): Server "
447  << server.GetName() << " not registered" << endl ;
448  return ;
449  }
450 
451  // This condition should not happen, but check anyway
452  if (!server._clientList.containsByNamePtr(this)) {
453  coutE(LinkStateMgmt) << "RooAbsArg::changeServer(" << GetName() << "): Server "
454  << server.GetName() << " doesn't have us registered as client" << endl ;
455  return ;
456  }
457 
458  // Remove all propagation links, then reinstall requested ones ;
459  Int_t vcount = server._clientListValue.refCount(this) ;
460  Int_t scount = server._clientListShape.refCount(this) ;
461  server._clientListValue.RemoveAll(this) ;
462  server._clientListShape.RemoveAll(this) ;
463  if (valueProp) {
464  server._clientListValue.Add(this, vcount) ;
465  }
466  if (shapeProp) {
467  server._clientListShape.Add(this, scount) ;
468  }
469 }
470 
471 
472 
473 ////////////////////////////////////////////////////////////////////////////////
474 /// Fill supplied list with all leaf nodes of the arg tree, starting with
475 /// ourself as top node. A leaf node is node that has no servers declared.
476 
477 void RooAbsArg::leafNodeServerList(RooAbsCollection* list, const RooAbsArg* arg, Bool_t recurseNonDerived) const
478 {
479  treeNodeServerList(list,arg,kFALSE,kTRUE,kFALSE,recurseNonDerived) ;
480 }
481 
482 
483 
484 ////////////////////////////////////////////////////////////////////////////////
485 /// Fill supplied list with all branch nodes of the arg tree starting with
486 /// ourself as top node. A branch node is node that has one or more servers declared.
487 
488 void RooAbsArg::branchNodeServerList(RooAbsCollection* list, const RooAbsArg* arg, Bool_t recurseNonDerived) const
489 {
490  treeNodeServerList(list,arg,kTRUE,kFALSE,kFALSE,recurseNonDerived) ;
491 }
492 
493 
494 ////////////////////////////////////////////////////////////////////////////////
495 /// Fill supplied list with nodes of the arg tree, following all server links,
496 /// starting with ourself as top node.
497 /// \param[in] list Output list
498 /// \param[in] arg Start searching at this element of the tree.
499 /// \param[in] doBranch Add branch nodes to the list.
500 /// \param[in] doLeaf Add leaf nodes to the list.
501 /// \param[in] valueOnly Only check if an element is a value server (no shape server).
502 /// \param[in] recurseFundamental
503 
504 void RooAbsArg::treeNodeServerList(RooAbsCollection* list, const RooAbsArg* arg, Bool_t doBranch, Bool_t doLeaf, Bool_t valueOnly, Bool_t recurseFundamental) const
505 {
506 // if (arg==0) {
507 // cout << "treeNodeServerList(" << GetName() << ") doBranch=" << (doBranch?"T":"F") << " doLeaf = " << (doLeaf?"T":"F") << " valueOnly=" << (valueOnly?"T":"F") << endl ;
508 // }
509 
510  if (!arg) {
511  list->reserve(10);
512  arg=this ;
513  }
514 
515  // Decide if to add current node
516  if ((doBranch&&doLeaf) ||
517  (doBranch&&arg->isDerived()) ||
518  (doLeaf&&arg->isFundamental()&&(!(recurseFundamental&&arg->isDerived()))) ||
519  (doLeaf && !arg->isFundamental() && !arg->isDerived())) {
520 
521  list->add(*arg,kTRUE) ;
522  }
523 
524  // Recurse if current node is derived
525  if (arg->isDerived() && (!arg->isFundamental() || recurseFundamental)) {
526  for (const auto server : arg->_serverList) {
527 
528  // Skip non-value server nodes if requested
529  Bool_t isValueSrv = server->_clientListValue.containsByNamePtr(arg);
530  if (valueOnly && !isValueSrv) {
531  continue ;
532  }
533  treeNodeServerList(list,server,doBranch,doLeaf,valueOnly,recurseFundamental) ;
534  }
535  }
536 }
537 
538 
539 ////////////////////////////////////////////////////////////////////////////////
540 /// Create a list of leaf nodes in the arg tree starting with
541 /// ourself as top node that don't match any of the names of the variable list
542 /// of the supplied data set (the dependents). The caller of this
543 /// function is responsible for deleting the returned argset.
544 /// The complement of this function is getObservables()
545 
546 RooArgSet* RooAbsArg::getParameters(const RooAbsData* set, Bool_t stripDisconnected) const
547 {
548  return getParameters(set?set->get():0,stripDisconnected) ;
549 }
550 
551 
552 ////////////////////////////////////////////////////////////////////////////////
553 /// INTERNAL helper function for getParameters()
554 
555 void RooAbsArg::addParameters(RooArgSet& params, const RooArgSet* nset,Bool_t stripDisconnected) const
556 {
557  // INTERNAL helper function for getParameters()
558 
559  RooArgSet nodeParamServers ;
560  RooArgSet nodeBranchServers ;
561  for (const auto server : _serverList) {
562  if (server->isValueServer(*this)) {
563  if (server->isFundamental()) {
564  if (!nset || !server->dependsOn(*nset)) {
565  nodeParamServers.add(*server) ;
566  }
567  } else {
568  nodeBranchServers.add(*server) ;
569  }
570  }
571  }
572 
573  // Allow pdf to strip parameters from list before adding it
574  getParametersHook(nset,&nodeParamServers,stripDisconnected) ;
575 
576  // Add parameters of this node to the combined list
577  params.add(nodeParamServers,kTRUE) ;
578 
579  // Now recurse into branch servers
580  for (const auto server : nodeBranchServers) {
581  server->addParameters(params,nset) ;
582  }
583 }
584 
585 
586 ////////////////////////////////////////////////////////////////////////////////
587 /// Create a list of leaf nodes in the arg tree starting with
588 /// ourself as top node that don't match any of the names the args in the
589 /// supplied argset. The caller of this function is responsible
590 /// for deleting the returned argset. The complement of this function
591 /// is getObservables()
592 
593 RooArgSet* RooAbsArg::getParameters(const RooArgSet* nset, Bool_t stripDisconnected) const
594 {
595 
596  // Check for cached parameter set
597  if (_myws) {
598  RooNameSet nsetObs(nset ? *nset : RooArgSet());
599  const RooArgSet *paramSet = _myws->set(Form("CACHE_PARAMS_OF_PDF_%s_FOR_OBS_%s", GetName(), nsetObs.content()));
600  if (paramSet) {
601  // cout << " restoring parameter cache from workspace for pdf " << IsA()->GetName() << "::" << GetName() <<
602  // endl ;
603  return new RooArgSet(*paramSet);
604  }
605  }
606 
607  RooArgSet *parList = new RooArgSet("parameters");
608 
609  addParameters(*parList, nset, stripDisconnected);
610 
611  parList->sort();
612 
613  // Cache parameter set
614  if (_myws && parList->getSize() > 10) {
615  RooNameSet nsetObs(nset ? *nset : RooArgSet());
616  _myws->defineSetInternal(Form("CACHE_PARAMS_OF_PDF_%s_FOR_OBS_%s", GetName(), nsetObs.content()), *parList);
617  // cout << " caching parameters in workspace for pdf " << IsA()->GetName() << "::" << GetName() << endl ;
618  }
619 
620  return parList;
621 }
622 
623 
624 
625 ////////////////////////////////////////////////////////////////////////////////
626 /// Create a list of leaf nodes in the arg tree starting with
627 /// ourself as top node that match any of the names of the variable list
628 /// of the supplied data set (the dependents). The caller of this
629 /// function is responsible for deleting the returned argset.
630 /// The complement of this function is getParameters().
631 
633 {
634  if (!set) return new RooArgSet ;
635 
636  return getObservables(set->get()) ;
637 }
638 
639 
640 ////////////////////////////////////////////////////////////////////////////////
641 /// Create a list of leaf nodes in the arg tree starting with
642 /// ourself as top node that match any of the names the args in the
643 /// supplied argset. The caller of this function is responsible
644 /// for deleting the returned argset. The complement of this function
645 /// is getParameters().
646 
647 RooArgSet* RooAbsArg::getObservables(const RooArgSet* dataList, Bool_t valueOnly) const
648 {
649  //cout << "RooAbsArg::getObservables(" << GetName() << ")" << endl ;
650 
651  RooArgSet* depList = new RooArgSet("dependents") ;
652  if (!dataList) return depList ;
653 
654  // Make iterator over tree leaf node list
655  RooArgSet leafList("leafNodeServerList") ;
656  treeNodeServerList(&leafList,0,kFALSE,kTRUE,valueOnly) ;
657 
658  if (valueOnly) {
659  for (const auto arg : leafList) {
660  if (arg->dependsOnValue(*dataList) && arg->isLValue()) {
661  depList->add(*arg) ;
662  }
663  }
664  } else {
665  for (const auto arg : leafList) {
666  if (arg->dependsOn(*dataList) && arg->isLValue()) {
667  depList->add(*arg) ;
668  }
669  }
670  }
671 
672  return depList ;
673 }
674 
675 
676 ////////////////////////////////////////////////////////////////////////////////
677 /// Create a RooArgSet with all components (branch nodes) of the
678 /// expression tree headed by this object.
680 {
681  TString name(GetName()) ;
682  name.Append("_components") ;
683 
684  RooArgSet* set = new RooArgSet(name) ;
685  branchNodeServerList(set) ;
686 
687  return set ;
688 }
689 
690 
691 
692 ////////////////////////////////////////////////////////////////////////////////
693 /// Overloadable function in which derived classes can implement
694 /// consistency checks of the variables. If this function returns
695 /// true, indicating an error, the fitter or generator will abort.
696 
698 {
699  return kFALSE ;
700 }
701 
702 
703 ////////////////////////////////////////////////////////////////////////////////
704 /// Recursively call checkObservables on all nodes in the expression tree
705 
707 {
708  RooArgSet nodeList ;
709  treeNodeServerList(&nodeList) ;
710  RooFIter iter = nodeList.fwdIterator() ;
711 
712  RooAbsArg* arg ;
713  Bool_t ret(kFALSE) ;
714  while((arg=iter.next())) {
715  if (arg->getAttribute("ServerDied")) {
716  coutE(LinkStateMgmt) << "RooAbsArg::recursiveCheckObservables(" << GetName() << "): ERROR: one or more servers of node "
717  << arg->GetName() << " no longer exists!" << endl ;
718  arg->Print("v") ;
719  ret = kTRUE ;
720  }
721  ret |= arg->checkObservables(nset) ;
722  }
723 
724  return ret ;
725 }
726 
727 
728 ////////////////////////////////////////////////////////////////////////////////
729 /// Test whether we depend on (ie, are served by) any object in the
730 /// specified collection. Uses the dependsOn(RooAbsArg&) member function.
731 
732 Bool_t RooAbsArg::dependsOn(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg, Bool_t valueOnly) const
733 {
734  // Test whether we depend on (ie, are served by) any object in the
735  // specified collection. Uses the dependsOn(RooAbsArg&) member function.
736 
737  for (auto server : serverList) {
738  if (dependsOn(*server,ignoreArg,valueOnly)) {
739  return kTRUE;
740  }
741  }
742  return kFALSE;
743 }
744 
745 
746 ////////////////////////////////////////////////////////////////////////////////
747 /// Test whether we depend on (ie, are served by) the specified object.
748 /// Note that RooAbsArg objects are considered equivalent if they have
749 /// the same name.
750 
751 Bool_t RooAbsArg::dependsOn(const RooAbsArg& testArg, const RooAbsArg* ignoreArg, Bool_t valueOnly) const
752 {
753  if (this==ignoreArg) return kFALSE ;
754 
755  // First check if testArg is self
756  //if (!TString(testArg.GetName()).CompareTo(GetName())) return kTRUE ;
757  if (testArg.namePtr()==namePtr()) return kTRUE ;
758 
759 
760  // Next test direct dependence
761  RooAbsArg* foundServer = findServer(testArg) ;
762  if (foundServer) {
763 
764  // Return true if valueOnly is FALSE or if server is value server, otherwise keep looking
765  if ( !valueOnly || foundServer->isValueServer(*this)) {
766  return kTRUE ;
767  }
768  }
769 
770  // If not, recurse
771  for (const auto server : _serverList) {
772  if ( !valueOnly || server->isValueServer(*this)) {
773  if (server->dependsOn(testArg,ignoreArg,valueOnly)) {
774  return kTRUE ;
775  }
776  }
777  }
778 
779  return kFALSE ;
780 }
781 
782 
783 
784 ////////////////////////////////////////////////////////////////////////////////
785 /// Test if any of the nodes of tree are shared with that of the given tree
786 
787 Bool_t RooAbsArg::overlaps(const RooAbsArg& testArg, Bool_t valueOnly) const
788 {
789  RooArgSet list("treeNodeList") ;
790  treeNodeServerList(&list) ;
791 
792  return valueOnly ? testArg.dependsOnValue(list) : testArg.dependsOn(list) ;
793 }
794 
795 
796 
797 ////////////////////////////////////////////////////////////////////////////////
798 /// Test if any of the dependents of the arg tree (as determined by getObservables)
799 /// overlaps with those of the testArg.
800 
801 Bool_t RooAbsArg::observableOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const
802 {
803  return observableOverlaps(dset->get(),testArg) ;
804 }
805 
806 
807 ////////////////////////////////////////////////////////////////////////////////
808 /// Test if any of the dependents of the arg tree (as determined by getObservables)
809 /// overlaps with those of the testArg.
810 
811 Bool_t RooAbsArg::observableOverlaps(const RooArgSet* nset, const RooAbsArg& testArg) const
812 {
813  RooArgSet* depList = getObservables(nset) ;
814  Bool_t ret = testArg.dependsOn(*depList) ;
815  delete depList ;
816  return ret ;
817 }
818 
819 
820 
821 ////////////////////////////////////////////////////////////////////////////////
822 /// Mark this object as having changed its value, and propagate this status
823 /// change to all of our clients. If the object is not in automatic dirty
824 /// state propagation mode, this call has no effect
825 
827 {
828  _allBatchesDirty = true;
829 
830  if (_operMode!=Auto || _inhibitDirty) return ;
831 
832  // Handle no-propagation scenarios first
833  if (_clientListValue.size() == 0) {
834  _valueDirty = kTRUE ;
835  return ;
836  }
837 
838  // Cyclical dependency interception
839  if (source==0) {
840  source=this ;
841  } else if (source==this) {
842  // Cyclical dependency, abort
843  coutE(LinkStateMgmt) << "RooAbsArg::setValueDirty(" << GetName()
844  << "): cyclical dependency detected, source = " << source->GetName() << endl ;
845  //assert(0) ;
846  return ;
847  }
848 
849  // Propagate dirty flag to all clients if this is a down->up transition
850  if (_verboseDirty) {
851  cxcoutD(LinkStateMgmt) << "RooAbsArg::setValueDirty(" << (source?source->GetName():"self") << "->" << GetName() << "," << this
852  << "): dirty flag " << (_valueDirty?"already ":"") << "raised" << endl ;
853  }
854 
855  _valueDirty = kTRUE ;
856 
857 
858  for (auto client : _clientListValue) {
859  client->setValueDirty(source) ;
860  }
861 
862 
863 }
864 
865 
866 ////////////////////////////////////////////////////////////////////////////////
867 /// Mark this object as having changed its shape, and propagate this status
868 /// change to all of our clients.
869 
871 {
872  if (_verboseDirty) {
873  cxcoutD(LinkStateMgmt) << "RooAbsArg::setShapeDirty(" << GetName()
874  << "): dirty flag " << (_shapeDirty?"already ":"") << "raised" << endl ;
875  }
876 
877  if (_clientListShape.empty()) {
878  _shapeDirty = kTRUE ;
879  return ;
880  }
881 
882  // Set 'dirty' shape state for this object and propagate flag to all its clients
883  if (source==0) {
884  source=this ;
885  } else if (source==this) {
886  // Cyclical dependency, abort
887  coutE(LinkStateMgmt) << "RooAbsArg::setShapeDirty(" << GetName()
888  << "): cyclical dependency detected" << endl ;
889  return ;
890  }
891 
892  // Propagate dirty flag to all clients if this is a down->up transition
894 
895  for (auto client : _clientListShape) {
896  client->setShapeDirty(source) ;
897  client->setValueDirty(source) ;
898  }
899 
900 }
901 
902 
903 
904 ////////////////////////////////////////////////////////////////////////////////
905 /// Substitute our servers with those listed in newSet. If nameChange is false, servers and
906 /// and substitutes are matched by name. If nameChange is true, servers are matched to args
907 /// in newSet that have the `ORIGNAME:<servername>` attribute set. If mustReplaceAll is set,
908 /// a warning is printed and error status is returned if not all servers could be successfully
909 /// substituted.
910 
911 Bool_t RooAbsArg::redirectServers(const RooAbsCollection& newSetOrig, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursionStep)
912 {
913  // Trivial case, no servers
914  if (_serverList.empty()) return kFALSE ;
915  if (newSetOrig.getSize()==0) return kFALSE ;
916 
917  // Strip any non-matching removal nodes from newSetOrig
918  RooAbsCollection* newSet ;
919 
920  if (nameChange) {
921  newSet = new RooArgSet ;
922  for (auto arg : newSetOrig) {
923 
924  if (string("REMOVAL_DUMMY")==arg->GetName()) {
925 
926  if (arg->getAttribute("REMOVE_ALL")) {
927  newSet->add(*arg) ;
928  } else if (arg->getAttribute(Form("REMOVE_FROM_%s",getStringAttribute("ORIGNAME")))) {
929  newSet->add(*arg) ;
930  }
931  } else {
932  newSet->add(*arg) ;
933  }
934  }
935  } else {
936  newSet = (RooAbsCollection*) &newSetOrig ;
937  }
938 
939  // Replace current servers with new servers with the same name from the given list
940  Bool_t ret(kFALSE) ;
941 
942  //Copy original server list to not confuse the iterator while deleting
943  std::vector<RooAbsArg*> origServerList, origServerValue, origServerShape;
944  auto origSize = _serverList.size();
945  origServerList.reserve(origSize);
946  origServerValue.reserve(origSize);
947 
948  for (const auto oldServer : _serverList) {
949  origServerList.push_back(oldServer) ;
950 
951  // Retrieve server side link state information
952  if (oldServer->_clientListValue.containsByNamePtr(this)) {
953  origServerValue.push_back(oldServer) ;
954  }
955  if (oldServer->_clientListShape.containsByNamePtr(this)) {
956  origServerShape.push_back(oldServer) ;
957  }
958  }
959 
960  // Delete all previously registered servers
961  for (auto oldServer : origServerList) {
962 
963  RooAbsArg * newServer= oldServer->findNewServer(*newSet, nameChange);
964 
965  if (newServer && _verboseDirty) {
966  cxcoutD(LinkStateMgmt) << "RooAbsArg::redirectServers(" << (void*)this << "," << GetName() << "): server " << oldServer->GetName()
967  << " redirected from " << oldServer << " to " << newServer << endl ;
968  }
969 
970  if (!newServer) {
971  if (mustReplaceAll) {
972  coutE(LinkStateMgmt) << "RooAbsArg::redirectServers(" << (void*)this << "," << GetName() << "): server " << oldServer->GetName()
973  << " (" << (void*)oldServer << ") not redirected" << (nameChange?"[nameChange]":"") << endl ;
974  ret = kTRUE ;
975  }
976  continue ;
977  }
978 
979  auto findByNamePtr = [&oldServer](const RooAbsArg * item) {
980  return oldServer->namePtr() == item->namePtr();
981  };
982  bool propValue = std::any_of(origServerValue.begin(), origServerValue.end(), findByNamePtr);
983  bool propShape = std::any_of(origServerShape.begin(), origServerShape.end(), findByNamePtr);
984 
985  if (newServer != this) {
986  replaceServer(*oldServer,*newServer,propValue,propShape) ;
987  }
988  }
989 
990 
991  setValueDirty() ;
992  setShapeDirty() ;
993 
994  // Process the proxies
995  for (int i=0 ; i<numProxies() ; i++) {
996  RooAbsProxy* p = getProxy(i) ;
997  if (!p) continue ;
998  Bool_t ret2 = p->changePointer(*newSet,nameChange,kFALSE) ;
999 
1000  if (mustReplaceAll && !ret2) {
1001  auto ap = dynamic_cast<const RooArgProxy*>(p);
1002  coutE(LinkStateMgmt) << "RooAbsArg::redirectServers(" << GetName()
1003  << "): ERROR, proxy '" << p->name()
1004  << "' with arg '" << (ap ? ap->absArg()->GetName() : "<could not cast>") << "' could not be adjusted" << endl;
1005  ret = kTRUE ;
1006  }
1007  }
1008 
1009 
1010  // Optional subclass post-processing
1011  for (Int_t i=0 ;i<numCaches() ; i++) {
1012  ret |= getCache(i)->redirectServersHook(*newSet,mustReplaceAll,nameChange,isRecursionStep) ;
1013  }
1014  ret |= redirectServersHook(*newSet,mustReplaceAll,nameChange,isRecursionStep) ;
1015 
1016  if (nameChange) {
1017  delete newSet ;
1018  }
1019 
1020  return ret ;
1021 }
1022 
1023 ////////////////////////////////////////////////////////////////////////////////
1024 /// Find the new server in the specified set that matches the old server.
1025 /// Allow a name change if nameChange is kTRUE, in which case the new
1026 /// server is selected by searching for a new server with an attribute
1027 /// of "ORIGNAME:<oldName>". Return zero if there is not a unique match.
1028 
1030 {
1031  RooAbsArg *newServer = 0;
1032  if (!nameChange) {
1033  newServer = newSet.find(*this) ;
1034  }
1035  else {
1036  // Name changing server redirect:
1037  // use 'ORIGNAME:<oldName>' attribute instead of name of new server
1038  TString nameAttrib("ORIGNAME:") ;
1039  nameAttrib.Append(GetName()) ;
1040 
1041  RooArgSet* tmp = (RooArgSet*) newSet.selectByAttrib(nameAttrib,kTRUE) ;
1042  if(0 != tmp) {
1043 
1044  // Check if any match was found
1045  if (tmp->getSize()==0) {
1046  delete tmp ;
1047  return 0 ;
1048  }
1049 
1050  // Check if match is unique
1051  if(tmp->getSize()>1) {
1052  coutF(LinkStateMgmt) << "RooAbsArg::redirectServers(" << GetName() << "): FATAL Error, " << tmp->getSize() << " servers with "
1053  << nameAttrib << " attribute" << endl ;
1054  tmp->Print("v") ;
1055  assert(0) ;
1056  }
1057 
1058  // use the unique element in the set
1059  newServer= tmp->first();
1060  delete tmp ;
1061  }
1062  }
1063  return newServer;
1064 }
1065 
1066 Bool_t RooAbsArg::recursiveRedirectServers(const RooAbsCollection& newSet, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t recurseInNewSet)
1067 {
1068  // Recursively redirect all servers with new server in collection 'newSet'.
1069  // Substitute our servers with those listed in newSet. If nameChange is false, servers and
1070  // and substitutes are matched by name. If nameChange is true, servers are matched to args
1071  // in newSet that have the 'ORIGNAME:<servername>' attribute set. If mustReplaceAll is set,
1072  // a warning is printed and error status is returned if not all servers could be sucessfully
1073  // substituted. If recurseInNewSet is true, the recursion algorithm also recursion into
1074  // expression trees under the arguments in the new servers (i.e. those in newset)
1075 
1076 
1077  // Cyclic recursion protection
1078  static std::set<const RooAbsArg*> callStack;
1079  {
1080  std::set<const RooAbsArg*>::iterator it = callStack.lower_bound(this);
1081  if (it != callStack.end() && this == *it) {
1082  return kFALSE;
1083  } else {
1084  callStack.insert(it, this);
1085  }
1086  }
1087 
1088  // Do not recurse into newset if not so specified
1089 // if (!recurseInNewSet && newSet.contains(*this)) {
1090 // return kFALSE ;
1091 // }
1092 
1093 
1094  // Apply the redirectServers function recursively on all branch nodes in this argument tree.
1095  Bool_t ret(kFALSE) ;
1096 
1097  cxcoutD(LinkStateMgmt) << "RooAbsArg::recursiveRedirectServers(" << this << "," << GetName() << ") newSet = " << newSet << " mustReplaceAll = "
1098  << (mustReplaceAll?"T":"F") << " nameChange = " << (nameChange?"T":"F") << " recurseInNewSet = " << (recurseInNewSet?"T":"F") << endl ;
1099 
1100  // Do redirect on self (identify operation as recursion step)
1101  ret |= redirectServers(newSet,mustReplaceAll,nameChange,kTRUE) ;
1102 
1103  // Do redirect on servers
1104  for (const auto server : _serverList){
1105  ret |= server->recursiveRedirectServers(newSet,mustReplaceAll,nameChange,recurseInNewSet) ;
1106  }
1107 
1108  callStack.erase(this);
1109  return ret ;
1110 }
1111 
1112 
1113 
1114 ////////////////////////////////////////////////////////////////////////////////
1115 /// Register an RooArgProxy in the proxy list. This function is called by owned
1116 /// proxies upon creation. After registration, this arg wil forward pointer
1117 /// changes from serverRedirects and updates in cached normalization sets
1118 /// to the proxies immediately after they occur. The proxied argument is
1119 /// also added as value and/or shape server
1120 
1122 {
1123  // Every proxy can be registered only once
1124  if (_proxyList.FindObject(&proxy)) {
1125  coutE(LinkStateMgmt) << "RooAbsArg::registerProxy(" << GetName() << "): proxy named "
1126  << proxy.GetName() << " for arg " << proxy.absArg()->GetName()
1127  << " already registered" << endl ;
1128  return ;
1129  }
1130 
1131 // cout << (void*)this << " " << GetName() << ": registering proxy "
1132 // << (void*)&proxy << " with name " << proxy.name() << " in mode "
1133 // << (proxy.isValueServer()?"V":"-") << (proxy.isShapeServer()?"S":"-") << endl ;
1134 
1135  // Register proxied object as server
1136  if (proxy.absArg()) {
1137  addServer(*proxy.absArg(),proxy.isValueServer(),proxy.isShapeServer()) ;
1138  }
1139 
1140  // Register proxy itself
1141  _proxyList.Add(&proxy) ;
1142 }
1143 
1144 
1145 ////////////////////////////////////////////////////////////////////////////////
1146 /// Remove proxy from proxy list. This functions is called by owned proxies
1147 /// upon their destruction.
1148 
1150 {
1151  _proxyList.Remove(&proxy) ;
1152  _proxyList.Compress() ;
1153 }
1154 
1155 
1156 
1157 ////////////////////////////////////////////////////////////////////////////////
1158 /// Register an RooSetProxy in the proxy list. This function is called by owned
1159 /// proxies upon creation. After registration, this arg wil forward pointer
1160 /// changes from serverRedirects and updates in cached normalization sets
1161 /// to the proxies immediately after they occur.
1162 
1164 {
1165  // Every proxy can be registered only once
1166  if (_proxyList.FindObject(&proxy)) {
1167  coutE(LinkStateMgmt) << "RooAbsArg::registerProxy(" << GetName() << "): proxy named "
1168  << proxy.GetName() << " already registered" << endl ;
1169  return ;
1170  }
1171 
1172  // Register proxy itself
1173  _proxyList.Add(&proxy) ;
1174 }
1175 
1176 
1177 
1178 ////////////////////////////////////////////////////////////////////////////////
1179 /// Remove proxy from proxy list. This functions is called by owned proxies
1180 /// upon their destruction.
1181 
1183 {
1184  _proxyList.Remove(&proxy) ;
1185  _proxyList.Compress() ;
1186 }
1187 
1188 
1189 
1190 ////////////////////////////////////////////////////////////////////////////////
1191 /// Register an RooListProxy in the proxy list. This function is called by owned
1192 /// proxies upon creation. After registration, this arg wil forward pointer
1193 /// changes from serverRedirects and updates in cached normalization sets
1194 /// to the proxies immediately after they occur.
1195 
1197 {
1198  // Every proxy can be registered only once
1199  if (_proxyList.FindObject(&proxy)) {
1200  coutE(LinkStateMgmt) << "RooAbsArg::registerProxy(" << GetName() << "): proxy named "
1201  << proxy.GetName() << " already registered" << endl ;
1202  return ;
1203  }
1204 
1205  // Register proxy itself
1206  Int_t nProxyOld = _proxyList.GetEntries() ;
1207  _proxyList.Add(&proxy) ;
1208  if (_proxyList.GetEntries()!=nProxyOld+1) {
1209  cout << "RooAbsArg::registerProxy(" << GetName() << ") proxy registration failure! nold=" << nProxyOld << " nnew=" << _proxyList.GetEntries() << endl ;
1210  }
1211 }
1212 
1213 
1214 
1215 ////////////////////////////////////////////////////////////////////////////////
1216 /// Remove proxy from proxy list. This functions is called by owned proxies
1217 /// upon their destruction.
1218 
1220 {
1221  _proxyList.Remove(&proxy) ;
1222  _proxyList.Compress() ;
1223 }
1224 
1225 
1226 
1227 ////////////////////////////////////////////////////////////////////////////////
1228 /// Return the nth proxy from the proxy list.
1229 
1231 {
1232  // Cross cast: proxy list returns TObject base pointer, we need
1233  // a RooAbsProxy base pointer. C++ standard requires
1234  // a dynamic_cast for this.
1235  return dynamic_cast<RooAbsProxy*> (_proxyList.At(index)) ;
1236 }
1237 
1238 
1239 
1240 ////////////////////////////////////////////////////////////////////////////////
1241 /// Return the number of registered proxies.
1242 
1244 {
1245  return _proxyList.GetEntriesFast();
1246 }
1247 
1248 
1249 
1250 ////////////////////////////////////////////////////////////////////////////////
1251 /// Forward a change in the cached normalization argset
1252 /// to all the registered proxies.
1253 
1255 {
1256  for (int i=0 ; i<numProxies() ; i++) {
1257  RooAbsProxy* p = getProxy(i) ;
1258  if (!p) continue ;
1259  getProxy(i)->changeNormSet(nset) ;
1260  }
1261 }
1262 
1263 
1264 
1265 ////////////////////////////////////////////////////////////////////////////////
1266 /// Overloadable function for derived classes to implement
1267 /// attachment as branch to a TTree
1268 
1270 {
1271  coutE(Contents) << "RooAbsArg::attachToTree(" << GetName()
1272  << "): Cannot be attached to a TTree" << endl ;
1273 }
1274 
1275 
1276 
1277 ////////////////////////////////////////////////////////////////////////////////
1278 /// WVE (08/21/01) Probably obsolete now
1279 
1281 {
1282  return kTRUE ;
1283 }
1284 
1285 
1286 
1287 
1288 ////////////////////////////////////////////////////////////////////////////////
1289 /// Print object name
1290 
1291 void RooAbsArg::printName(ostream& os) const
1292 {
1293  os << GetName() ;
1294 }
1295 
1296 
1297 
1298 ////////////////////////////////////////////////////////////////////////////////
1299 /// Print object title
1300 
1301 void RooAbsArg::printTitle(ostream& os) const
1302 {
1303  os << GetTitle() ;
1304 }
1305 
1306 
1307 
1308 ////////////////////////////////////////////////////////////////////////////////
1309 /// Print object class name
1310 
1311 void RooAbsArg::printClassName(ostream& os) const
1312 {
1313  os << IsA()->GetName() ;
1314 }
1315 
1316 
1317 void RooAbsArg::printAddress(ostream& os) const
1318 {
1319  // Print addrss of this RooAbsArg
1320  os << this ;
1321 }
1322 
1323 
1324 
1325 ////////////////////////////////////////////////////////////////////////////////
1326 /// Print object arguments, ie its proxies
1327 
1328 void RooAbsArg::printArgs(ostream& os) const
1329 {
1330  // Print nothing if there are no dependencies
1331  if (numProxies()==0) return ;
1332 
1333  os << "[ " ;
1334  for (Int_t i=0 ; i<numProxies() ; i++) {
1335  RooAbsProxy* p = getProxy(i) ;
1336  if (p==0) continue ;
1337  if (!TString(p->name()).BeginsWith("!")) {
1338  p->print(os) ;
1339  os << " " ;
1340  }
1341  }
1342  printMetaArgs(os) ;
1343  os << "]" ;
1344 }
1345 
1346 
1347 
1348 ////////////////////////////////////////////////////////////////////////////////
1349 /// Define default contents to print
1350 
1352 {
1353  return kName|kClassName|kValue|kArgs ;
1354 }
1355 
1356 
1357 
1358 ////////////////////////////////////////////////////////////////////////////////
1359 /// Implement multi-line detailed printing
1360 
1361 void RooAbsArg::printMultiline(ostream& os, Int_t /*contents*/, Bool_t /*verbose*/, TString indent) const
1362 {
1363  os << indent << "--- RooAbsArg ---" << endl;
1364  // dirty state flags
1365  os << indent << " Value State: " ;
1366  switch(_operMode) {
1367  case ADirty: os << "FORCED DIRTY" ; break ;
1368  case AClean: os << "FORCED clean" ; break ;
1369  case Auto: os << (isValueDirty() ? "DIRTY":"clean") ; break ;
1370  }
1371  os << endl
1372  << indent << " Shape State: " << (isShapeDirty() ? "DIRTY":"clean") << endl;
1373  // attribute list
1374  os << indent << " Attributes: " ;
1375  printAttribList(os) ;
1376  os << endl ;
1377  // our memory address (for x-referencing with client addresses of other args)
1378  os << indent << " Address: " << (void*)this << endl;
1379  // client list
1380  os << indent << " Clients: " << endl;
1381  for (const auto client : _clientList) {
1382  os << indent << " (" << (void*)client << ","
1383  << (_clientListValue.containsByNamePtr(client)?"V":"-")
1384  << (_clientListShape.containsByNamePtr(client)?"S":"-")
1385  << ") " ;
1386  client->printStream(os,kClassName|kTitle|kName,kSingleLine);
1387  }
1388 
1389  // server list
1390  os << indent << " Servers: " << endl;
1391  for (const auto server : _serverList) {
1392  os << indent << " (" << (void*)server << ","
1393  << (server->_clientListValue.containsByNamePtr(this)?"V":"-")
1394  << (server->_clientListShape.containsByNamePtr(this)?"S":"-")
1395  << ") " ;
1396  server->printStream(os,kClassName|kName|kTitle,kSingleLine);
1397  }
1398 
1399  // proxy list
1400  os << indent << " Proxies: " << endl ;
1401  for (int i=0 ; i<numProxies() ; i++) {
1402  RooAbsProxy* proxy=getProxy(i) ;
1403  if (!proxy) continue ;
1404  if (proxy->IsA()->InheritsFrom(RooArgProxy::Class())) {
1405  os << indent << " " << proxy->name() << " -> " ;
1406  RooAbsArg* parg = ((RooArgProxy*)proxy)->absArg() ;
1407  if (parg) {
1408  parg->printStream(os,kName,kSingleLine) ;
1409  } else {
1410  os << " (empty)" << endl ; ;
1411  }
1412  } else {
1413  os << indent << " " << proxy->name() << " -> " ;
1414  os << endl ;
1415  TString moreIndent(indent) ;
1416  moreIndent.Append(" ") ;
1417  ((RooSetProxy*)proxy)->printStream(os,kName,kStandard,moreIndent.Data()) ;
1418  }
1419  }
1420 }
1421 
1422 
1423 ////////////////////////////////////////////////////////////////////////////////
1424 /// Print object tree structure
1425 
1426 void RooAbsArg::printTree(ostream& os, TString /*indent*/) const
1427 {
1428  const_cast<RooAbsArg*>(this)->printCompactTree(os) ;
1429 }
1430 
1431 
1432 ////////////////////////////////////////////////////////////////////////////////
1433 /// Ostream operator
1434 
1435 ostream& operator<<(ostream& os, RooAbsArg &arg)
1436 {
1437  arg.writeToStream(os,kTRUE) ;
1438  return os ;
1439 }
1440 
1441 ////////////////////////////////////////////////////////////////////////////////
1442 /// Istream operator
1443 
1444 istream& operator>>(istream& is, RooAbsArg &arg)
1445 {
1446  arg.readFromStream(is,kTRUE,kFALSE) ;
1447  return is ;
1448 }
1449 
1450 ////////////////////////////////////////////////////////////////////////////////
1451 /// Print the attribute list
1452 
1453 void RooAbsArg::printAttribList(ostream& os) const
1454 {
1455  set<string>::const_iterator iter = _boolAttrib.begin() ;
1456  Bool_t first(kTRUE) ;
1457  while (iter != _boolAttrib.end()) {
1458  os << (first?" [":",") << *iter ;
1459  first=kFALSE ;
1460  ++iter ;
1461  }
1462  if (!first) os << "] " ;
1463 }
1464 
1465 ////////////////////////////////////////////////////////////////////////////////
1466 /// Replace server nodes with names matching the dataset variable names
1467 /// with those data set variables, making this PDF directly dependent on the dataset.
1468 
1470 {
1471  const RooArgSet* set = data.get() ;
1472  RooArgSet branches ;
1473  branchNodeServerList(&branches,0,kTRUE) ;
1474 
1475  RooFIter iter = branches.fwdIterator() ;
1476  RooAbsArg* branch ;
1477  while((branch=iter.next())) {
1478  branch->redirectServers(*set,kFALSE,kFALSE) ;
1479  }
1480 }
1481 
1482 
1483 
1484 ////////////////////////////////////////////////////////////////////////////////
1485 /// Replace server nodes with names matching the dataset variable names
1486 /// with those data set variables, making this PDF directly dependent on the dataset
1487 
1489 {
1490  const RooArgSet* set = dstore.get() ;
1491  RooArgSet branches ;
1492  branchNodeServerList(&branches,0,kTRUE) ;
1493 
1494  RooFIter iter = branches.fwdIterator() ;
1495  RooAbsArg* branch ;
1496  while((branch=iter.next())) {
1497  branch->redirectServers(*set,kFALSE,kFALSE) ;
1498  }
1499 }
1500 
1501 
1502 
1503 ////////////////////////////////////////////////////////////////////////////////
1504 /// Utility function used by TCollection::Sort to compare contained TObjects
1505 /// We implement comparison by name, resulting in alphabetical sorting by object name.
1506 
1507 Int_t RooAbsArg::Compare(const TObject* other) const
1508 {
1509  return strcmp(GetName(),other->GetName()) ;
1510 }
1511 
1512 
1513 
1514 ////////////////////////////////////////////////////////////////////////////////
1515 /// Print information about current value dirty state information.
1516 /// If depth flag is true, information is recursively printed for
1517 /// all nodes in this arg tree.
1518 
1520 {
1521  if (depth) {
1522 
1523  RooArgSet branchList ;
1524  branchNodeServerList(&branchList) ;
1525  RooFIter bIter = branchList.fwdIterator() ;
1526  RooAbsArg* branch ;
1527  while((branch=bIter.next())) {
1528  branch->printDirty(kFALSE) ;
1529  }
1530 
1531  } else {
1532  cout << GetName() << " : " ;
1533  switch (_operMode) {
1534  case AClean: cout << "FORCED clean" ; break ;
1535  case ADirty: cout << "FORCED DIRTY" ; break ;
1536  case Auto: cout << "Auto " << (isValueDirty()?"DIRTY":"clean") ;
1537  }
1538  cout << endl ;
1539  }
1540 }
1541 
1542 
1543 ////////////////////////////////////////////////////////////////////////////////
1544 /// Activate cache mode optimization with given definition of observables.
1545 /// The cache operation mode of all objects in the expression tree will
1546 /// modified such that all nodes that depend directly or indirectly on
1547 /// any of the listed observables will be set to ADirty, as they are
1548 /// expected to change every time. This save change tracking overhead for
1549 /// nodes that are a priori known to change every time
1550 
1551 void RooAbsArg::optimizeCacheMode(const RooArgSet& observables)
1552 {
1553  RooLinkedList proc;
1554  RooArgSet opt ;
1555  optimizeCacheMode(observables,opt,proc) ;
1556 
1557  coutI(Optimization) << "RooAbsArg::optimizeCacheMode(" << GetName() << ") nodes " << opt << " depend on observables, "
1558  << "changing cache operation mode from change tracking to unconditional evaluation" << endl ;
1559 }
1560 
1561 
1562 ////////////////////////////////////////////////////////////////////////////////
1563 /// Activate cache mode optimization with given definition of observables.
1564 /// The cache operation mode of all objects in the expression tree will
1565 /// modified such that all nodes that depend directly or indirectly on
1566 /// any of the listed observables will be set to ADirty, as they are
1567 /// expected to change every time. This save change tracking overhead for
1568 /// nodes that are a priori known to change every time
1569 
1570 void RooAbsArg::optimizeCacheMode(const RooArgSet& observables, RooArgSet& optimizedNodes, RooLinkedList& processedNodes)
1571 {
1572  // Optimization applies only to branch nodes, not to leaf nodes
1573  if (!isDerived()) {
1574  return ;
1575  }
1576 
1577 
1578  // Terminate call if this node was already processed (tree structure may be cyclical)
1579  if (processedNodes.findArg(this)) {
1580  return ;
1581  } else {
1582  processedNodes.Add(this) ;
1583  }
1584 
1585  // Set cache mode operator to 'AlwaysDirty' if we depend on any of the given observables
1586  if (dependsOnValue(observables)) {
1587 
1588  if (dynamic_cast<RooRealIntegral*>(this)) {
1589  cxcoutI(Integration) << "RooAbsArg::optimizeCacheMode(" << GetName() << ") integral depends on value of one or more observables and will be evaluated for every event" << endl ;
1590  }
1591  optimizedNodes.add(*this,kTRUE) ;
1592  if (operMode()==AClean) {
1593  } else {
1594  setOperMode(ADirty,kTRUE) ; // WVE propagate flag recursively to top of tree
1595  }
1596  } else {
1597  }
1598  // Process any RooAbsArgs contained in any of the caches of this object
1599  for (Int_t i=0 ;i<numCaches() ; i++) {
1600  getCache(i)->optimizeCacheMode(observables,optimizedNodes,processedNodes) ;
1601  }
1602 
1603  // Forward calls to all servers
1604  for (const auto server : _serverList) {
1605  server->optimizeCacheMode(observables,optimizedNodes,processedNodes) ;
1606  }
1607 
1608 }
1609 
1610 ////////////////////////////////////////////////////////////////////////////////
1611 /// Find branch nodes with all-constant parameters, and add them to the list of
1612 /// nodes that can be cached with a dataset in a test statistic calculation
1613 
1615 {
1616  RooLinkedList proc ;
1617  Bool_t ret = findConstantNodes(observables,cacheList,proc) ;
1618 
1619  // If node can be optimized and hasn't been identified yet, add it to the list
1620  coutI(Optimization) << "RooAbsArg::findConstantNodes(" << GetName() << "): components "
1621  << cacheList << " depend exclusively on constant parameters and will be precalculated and cached" << endl ;
1622 
1623  return ret ;
1624 }
1625 
1626 
1627 
1628 ////////////////////////////////////////////////////////////////////////////////
1629 /// Find branch nodes with all-constant parameters, and add them to the list of
1630 /// nodes that can be cached with a dataset in a test statistic calculation
1631 
1632 Bool_t RooAbsArg::findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList, RooLinkedList& processedNodes)
1633 {
1634  // Caching only applies to branch nodes
1635  if (!isDerived()) {
1636  return kFALSE;
1637  }
1638 
1639  // Terminate call if this node was already processed (tree structure may be cyclical)
1640  if (processedNodes.findArg(this)) {
1641  return kFALSE ;
1642  } else {
1643  processedNodes.Add(this) ;
1644  }
1645 
1646  // Check if node depends on any non-constant parameter
1647  Bool_t canOpt(kTRUE) ;
1648  RooArgSet* paramSet = getParameters(observables) ;
1649  RooFIter iter = paramSet->fwdIterator() ;
1650  RooAbsArg* param ;
1651  while((param = iter.next())) {
1652  if (!param->isConstant()) {
1653  canOpt=kFALSE ;
1654  break ;
1655  }
1656  }
1657  delete paramSet ;
1658 
1659 
1660  if (getAttribute("NeverConstant")) {
1661  canOpt = kFALSE ;
1662  }
1663 
1664  if (canOpt) {
1665  setAttribute("ConstantExpression") ;
1666  }
1667 
1668  // If yes, list node eligible for caching, if not test nodes one level down
1669  if (canOpt||getAttribute("CacheAndTrack")) {
1670 
1671  if (!cacheList.find(*this) && dependsOnValue(observables) && !observables.find(*this) ) {
1672 
1673  // Add to cache list
1674  cxcoutD(Optimization) << "RooAbsArg::findConstantNodes(" << GetName() << ") adding self to list of constant nodes" << endl ;
1675 
1676  if (canOpt) setAttribute("ConstantExpressionCached") ;
1677  cacheList.add(*this,kFALSE) ;
1678  }
1679  }
1680 
1681  if (!canOpt) {
1682 
1683  // If not, see if next level down can be cached
1684  for (const auto server : _serverList) {
1685  if (server->isDerived()) {
1686  server->findConstantNodes(observables,cacheList,processedNodes) ;
1687  }
1688  }
1689  }
1690 
1691  // Forward call to all cached contained in current object
1692  for (Int_t i=0 ;i<numCaches() ; i++) {
1693  getCache(i)->findConstantNodes(observables,cacheList,processedNodes) ;
1694  }
1695 
1696  return kFALSE ;
1697 }
1698 
1699 
1700 
1701 
1702 ////////////////////////////////////////////////////////////////////////////////
1703 /// Interface function signaling a request to perform constant term
1704 /// optimization. This default implementation takes no action other than to
1705 /// forward the calls to all servers
1706 
1708 {
1709  for (const auto server : _serverList) {
1710  server->constOptimizeTestStatistic(opcode,doAlsoTrackingOpt) ;
1711  }
1712 }
1713 
1714 
1715 ////////////////////////////////////////////////////////////////////////////////
1716 /// Change cache operation mode to given mode. If recurseAdirty
1717 /// is true, then a mode change to AlwaysDirty will automatically
1718 /// be propagated recursively to all client nodes
1719 
1720 void RooAbsArg::setOperMode(OperMode mode, Bool_t recurseADirty)
1721 {
1722  // Prevent recursion loops
1723  if (mode==_operMode) return ;
1724 
1725  _operMode = mode ;
1726  _fast = ((mode==AClean) || dynamic_cast<RooRealVar*>(this)!=0 || dynamic_cast<RooConstVar*>(this)!=0 ) ;
1727  for (Int_t i=0 ;i<numCaches() ; i++) {
1728  getCache(i)->operModeHook() ;
1729  }
1730  operModeHook() ;
1731 
1732  // Propagate to all clients
1733  if (mode==ADirty && recurseADirty) {
1734  for (auto clientV : _clientListValue) {
1735  clientV->setOperMode(mode) ;
1736  }
1737  }
1738 }
1739 
1740 
1741 ////////////////////////////////////////////////////////////////////////////////
1742 /// Print tree structure of expression tree on stdout, or to file if filename is specified.
1743 /// If namePat is not "*", only nodes with names matching the pattern will be printed.
1744 /// The client argument is used in recursive calls to properly display the value or shape nature
1745 /// of the client-server links. It should be zero in calls initiated by users.
1746 
1747 void RooAbsArg::printCompactTree(const char* indent, const char* filename, const char* namePat, RooAbsArg* client)
1748 {
1749  if (filename) {
1750  ofstream ofs(filename) ;
1751  printCompactTree(ofs,indent,namePat,client) ;
1752  } else {
1753  printCompactTree(cout,indent,namePat,client) ;
1754  }
1755 }
1756 
1757 
1758 ////////////////////////////////////////////////////////////////////////////////
1759 /// Print tree structure of expression tree on given ostream.
1760 /// If namePat is not "*", only nodes with names matching the pattern will be printed.
1761 /// The client argument is used in recursive calls to properly display the value or shape nature
1762 /// of the client-server links. It should be zero in calls initiated by users.
1763 
1764 void RooAbsArg::printCompactTree(ostream& os, const char* indent, const char* namePat, RooAbsArg* client)
1765 {
1766  if ( !namePat || TString(GetName()).Contains(namePat)) {
1767  os << indent << this ;
1768  if (client) {
1769  os << "/" ;
1770  if (isValueServer(*client)) os << "V" ; else os << "-" ;
1771  if (isShapeServer(*client)) os << "S" ; else os << "-" ;
1772  }
1773  os << " " ;
1774 
1775  os << IsA()->GetName() << "::" << GetName() << " = " ;
1776  printValue(os) ;
1777 
1778  if (!_serverList.empty()) {
1779  switch(operMode()) {
1780  case Auto: os << " [Auto," << (isValueDirty()?"Dirty":"Clean") << "] " ; break ;
1781  case AClean: os << " [ACLEAN] " ; break ;
1782  case ADirty: os << " [ADIRTY] " ; break ;
1783  }
1784  }
1785  os << endl ;
1786 
1787  for (Int_t i=0 ;i<numCaches() ; i++) {
1789  }
1791  }
1792 
1793  TString indent2(indent) ;
1794  indent2 += " " ;
1795  for (const auto arg : _serverList) {
1796  arg->printCompactTree(os,indent2,namePat,this) ;
1797  }
1798 }
1799 
1800 
1801 ////////////////////////////////////////////////////////////////////////////////
1802 /// Print tree structure of expression tree on given ostream, only branch nodes are printed.
1803 /// Lead nodes (variables) will not be shown
1804 ///
1805 /// If namePat is not "*", only nodes with names matching the pattern will be printed.
1806 
1807 void RooAbsArg::printComponentTree(const char* indent, const char* namePat, Int_t nLevel)
1808 {
1809  if (nLevel==0) return ;
1810  if (isFundamental()) return ;
1811  RooResolutionModel* rmodel = dynamic_cast<RooResolutionModel*>(this) ;
1812  if (rmodel && rmodel->isConvolved()) return ;
1813  if (InheritsFrom("RooConstVar")) return ;
1814 
1815  if ( !namePat || TString(GetName()).Contains(namePat)) {
1816  cout << indent ;
1817  Print() ;
1818  }
1819 
1820  TString indent2(indent) ;
1821  indent2 += " " ;
1822  for (const auto arg : _serverList) {
1823  arg->printComponentTree(indent2.Data(),namePat,nLevel-1) ;
1824  }
1825 }
1826 
1827 
1828 ////////////////////////////////////////////////////////////////////////////////
1829 /// Construct a mangled name from the actual name that
1830 /// is free of any math symbols that might be interpreted by TTree
1831 
1833 {
1834  // Check for optional alternate name of branch for this argument
1835  TString rawBranchName = GetName() ;
1836  if (getStringAttribute("BranchName")) {
1837  rawBranchName = getStringAttribute("BranchName") ;
1838  }
1839 
1840  TString cleanName(rawBranchName) ;
1841  cleanName.ReplaceAll("/","D") ;
1842  cleanName.ReplaceAll("-","M") ;
1843  cleanName.ReplaceAll("+","P") ;
1844  cleanName.ReplaceAll("*","X") ;
1845  cleanName.ReplaceAll("[","L") ;
1846  cleanName.ReplaceAll("]","R") ;
1847  cleanName.ReplaceAll("(","L") ;
1848  cleanName.ReplaceAll(")","R") ;
1849  cleanName.ReplaceAll("{","L") ;
1850  cleanName.ReplaceAll("}","R") ;
1851 
1852  return cleanName;
1853 }
1854 
1855 
1856 ////////////////////////////////////////////////////////////////////////////////
1857 /// Hook function interface for object to insert additional information
1858 /// when printed in the context of a tree structure. This default
1859 /// implementation prints nothing
1860 
1861 void RooAbsArg::printCompactTreeHook(ostream&, const char *)
1862 {
1863 }
1864 
1865 
1866 ////////////////////////////////////////////////////////////////////////////////
1867 /// Register RooAbsCache with this object. This function is called
1868 /// by RooAbsCache constructors for objects that are a datamember
1869 /// of this RooAbsArg. By registering itself the RooAbsArg is aware
1870 /// of all its cache data members and will forward server change
1871 /// and cache mode change calls to the cache objects, which in turn
1872 /// can forward them their contents
1873 
1875 {
1876  _cacheList.push_back(&cache) ;
1877 }
1878 
1879 
1880 ////////////////////////////////////////////////////////////////////////////////
1881 /// Unregister a RooAbsCache. Called from the RooAbsCache destructor
1882 
1884 {
1885  _cacheList.erase(std::remove(_cacheList.begin(), _cacheList.end(), &cache),
1886  _cacheList.end());
1887 }
1888 
1889 
1890 ////////////////////////////////////////////////////////////////////////////////
1891 /// Return number of registered caches
1892 
1894 {
1895  return _cacheList.size() ;
1896 }
1897 
1898 
1899 ////////////////////////////////////////////////////////////////////////////////
1900 /// Return registered cache object by index
1901 
1903 {
1904  return _cacheList[index] ;
1905 }
1906 
1907 
1908 ////////////////////////////////////////////////////////////////////////////////
1909 /// Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
1910 
1911 RooArgSet* RooAbsArg::getVariables(Bool_t stripDisconnected) const
1912 {
1913  return getParameters(RooArgSet(),stripDisconnected) ;
1914 }
1915 
1916 
1917 ////////////////////////////////////////////////////////////////////////////////
1918 /// Return ancestors in cloning chain of this RooAbsArg. NOTE: Returned pointers
1919 /// are not guaranteed to be 'live', so do not dereference without proper caution
1920 
1922 {
1923  RooLinkedList retVal ;
1924 
1925  set<string>::const_iterator iter= _boolAttrib.begin() ;
1926  while(iter != _boolAttrib.end()) {
1927  if (TString(*iter).BeginsWith("CloneOf(")) {
1928  char buf[128] ;
1929  strlcpy(buf,iter->c_str(),128) ;
1930  strtok(buf,"(") ;
1931  char* ptrToken = strtok(0,")") ;
1932  RooAbsArg* ptr = (RooAbsArg*) strtol(ptrToken,0,16) ;
1933  retVal.Add(ptr) ;
1934  }
1935  }
1936 
1937  return retVal ;
1938 }
1939 
1940 
1941 ////////////////////////////////////////////////////////////////////////////////
1942 /// Create a GraphViz .dot file visualizing the expression tree headed by
1943 /// this RooAbsArg object. Use the GraphViz tool suite to make e.g. a gif
1944 /// or ps file from the .dot file
1945 ///
1946 /// Based on concept developed by Kyle Cranmer
1947 
1948 void RooAbsArg::graphVizTree(const char* fileName, const char* delimiter, bool useTitle, bool useLatex)
1949 {
1950  ofstream ofs(fileName) ;
1951  if (!ofs) {
1952  coutE(InputArguments) << "RooAbsArg::graphVizTree() ERROR: Cannot open graphViz output file with name " << fileName << endl ;
1953  return ;
1954  }
1955  graphVizTree(ofs, delimiter, useTitle, useLatex) ;
1956 }
1957 
1958 ////////////////////////////////////////////////////////////////////////////////
1959 /// Write the GraphViz representation of the expression tree headed by
1960 /// this RooAbsArg object to the given ostream.
1961 ///
1962 /// Based on concept developed by Kyle Cranmer
1963 
1964 void RooAbsArg::graphVizTree(ostream& os, const char* delimiter, bool useTitle, bool useLatex)
1965 {
1966  if (!os) {
1967  coutE(InputArguments) << "RooAbsArg::graphVizTree() ERROR: output stream provided as input argument is in invalid state" << endl ;
1968  }
1969 
1970  // Write header
1971  os << "digraph " << GetName() << "{" << endl ;
1972 
1973  // First list all the tree nodes
1974  RooArgSet nodeSet ;
1975  treeNodeServerList(&nodeSet) ;
1976  RooFIter iter = nodeSet.fwdIterator() ;
1977  RooAbsArg* node ;
1978 
1979  // iterate over nodes
1980  while((node=iter.next())) {
1981  string nodeName = node->GetName();
1982  string nodeTitle = node->GetTitle();
1983  string nodeLabel = (useTitle && !nodeTitle.empty()) ? nodeTitle : nodeName;
1984 
1985  // if using latex, replace ROOT's # with normal latex backslash
1986  string::size_type position = nodeLabel.find("#") ;
1987  while(useLatex && position!=nodeLabel.npos){
1988  nodeLabel.replace(position, 1, "\\");
1989  }
1990 
1991  string typeFormat = "\\texttt{";
1992  string nodeType = (useLatex) ? typeFormat+node->IsA()->GetName()+"}" : node->IsA()->GetName();
1993 
1994  os << "\"" << nodeName << "\" [ color=" << (node->isFundamental()?"blue":"red")
1995  << ", label=\"" << nodeType << delimiter << nodeLabel << "\"];" << endl ;
1996 
1997  }
1998 
1999  // Get set of all server links
2000  set<pair<RooAbsArg*,RooAbsArg*> > links ;
2001  graphVizAddConnections(links) ;
2002 
2003  // And write them out
2004  set<pair<RooAbsArg*,RooAbsArg*> >::iterator liter = links.begin() ;
2005  for( ; liter != links.end() ; ++liter ) {
2006  os << "\"" << liter->first->GetName() << "\" -> \"" << liter->second->GetName() << "\";" << endl ;
2007  }
2008 
2009  // Write trailer
2010  os << "}" << endl ;
2011 
2012 }
2013 
2014 ////////////////////////////////////////////////////////////////////////////////
2015 /// Utility function that inserts all point-to-point client-server connections
2016 /// between any two RooAbsArgs in the expression tree headed by this object
2017 /// in the linkSet argument.
2018 
2019 void RooAbsArg::graphVizAddConnections(set<pair<RooAbsArg*,RooAbsArg*> >& linkSet)
2020 {
2021  for (const auto server : _serverList) {
2022  linkSet.insert(make_pair(this,server)) ;
2023  server->graphVizAddConnections(linkSet) ;
2024  }
2025 }
2026 
2027 
2028 
2029 // //_____________________________________________________________________________
2030 // TGraphStruct* RooAbsArg::graph(Bool_t useFactoryTag, Double_t textSize)
2031 // {
2032 // // Return a TGraphStruct object filled with the tree structure of the pdf object
2033 
2034 // TGraphStruct* theGraph = new TGraphStruct() ;
2035 
2036 // // First list all the tree nodes
2037 // RooArgSet nodeSet ;
2038 // treeNodeServerList(&nodeSet) ;
2039 // TIterator* iter = nodeSet.createIterator() ;
2040 // RooAbsArg* node ;
2041 
2042 
2043 // // iterate over nodes
2044 // while((node=(RooAbsArg*)iter->Next())) {
2045 
2046 // // Skip node that represent numeric constants
2047 // if (node->IsA()->InheritsFrom(RooConstVar::Class())) continue ;
2048 
2049 // string nodeName ;
2050 // if (useFactoryTag && node->getStringAttribute("factory_tag")) {
2051 // nodeName = node->getStringAttribute("factory_tag") ;
2052 // } else {
2053 // if (node->isFundamental()) {
2054 // nodeName = node->GetName();
2055 // } else {
2056 // ostringstream oss ;
2057 // node->printStream(oss,(node->defaultPrintContents(0)&(~kValue)),node->defaultPrintStyle(0)) ;
2058 // nodeName= oss.str() ;
2059 // // nodeName = Form("%s::%s",node->IsA()->GetName(),node->GetName());
2060 
2061 // }
2062 // }
2063 // if (strncmp(nodeName.c_str(),"Roo",3)==0) {
2064 // nodeName = string(nodeName.c_str()+3) ;
2065 // }
2066 // node->setStringAttribute("graph_name",nodeName.c_str()) ;
2067 
2068 // TGraphNode* gnode = theGraph->AddNode(nodeName.c_str(),nodeName.c_str()) ;
2069 // gnode->SetLineWidth(2) ;
2070 // gnode->SetTextColor(node->isFundamental()?kBlue:kRed) ;
2071 // gnode->SetTextSize(textSize) ;
2072 // }
2073 // delete iter ;
2074 
2075 // // Get set of all server links
2076 // set<pair<RooAbsArg*,RooAbsArg*> > links ;
2077 // graphVizAddConnections(links) ;
2078 
2079 // // And insert them into the graph
2080 // set<pair<RooAbsArg*,RooAbsArg*> >::iterator liter = links.begin() ;
2081 // for( ; liter != links.end() ; ++liter ) {
2082 
2083 // TGraphNode* n1 = (TGraphNode*)theGraph->GetListOfNodes()->FindObject(liter->first->getStringAttribute("graph_name")) ;
2084 // TGraphNode* n2 = (TGraphNode*)theGraph->GetListOfNodes()->FindObject(liter->second->getStringAttribute("graph_name")) ;
2085 // if (n1 && n2) {
2086 // TGraphEdge* edge = theGraph->AddEdge(n1,n2) ;
2087 // edge->SetLineWidth(2) ;
2088 // }
2089 // }
2090 
2091 // return theGraph ;
2092 // }
2093 
2094 
2095 
2096 // //_____________________________________________________________________________
2097 // Bool_t RooAbsArg::inhibitDirty()
2098 // {
2099 // // Return current status of the inhibitDirty global flag. If true
2100 // // no dirty state change tracking occurs and all caches are considered
2101 // // to be always dirty.
2102 // return _inhibitDirty ;
2103 // }
2104 
2105 
2106 ////////////////////////////////////////////////////////////////////////////////
2107 /// Take ownership of the contents of 'comps'
2108 
2110 {
2111  if (!_ownedComponents) {
2112  _ownedComponents = new RooArgSet("owned components") ;
2113  }
2114  return _ownedComponents->addOwned(comps) ;
2115 }
2116 
2117 
2118 
2119 ////////////////////////////////////////////////////////////////////////////////
2120 /// Clone tree expression of objects. All tree nodes will be owned by
2121 /// the head node return by cloneTree()
2122 
2123 RooAbsArg* RooAbsArg::cloneTree(const char* newname) const
2124 {
2125  // Clone tree using snapshot
2126  RooArgSet* clonedNodes = (RooArgSet*) RooArgSet(*this).snapshot(kTRUE) ;
2127 
2128  // Find the head node in the cloneSet
2129  RooAbsArg* head = clonedNodes->find(*this) ;
2130  assert(head);
2131 
2132  // Remove the head node from the cloneSet
2133  // To release it from the set ownership
2134  clonedNodes->remove(*head) ;
2135 
2136  // Add the set as owned component of the head
2137  head->addOwnedComponents(*clonedNodes) ;
2138 
2139  // Delete intermediate container
2140  clonedNodes->releaseOwnership() ;
2141  delete clonedNodes ;
2142 
2143  // Adjust name of head node if requested
2144  if (newname) {
2145  head->TNamed::SetName(newname) ;
2146  head->_namePtr = (TNamed*) RooNameReg::instance().constPtr(newname) ;
2147  }
2148 
2149  // Return the head
2150  return head ;
2151 }
2152 
2153 
2154 
2155 ////////////////////////////////////////////////////////////////////////////////
2156 
2158 {
2159  if (dynamic_cast<RooTreeDataStore*>(&store)) {
2160  attachToTree(((RooTreeDataStore&)store).tree()) ;
2161  } else if (dynamic_cast<RooVectorDataStore*>(&store)) {
2163  }
2164 }
2165 
2166 
2167 
2168 ////////////////////////////////////////////////////////////////////////////////
2169 
2171 {
2172  if (_eocache) {
2173  return *_eocache ;
2174  } else {
2176  }
2177 }
2178 
2179 
2180 ////////////////////////////////////////////////////////////////////////////////
2181 
2183 {
2184  string suffix ;
2185 
2186  RooArgSet branches ;
2187  branchNodeServerList(&branches) ;
2188  RooFIter iter = branches.fwdIterator();
2189  RooAbsArg* arg ;
2190  while((arg=iter.next())) {
2191  const char* tmp = arg->cacheUniqueSuffix() ;
2192  if (tmp) suffix += tmp ;
2193  }
2194  return Form("%s",suffix.c_str()) ;
2195 }
2196 
2197 
2198 ////////////////////////////////////////////////////////////////////////////////
2199 
2201 {
2202  RooArgSet branches ;
2203  branchNodeServerList(&branches) ;
2204  RooFIter iter = branches.fwdIterator() ;
2205  RooAbsArg* arg ;
2206  while((arg=iter.next())) {
2207 // cout << "wiring caches on node " << arg->GetName() << endl ;
2208  for (deque<RooAbsCache*>::iterator iter2 = arg->_cacheList.begin() ; iter2 != arg->_cacheList.end() ; ++iter2) {
2209  (*iter2)->wireCache() ;
2210  }
2211  }
2212 }
2213 
2214 
2215 
2216 ////////////////////////////////////////////////////////////////////////////////
2217 
2218 void RooAbsArg::SetName(const char* name)
2219 {
2221  TNamed* newPtr = (TNamed*) RooNameReg::instance().constPtr(GetName()) ;
2222  if (newPtr != _namePtr) {
2223  //cout << "Rename '" << _namePtr->GetName() << "' to '" << name << "' (set flag in new name)" << endl;
2224  _namePtr = newPtr;
2226  }
2227 }
2228 
2229 
2230 
2231 
2232 ////////////////////////////////////////////////////////////////////////////////
2233 
2234 void RooAbsArg::SetNameTitle(const char *name, const char *title)
2235 {
2236  TNamed::SetNameTitle(name,title) ;
2237  TNamed* newPtr = (TNamed*) RooNameReg::instance().constPtr(GetName()) ;
2238  if (newPtr != _namePtr) {
2239  //cout << "Rename '" << _namePtr->GetName() << "' to '" << name << "' (set flag in new name)" << endl;
2240  _namePtr = newPtr;
2242  }
2243 }
2244 
2245 
2246 ////////////////////////////////////////////////////////////////////////////////
2247 /// Stream an object of class RooAbsArg.
2248 
2249 void RooAbsArg::Streamer(TBuffer &R__b)
2250 {
2251  if (R__b.IsReading()) {
2252  _ioReadStack.push(this) ;
2253  R__b.ReadClassBuffer(RooAbsArg::Class(),this);
2254  _ioReadStack.pop() ;
2256  _isConstant = getAttribute("Constant") ;
2257  } else {
2258  R__b.WriteClassBuffer(RooAbsArg::Class(),this);
2259  }
2260 }
2261 
2262 ////////////////////////////////////////////////////////////////////////////////
2263 /// Method called by workspace container to finalize schema evolution issues
2264 /// that cannot be handled in a single ioStreamer pass.
2265 ///
2266 /// A second pass is typically needed when evolving data member of RooAbsArg-derived
2267 /// classes that are container classes with references to other members, which may
2268 /// not yet be 'live' in the first ioStreamer() evolution pass.
2269 ///
2270 /// Classes may overload this function, but must call the base method in the
2271 /// overloaded call to ensure base evolution is handled properly
2272 
2274 {
2275  // Handling of v5-v6 migration (TRefArray _proxyList --> RooRefArray _proxyList)
2276  auto iter = _ioEvoList.find(this);
2277  if (iter != _ioEvoList.end()) {
2278 
2279  // Transfer contents of saved TRefArray to RooRefArray now
2280  if (!_proxyList.GetEntriesFast())
2281  _proxyList.Expand(iter->second->GetEntriesFast());
2282  for (int i = 0; i < iter->second->GetEntriesFast(); i++) {
2283  _proxyList.Add(iter->second->At(i));
2284  }
2285  // Delete TRefArray and remove from list
2286  _ioEvoList.erase(iter);
2287  }
2288 }
2289 
2290 
2291 
2292 
2293 ////////////////////////////////////////////////////////////////////////////////
2294 /// Method called by workspace container to finalize schema evolution issues
2295 /// that cannot be handled in a single ioStreamer pass. This static finalize method
2296 /// is called after ioStreamerPass2() is called on each directly listed object
2297 /// in the workspace. It's purpose is to complete schema evolution of any
2298 /// objects in the workspace that are not directly listed as content elements
2299 /// (e.g. analytical convolution tokens )
2300 
2302 {
2303  // Handling of v5-v6 migration (TRefArray _proxyList --> RooRefArray _proxyList)
2304  for (const auto& iter : _ioEvoList) {
2305 
2306  // Transfer contents of saved TRefArray to RooRefArray now
2307  if (!iter.first->_proxyList.GetEntriesFast())
2308  iter.first->_proxyList.Expand(iter.second->GetEntriesFast());
2309  for (int i = 0; i < iter.second->GetEntriesFast(); i++) {
2310  iter.first->_proxyList.Add(iter.second->At(i));
2311  }
2312  }
2313 
2314  _ioEvoList.clear();
2315 }
2316 
2317 
2321 }
2322 
2323 ////////////////////////////////////////////////////////////////////////////////
2324 /// Stream an object of class RooRefArray.
2325 
2326 void RooRefArray::Streamer(TBuffer &R__b)
2327 {
2328  UInt_t R__s, R__c;
2329  if (R__b.IsReading()) {
2330 
2331  Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
2332 
2333  // Make temporary refArray and read that from the streamer
2334  auto refArray = std::make_unique<TRefArray>();
2335  refArray->Streamer(R__b) ;
2336  R__b.CheckByteCount(R__s, R__c, refArray->IsA());
2337 
2338  // Schedule deferred processing of TRefArray into proxy list
2339  RooAbsArg::_ioEvoList[RooAbsArg::_ioReadStack.top()] = std::move(refArray);
2340 
2341  } else {
2342 
2343  R__c = R__b.WriteVersion(RooRefArray::IsA(), kTRUE);
2344 
2345  // Make a temporary refArray and write that to the streamer
2346  TRefArray refArray(GetEntriesFast());
2347  TIterator* iter = MakeIterator() ;
2348  TObject* tmpObj ; while ((tmpObj = iter->Next())) {
2349  refArray.Add(tmpObj) ;
2350  }
2351  delete iter ;
2352 
2353  refArray.Streamer(R__b) ;
2354  R__b.SetByteCount(R__c, kTRUE) ;
2355 
2356  }
2357 }
2358 
2359 /// Print at the prompt
2360 namespace cling {
2361 std::string printValue(RooAbsArg *raa)
2362 {
2363  std::stringstream s;
2364  if (0 == *raa->GetName() && 0 == *raa->GetTitle()) {
2365  s << "An instance of " << raa->ClassName() << ".";
2366  return s.str();
2367  }
2368  raa->printStream(s, raa->defaultPrintContents(""), raa->defaultPrintStyle(""));
2369  return s.str();
2370 }
2371 } // namespace cling
2372 
RooSTLRefCountList::containsByNamePtr
bool containsByNamePtr(const T *obj) const
Check if list contains an item using findByNamePointer().
Definition: RooSTLRefCountList.h:162
RooAbsProxy::print
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Print proxy name.
Definition: RooAbsProxy.cxx:74
RooAbsArg::getCache
RooAbsCache * getCache(Int_t index) const
Return registered cache object by index.
Definition: RooAbsArg.cxx:1902
RooAbsArg::numProxies
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1243
RooAbsArg::ADirty
@ ADirty
Definition: RooAbsArg.h:491
RooAbsArg::isValueServer
Bool_t isValueServer(const RooAbsArg &arg) const
Check if this is serving values to arg.
Definition: RooAbsArg.h:217
RooWorkspace.h
first
Definition: first.py:1
RooNameReg::instance
static RooNameReg & instance()
Return reference to singleton instance.
Definition: RooNameReg.cxx:51
RooAbsArg::_inhibitDirty
static Bool_t _inhibitDirty
Definition: RooAbsArg.h:648
RooAbsArg::operMode
OperMode operMode() const
Definition: RooAbsArg.h:492
cxcoutF
#define cxcoutF(a)
Definition: RooMsgService.h:101
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
Version_t
short Version_t
Definition: RtypesCore.h:65
RooAbsArg::printTitle
virtual void printTitle(std::ostream &os) const
Print object title.
Definition: RooAbsArg.cxx:1301
RooMsgService.h
RooAbsArg::_boolAttribTransient
std::set< std::string > _boolAttribTransient
Definition: RooAbsArg.h:618
TNamed::SetNameTitle
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: TNamed.cxx:154
RooAbsCollection::first
RooAbsArg * first() const
Definition: RooAbsCollection.h:176
RooSTLRefCountList::size
std::size_t size() const
Number of contained objects (neglecting the ref count).
Definition: RooSTLRefCountList.h:101
RooAbsArg::_localNoInhibitDirty
Bool_t _localNoInhibitDirty
Cached isConstant status.
Definition: RooAbsArg.h:676
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
RooAbsData
Definition: RooAbsData.h:46
RooAbsArg::_boolAttrib
std::set< std::string > _boolAttrib
Definition: RooAbsArg.h:616
RooFit.h
RooAbsArg::printArgs
virtual void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
Definition: RooAbsArg.cxx:1328
RooFit::InputArguments
@ InputArguments
Definition: RooGlobalFunc.h:68
RooAbsArg::recursiveCheckObservables
Bool_t recursiveCheckObservables(const RooArgSet *nset) const
Recursively call checkObservables on all nodes in the expression tree.
Definition: RooAbsArg.cxx:706
TBuffer::WriteVersion
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
RooAbsArg::getComponents
RooArgSet * getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
Definition: RooAbsArg.cxx:679
TBuffer::SetByteCount
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
RooArgSet.h
TString::Data
const char * Data() const
Definition: TString.h:369
RooAbsArg::Auto
@ Auto
Definition: RooAbsArg.h:491
TNamed::operator=
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Definition: TNamed.cxx:51
RooPrintable::kStandard
@ kStandard
Definition: RooPrintable.h:34
RooAbsArg::_isConstant
Bool_t _isConstant
Do not persist. Pointer to global instance of string that matches object named.
Definition: RooAbsArg.h:674
RooAbsArg::unRegisterCache
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
Definition: RooAbsArg.cxx:1883
tree
Definition: tree.py:1
RooAbsCache::operModeHook
virtual void operModeHook()
Interface for operation mode changes.
Definition: RooAbsCache.cxx:99
operator<<
ostream & operator<<(ostream &os, RooAbsArg &arg)
Ostream operator.
Definition: RooAbsArg.cxx:1435
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TObjArray::Remove
virtual TObject * Remove(TObject *obj)
Remove object from array.
Definition: TObjArray.cxx:719
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
RooAbsArg::ioStreamerPass2Finalize
static void ioStreamerPass2Finalize()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2301
RooAbsArg::redirectServersHook
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Definition: RooAbsArg.h:263
RooAbsArg::dependsOnValue
Bool_t dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0) const
Check whether this object depends on values from an element in the serverList.
Definition: RooAbsArg.h:103
RooAbsArg::cleanBranchName
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
Definition: RooAbsArg.cxx:1832
RooAbsArg::~RooAbsArg
virtual ~RooAbsArg()
Destructor.
Definition: RooAbsArg.cxx:190
RooSetProxy
Definition: RooSetProxy.h:23
RooAbsArg::Print
virtual void Print(Option_t *options=0) const
Print the object to the defaultPrintStream().
Definition: RooAbsArg.h:320
RooAbsArg::graphVizTree
void graphVizTree(const char *fileName, const char *delimiter="\n", bool useTitle=false, bool useLatex=false)
Create a GraphViz .dot file visualizing the expression tree headed by this RooAbsArg object.
Definition: RooAbsArg.cxx:1948
TBuffer::ReadClassBuffer
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
RooAbsArg::printAttribList
void printAttribList(std::ostream &os) const
Transient boolean attributes (not copied in ctor)
Definition: RooAbsArg.cxx:1453
RooAbsCollection::fwdIterator
RooFIter fwdIterator() const
One-time forward iterator.
Definition: RooAbsCollection.h:133
RooAbsArg::_serverList
RefCountList_t _serverList
Definition: RooAbsArg.h:587
coutE
#define coutE(a)
Definition: RooMsgService.h:33
RooAbsArg::namePtr
const TNamed * namePtr() const
Definition: RooAbsArg.h:517
TTree
Definition: TTree.h:79
RooNameReg::kRenamedArg
@ kRenamedArg
Definition: RooNameReg.h:51
RooAbsArg::writeToStream
virtual void writeToStream(std::ostream &os, Bool_t compact) const =0
RooResolutionModel.h
RooFit::Optimization
@ Optimization
Definition: RooGlobalFunc.h:68
operator=
Binding & operator=(OUT(*fun)(void))
Definition: TRInterface_Binding.h:11
RooAbsArg::SetName
void SetName(const char *name)
Set the name of the TNamed.
Definition: RooAbsArg.cxx:2218
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
RooAbsProxy::name
virtual const char * name() const
Definition: RooAbsProxy.h:54
RooAbsArg.h
RooAbsArg::RefCountListLegacyIterator_t
TIteratorToSTLInterface< RefCountList_t::Container_t > RefCountListLegacyIterator_t
Definition: RooAbsArg.h:76
RooAbsArg::ioStreamerPass2
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2273
RooAbsArg::checkObservables
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Definition: RooAbsArg.cxx:697
RooSTLRefCountList::refCount
std::size_t refCount(typename Container_t::const_iterator item) const
Return ref count of item that iterator points to.
Definition: RooSTLRefCountList.h:65
RooAbsArg::getTransientAttribute
Bool_t getTransientAttribute(const Text_t *name) const
Check if a named attribute is set.
Definition: RooAbsArg.cxx:340
RooAbsCollection::remove
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
Definition: RooAbsCollection.cxx:584
RooAbsArg::printMultiline
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multi-line detailed printing.
Definition: RooAbsArg.cxx:1361
RooAbsArg::defaultPrintContents
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default contents to print.
Definition: RooAbsArg.cxx:1351
TNamed::fName
TString fName
Definition: TNamed.h:38
RooAbsArg::isShapeServer
Bool_t isShapeServer(const RooAbsArg &arg) const
Check if this is serving shape to arg.
Definition: RooAbsArg.h:225
RooAbsCollection::find
RooAbsArg * find(const char *name) const
Find object with given name in list.
Definition: RooAbsCollection.cxx:813
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
RooAbsArg::setOperMode
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
Definition: RooAbsArg.cxx:1720
TObjArray::GetEntries
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:523
RooAbsArg::treeNodeServerList
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t doBranch=kTRUE, Bool_t doLeaf=kTRUE, Bool_t valueOnly=kFALSE, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
Definition: RooAbsArg.cxx:504
coutI
#define coutI(a)
Definition: RooMsgService.h:30
RooAbsArg::_clientListShape
RefCountList_t _clientListShape
Definition: RooAbsArg.h:589
TClass.h
RooAbsArg::changeServer
void changeServer(RooAbsArg &server, Bool_t valueProp, Bool_t shapeProp)
Change dirty flag propagation mask for specified server.
Definition: RooAbsArg.cxx:443
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooAbsArg::Compare
Int_t Compare(const TObject *other) const
Utility function used by TCollection::Sort to compare contained TObjects We implement comparison by n...
Definition: RooAbsArg.cxx:1507
RooNameSet.h
RooArgSet::add
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
RooAbsArg::printCompactTree
void printCompactTree(const char *indent="", const char *fileName=0, const char *namePat=0, RooAbsArg *client=0)
Print tree structure of expression tree on stdout, or to file if filename is specified.
Definition: RooAbsArg.cxx:1747
RooArgProxy::isShapeServer
Bool_t isShapeServer() const
Definition: RooArgProxy.h:79
TRefArray
Definition: TRefArray.h:39
RooAbsArg::getProxy
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1230
RooAbsArg::inhibitDirty
Bool_t inhibitDirty() const
Delete watch flag.
Definition: RooAbsArg.cxx:83
TBuffer
Definition: TBuffer.h:43
RooConstVar
Definition: RooConstVar.h:25
RooAbsArg::isCloneOf
Bool_t isCloneOf(const RooAbsArg &other) const
Check if this object was created as a clone of 'other'.
Definition: RooAbsArg.cxx:249
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
RooAbsProxy::changePointer
virtual Bool_t changePointer(const RooAbsCollection &newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE)=0
RooAbsArg::attachToVStore
virtual void attachToVStore(RooVectorDataStore &vstore)=0
RooSetProxy.h
RooAbsArg::recursiveRedirectServers
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
Definition: RooAbsArg.cxx:1066
TBuffer::CheckByteCount
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
TString
Definition: TString.h:136
RooAbsCollection::GetName
const char * GetName() const
Returns name of object.
Definition: RooAbsCollection.h:226
RooAbsArg::expensiveObjectCache
RooExpensiveObjectCache & expensiveObjectCache() const
Definition: RooAbsArg.cxx:2170
RooPrintable
Definition: RooPrintable.h:25
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
RooWorkspace::set
const RooArgSet * set(const char *name)
Return pointer to previously defined named set with given nmame If no such set is found a null pointe...
Definition: RooWorkspace.cxx:977
RooAbsArg::_fast
Bool_t _fast
Definition: RooAbsArg.h:664
RooAbsArg::makeLegacyIterator
RefCountListLegacyIterator_t * makeLegacyIterator(const RefCountList_t &list) const
Definition: RooAbsArg.cxx:2319
RooSTLRefCountList::empty
bool empty() const
Check if empty.
Definition: RooSTLRefCountList.h:114
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
RooTreeDataStore.h
RooAbsArg::branchNodeServerList
void branchNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all branch nodes of the arg tree starting with ourself as top node.
Definition: RooAbsArg.cxx:488
RooAbsCache::redirectServersHook
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Interface for server redirect calls.
Definition: RooAbsCache.cxx:89
RooExpensiveObjectCache
Definition: RooExpensiveObjectCache.h:24
bool
TIterator
Definition: TIterator.h:30
operator+
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Definition: TString.cxx:1474
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
RooAbsArg::registerProxy
void registerProxy(RooArgProxy &proxy)
Register an RooArgProxy in the proxy list.
Definition: RooAbsArg.cxx:1121
RooArgSet::addOwned
virtual Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooArgSet.h:92
TObjArray::Add
void Add(TObject *obj)
Definition: TObjArray.h:74
TGeant4Unit::liter
static constexpr double liter
Definition: TGeant4SystemOfUnits.h:122
RooAbsArg::graphVizAddConnections
void graphVizAddConnections(std::set< std::pair< RooAbsArg *, RooAbsArg * > > &)
Utility function that inserts all point-to-point client-server connections between any two RooAbsArgs...
Definition: RooAbsArg.cxx:2019
RooRealIntegral
Definition: RooRealIntegral.h:34
RooSTLRefCountList::end
Container_t::const_iterator end() const
End of contained objects.
Definition: RooSTLRefCountList.h:84
RooAbsArg::findNewServer
RooAbsArg * findNewServer(const RooAbsCollection &newSet, Bool_t nameChange) const
Find the new server in the specified set that matches the old server.
Definition: RooAbsArg.cxx:1029
RooLinkedList::findArg
RooAbsArg * findArg(const RooAbsArg *) const
Return pointer to object with given name in collection.
Definition: RooLinkedList.cxx:675
RooAbsArg::_namePtr
TNamed * _namePtr
Definition: RooAbsArg.h:673
RooSTLRefCountList::begin
Container_t::const_iterator begin() const
Iterator over contained objects.
Definition: RooSTLRefCountList.h:79
RooAbsArg::getParameters
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Definition: RooAbsArg.cxx:546
RooAbsArg::isDerived
virtual Bool_t isDerived() const
Does value or shape of this arg depend on any other arg?
Definition: RooAbsArg.h:93
RooFit::LinkStateMgmt
@ LinkStateMgmt
Definition: RooGlobalFunc.h:67
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
RooTrace.h
RooAbsArg::getCloningAncestors
RooLinkedList getCloningAncestors() const
Return ancestors in cloning chain of this RooAbsArg.
Definition: RooAbsArg.cxx:1921
RooAbsArg::addParameters
void addParameters(RooArgSet &params, const RooArgSet *nset=0, Bool_t stripDisconnected=kTRUE) const
INTERNAL helper function for getParameters()
Definition: RooAbsArg.cxx:555
RooAbsArg::setStringAttribute
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
Definition: RooAbsArg.cxx:291
RooAbsArg::_eocache
RooExpensiveObjectCache * _eocache
Prohibit server redirects – Debugging tool.
Definition: RooAbsArg.h:671
RooPrintable::kName
@ kName
Definition: RooPrintable.h:33
RooAbsArg::_prohibitServerRedirect
Bool_t _prohibitServerRedirect
Set of owned component.
Definition: RooAbsArg.h:669
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
RooResolutionModel
Definition: RooResolutionModel.h:26
TBuffer.h
RooSTLRefCountList::Add
void Add(T *obj, std::size_t initialCount=1)
Add an object or increase refCount if it is already present.
Definition: RooSTLRefCountList.h:51
RooAbsArg::replaceServer
void replaceServer(RooAbsArg &oldServer, RooAbsArg &newServer, Bool_t valueProp, Bool_t shapeProp)
Replace 'oldServer' with 'newServer'.
Definition: RooAbsArg.cxx:432
RooAbsArg::SetNameTitle
void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: RooAbsArg.cxx:2234
RooAbsArg::operator=
RooAbsArg & operator=(const RooAbsArg &other)
Assign all boolean and string properties of the original object.
Definition: RooAbsArg.cxx:157
RooNameReg::constPtr
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:61
RooArgProxy
Definition: RooArgProxy.h:24
RooSTLRefCountList::reserve
void reserve(std::size_t amount)
Definition: RooSTLRefCountList.h:107
RooAbsArg::isValid
virtual Bool_t isValid() const
WVE (08/21/01) Probably obsolete now.
Definition: RooAbsArg.cxx:1280
RooAbsArg::printComponentTree
void printComponentTree(const char *indent="", const char *namePat=0, Int_t nLevel=999)
Print tree structure of expression tree on given ostream, only branch nodes are printed.
Definition: RooAbsArg.cxx:1807
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
RooAbsArg::_valueDirty
Bool_t _valueDirty
Definition: RooAbsArg.h:659
RooAbsArg::removeServer
void removeServer(RooAbsArg &server, Bool_t force=kFALSE)
Unregister another RooAbsArg as a server to us, ie, declare that we no longer depend on its value and...
Definition: RooAbsArg.cxx:407
RooAbsArg::printAddress
virtual void printAddress(std::ostream &os) const
Print class name of object.
Definition: RooAbsArg.cxx:1317
RooAbsArg::isValueDirty
Bool_t isValueDirty() const
Definition: RooAbsArg.h:429
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
RooAbsArg::registerCache
void registerCache(RooAbsCache &cache)
Register RooAbsCache with this object.
Definition: RooAbsArg.cxx:1874
RooAbsArg::_operMode
OperMode _operMode
Mark batches as dirty (only meaningful for RooAbsReal).
Definition: RooAbsArg.h:663
TNamed
Definition: TNamed.h:29
RooAbsCache::printCompactTreeHook
virtual void printCompactTreeHook(std::ostream &, const char *)
Interface for printing of cache guts in tree mode printing.
Definition: RooAbsCache.cxx:117
RooFIter
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
Definition: RooLinkedListIter.h:39
TBuffer::WriteClassBuffer
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
RooArgProxy::absArg
RooAbsArg * absArg() const
Definition: RooArgProxy.h:51
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
RooAbsData::get
virtual const RooArgSet * get() const
Definition: RooAbsData.h:89
RooLinkedList
Definition: RooLinkedList.h:35
RooSTLRefCountList::RemoveAll
void RemoveAll(const T *obj)
Remove from list irrespective of ref count.
Definition: RooSTLRefCountList.h:193
RooWorkspace::defineSetInternal
Bool_t defineSetInternal(const char *name, const RooArgSet &aset)
Definition: RooWorkspace.cxx:891
RooFIter::next
RooAbsArg * next()
Return next element or nullptr if at end.
Definition: RooLinkedListIter.h:49
RooPrintable::kArgs
@ kArgs
Definition: RooPrintable.h:33
RooAbsArg::attachDataStore
void attachDataStore(const RooAbsDataStore &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Definition: RooAbsArg.cxx:1488
RooAbsArg::_clientList
RefCountList_t _clientList
Definition: RooAbsArg.h:588
RooAbsCollection
Definition: RooAbsCollection.h:30
RooAbsArg::verboseDirty
static void verboseDirty(Bool_t flag)
Activate verbose messaging related to dirty flag propagation.
Definition: RooAbsArg.cxx:241
RooAbsArg::AClean
@ AClean
Definition: RooAbsArg.h:491
RooAbsArg::RooArgSet
friend class RooArgSet
Definition: RooAbsArg.h:579
RooAbsArg::setProxyNormSet
void setProxyNormSet(const RooArgSet *nset)
Forward a change in the cached normalization argset to all the registered proxies.
Definition: RooAbsArg.cxx:1254
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:437
RooAbsArg::getStringAttribute
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
Definition: RooAbsArg.cxx:304
RooAbsArg::optimizeCacheMode
virtual void optimizeCacheMode(const RooArgSet &observables)
Activate cache mode optimization with given definition of observables.
Definition: RooAbsArg.cxx:1551
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
RooAbsCollection::size
Storage_t::size_type size() const
Definition: RooAbsCollection.h:154
RooSTLRefCountList< RooAbsArg >
RooExpensiveObjectCache::instance
static RooExpensiveObjectCache & instance()
Return reference to singleton instance.
Definition: RooExpensiveObjectCache.cxx:80
RooSTLRefCountList::containedObjects
const Container_t & containedObjects() const
Direct reference to container of objects held by this list.
Definition: RooSTLRefCountList.h:95
RooLinkedList::Add
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:62
RooPrintable::kValue
@ kValue
Definition: RooPrintable.h:33
RooAbsArg::_clientListValue
RefCountList_t _clientListValue
Definition: RooAbsArg.h:590
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
RooAbsArg::printDirty
void printDirty(Bool_t depth=kTRUE) const
Print information about current value dirty state information.
Definition: RooAbsArg.cxx:1519
RooAbsArg::constOptimizeTestStatistic
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Interface function signaling a request to perform constant term optimization.
Definition: RooAbsArg.cxx:1707
RooAbsArg::attachDataSet
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Definition: RooAbsArg.cxx:1469
RooListProxy
Definition: RooListProxy.h:24
RooAbsDataStore::get
virtual const RooArgSet * get(Int_t index) const =0
TBuffer::ReadVersion
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
RooAbsArg::overlaps
Bool_t overlaps(const RooAbsArg &testArg, Bool_t valueOnly=kFALSE) const
Test if any of the nodes of tree are shared with that of the given tree.
Definition: RooAbsArg.cxx:787
RooAbsProxy::changeNormSet
virtual void changeNormSet(const RooArgSet *newNormSet)
Destructor.
Definition: RooAbsProxy.cxx:64
RooSecondMoment.h
RooAbsCollection::releaseOwnership
void releaseOwnership()
Definition: RooAbsCollection.h:239
RooArgProxy::isValueServer
Bool_t isValueServer() const
Definition: RooArgProxy.h:75
RooTreeDataStore
Definition: RooTreeDataStore.h:31
RooAbsDataStore.h
TIterator::Next
virtual TObject * Next()=0
unsigned int
RooExpensiveObjectCache.h
RooConstVar.h
RooAbsArg::isFundamental
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:243
RooAbsArg::printTree
virtual void printTree(std::ostream &os, TString indent="") const
Print object tree structure.
Definition: RooAbsArg.cxx:1426
TVirtualStreamerInfo.h
RooAbsArg::_shapeDirty
Bool_t _shapeDirty
Definition: RooAbsArg.h:660
RooAbsArg::addServer
void addServer(RooAbsArg &server, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE, std::size_t refCount=1)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
Definition: RooAbsArg.cxx:356
RooFit::Tracing
@ Tracing
Definition: RooGlobalFunc.h:68
RooAbsArg::isShapeDirty
Bool_t isShapeDirty() const
Definition: RooAbsArg.h:424
TBuffer::IsReading
Bool_t IsReading() const
Definition: TBuffer.h:86
RooNameSet
Definition: RooNameSet.h:24
RooAbsArg::cacheUniqueSuffix
virtual const char * cacheUniqueSuffix() const
Definition: RooAbsArg.h:513
RooAbsArg::OperMode
OperMode
Definition: RooAbsArg.h:491
RooListProxy.h
RooAbsArg::readFromStream
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)=0
RooAbsArg::aggregateCacheUniqueSuffix
const char * aggregateCacheUniqueSuffix() const
Definition: RooAbsArg.cxx:2182
RooPrintable::kClassName
@ kClassName
Definition: RooPrintable.h:33
RooAbsData.h
RooAbsArg::setShapeDirty
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition: RooAbsArg.h:510
RooAbsArg::getObservables
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
Definition: RooAbsArg.h:294
RooAbsArg::getParametersHook
virtual void getParametersHook(const RooArgSet *, RooArgSet *, Bool_t) const
Definition: RooAbsArg.h:546
RooAbsArg::addOwnedComponents
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
Definition: RooAbsArg.cxx:2109
RooAbsArg::_proxyList
RooRefArray _proxyList
Definition: RooAbsArg.h:592
RooAbsArg::leafNodeServerList
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node.
Definition: RooAbsArg.cxx:477
RooAbsArg::setTransientAttribute
void setTransientAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:318
TObjArray::MakeIterator
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Definition: TObjArray.cxx:649
TObjArray::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Definition: TObjArray.cxx:415
RooAbsCategoryLValue.h
RooAbsCache
Definition: RooAbsCache.h:27
TObjArray::Expand
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
Definition: TObjArray.cxx:387
RooVectorDataStore
Definition: RooVectorDataStore.h:35
RooAbsArg::_stringAttrib
std::map< std::string, std::string > _stringAttrib
Definition: RooAbsArg.h:617
TObject
Definition: TObject.h:37
coutF
#define coutF(a)
Definition: RooMsgService.h:34
RooAbsArg::setAttribute
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:259
RooNameSet::content
const char * content() const
Definition: RooNameSet.h:50
RooAbsArg::cloneTree
virtual RooAbsArg * cloneTree(const char *newname=0) const
Clone tree expression of objects.
Definition: RooAbsArg.cxx:2123
name
char name[80]
Definition: TGX11.cxx:110
RooAbsArg::redirectServers
Bool_t redirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE)
Substitute our servers with those listed in newSet.
Definition: RooAbsArg.cxx:911
RooAbsArg::dependsOn
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Definition: RooAbsArg.cxx:732
RooPrintable::kTitle
@ kTitle
Definition: RooPrintable.h:33
RooPrintable::printStream
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Definition: RooPrintable.cxx:75
RooAbsArg::wireAllCaches
void wireAllCaches()
Definition: RooAbsArg.cxx:2200
RooPrintable::kSingleLine
@ kSingleLine
Definition: RooPrintable.h:34
TObjArray::Compress
virtual void Compress()
Remove empty slots from array.
Definition: TObjArray.cxx:334
RooAbsArg
Definition: RooAbsArg.h:73
RooAbsArg::setValueDirty
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition: RooAbsArg.h:505
RMakeUnique.hxx
RooRealIntegral.h
RooAbsProxy
Definition: RooAbsProxy.h:30
RooAbsCollection::Print
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
Definition: RooAbsCollection.h:199
RooAbsArg::printClassName
virtual void printClassName(std::ostream &os) const
Print object class name.
Definition: RooAbsArg.cxx:1311
RooAbsArg::setDirtyInhibit
static void setDirtyInhibit(Bool_t flag)
Control global dirty inhibit mode.
Definition: RooAbsArg.cxx:232
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
RooAbsCache::findConstantNodes
virtual void findConstantNodes(const RooArgSet &, RooArgSet &, RooLinkedList &)
Interface for constant term node finding calls.
Definition: RooAbsCache.cxx:108
RooAbsArg::_deleteWatch
Bool_t _deleteWatch
Definition: RooAbsArg.h:649
RooAbsArg::getVariables
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:1911
RooVectorDataStore.h
RooAbsArg::_cacheList
std::deque< RooAbsCache * > _cacheList
Definition: RooAbsArg.h:593
RooAbsCache::optimizeCacheMode
virtual void optimizeCacheMode(const RooArgSet &, RooArgSet &, RooLinkedList &)
Interface for processing of cache mode optimization calls.
Definition: RooAbsCache.cxx:80
RooAbsArg::findServer
RooAbsArg * findServer(const char *name) const
Return server of this with name name. Returns nullptr if not found.
Definition: RooAbsArg.h:203
RooAbsDataStore
Definition: RooAbsDataStore.h:31
RooAbsArg::ConstOpCode
ConstOpCode
Definition: RooAbsArg.h:392
Text_t
char Text_t
Definition: RtypesCore.h:62
RooAbsArg::_myws
RooWorkspace * _myws
Prevent 'AlwaysDirty' mode for this node.
Definition: RooAbsArg.h:681
RooAbsArg::operModeHook
virtual void operModeHook()
Definition: RooAbsArg.h:540
RooAbsArg::_ownedComponents
RooArgSet * _ownedComponents
Definition: RooAbsArg.h:667
RooPrintable::defaultPrintStyle
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Definition: RooPrintable.cxx:241
Class
void Class()
Definition: Class.C:29
RooFit::Integration
@ Integration
Definition: RooGlobalFunc.h:67
RooAbsArg::_allBatchesDirty
bool _allBatchesDirty
Definition: RooAbsArg.h:661
RooRealVar
Definition: RooRealVar.h:36
RooAbsArg::numCaches
Int_t numCaches() const
Return number of registered caches.
Definition: RooAbsArg.cxx:1893
RooAbsArg::_verboseDirty
static Bool_t _verboseDirty
Definition: RooAbsArg.h:647
RooAbsArg::unRegisterProxy
void unRegisterProxy(RooArgProxy &proxy)
Remove proxy from proxy list.
Definition: RooAbsArg.cxx:1149
RooFit::Contents
@ Contents
Definition: RooGlobalFunc.h:69
TObject::ClassName
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:130
RooAbsArg::observableOverlaps
Bool_t observableOverlaps(const RooAbsData *dset, const RooAbsArg &testArg) const
Test if any of the dependents of the arg tree (as determined by getObservables) overlaps with those o...
Definition: RooAbsArg.cxx:801
RooAbsArg::addServerList
void addServerList(RooAbsCollection &serverList, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE)
Register a list of RooAbsArg as servers to us by calling addServer() for each arg in the list.
Definition: RooAbsArg.cxx:392
cxcoutI
#define cxcoutI(a)
Definition: RooMsgService.h:85
RooAbsRealLValue.h
RooAbsArg::attachToStore
void attachToStore(RooAbsDataStore &store)
Attach this argument to the data store such that it reads data from there.
Definition: RooAbsArg.cxx:2157
RooAbsCollection::selectByAttrib
RooAbsCollection * selectByAttrib(const char *name, Bool_t value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
Definition: RooAbsCollection.cxx:677
RooAbsArg::printCompactTreeHook
virtual void printCompactTreeHook(std::ostream &os, const char *ind="")
Hook function interface for object to insert additional information when printed in the context of a ...
Definition: RooAbsArg.cxx:1861
RooAbsArg::printName
virtual void printName(std::ostream &os) const
Print object name.
Definition: RooAbsArg.cxx:1291
RooAbsArg::findConstantNodes
Bool_t findConstantNodes(const RooArgSet &observables, RooArgSet &cacheList)
Find branch nodes with all-constant parameters, and add them to the list of nodes that can be cached ...
Definition: RooAbsArg.cxx:1614
TIteratorToSTLInterface
TIterator and GenericRooFIter front end with STL back end.
Definition: RooLinkedListIter.h:98
RooAbsArg::isConstant
Bool_t isConstant() const
Check if the "Constant" attribute is set.
Definition: RooAbsArg.h:360
RooAbsCollection::reserve
void reserve(Storage_t::size_type count)
Definition: RooAbsCollection.h:162
RooAbsCollection::sort
void sort(Bool_t reverse=false)
Sort collection using std::sort and name comparison.
Definition: RooAbsCollection.cxx:1266
RooArgProxy.h
RooResolutionModel::isConvolved
Bool_t isConvolved()
Definition: RooResolutionModel.h:53
RooAbsCollection::getSize
Int_t getSize() const
Definition: RooAbsCollection.h:171
operator>>
istream & operator>>(istream &is, RooAbsArg &arg)
Istream operator.
Definition: RooAbsArg.cxx:1444
RooArgSet
Definition: RooArgSet.h:28
RooSTLRefCountList::Remove
void Remove(const T *obj, bool force=false)
Decrease ref count of given object.
Definition: RooSTLRefCountList.h:176
cxcoutD
#define cxcoutD(a)
Definition: RooMsgService.h:81
RooAbsArg::RooAbsArg
RooAbsArg()
Default constructor.
Definition: RooAbsArg.cxx:92
int
RooAbsArg::getAttribute
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:282
RooAbsArg::attachToTree
virtual void attachToTree(TTree &t, Int_t bufSize=32000)=0
Overloadable function for derived classes to implement attachment as branch to a TTree.
Definition: RooAbsArg.cxx:1269
RooAbsArg::printMetaArgs
virtual void printMetaArgs(std::ostream &) const
Definition: RooAbsArg.h:330
RooPrintable::printValue
virtual void printValue(std::ostream &os) const
Interface to print value of object.
Definition: RooPrintable.cxx:155