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