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