Logo ROOT  
Reference Guide
RooAbsArg.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsArg.h,v 1.93 2007/07/16 21:04:28 wouter Exp $
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#ifndef ROO_ABS_ARG
17#define ROO_ABS_ARG
18
19#include "TNamed.h"
20#include "TObjArray.h"
21#include "TRefArray.h"
22#include "RooPrintable.h"
23#include "RooSTLRefCountList.h"
24#include "RooAbsCache.h"
25#include "RooNameReg.h"
26#include "RooLinkedListIter.h"
28
29#include <map>
30#include <set>
31#include <deque>
32#include <stack>
33#include <string>
34#include <iostream>
35
36#ifndef R__LESS_INCLUDES
37#include "TClass.h"
38#include "THashList.h"
39#endif
40
41
42class TTree ;
43class RooArgSet ;
44class RooAbsCollection ;
45class RooTreeDataStore ;
47class RooAbsData ;
48class RooAbsDataStore ;
49class RooAbsProxy ;
50class RooArgProxy ;
51class RooSetProxy ;
52class RooListProxy ;
54class RooWorkspace ;
55
56class RooRefArray : public TObjArray {
57 public:
59 } ;
60 RooRefArray(const RooRefArray& other) : TObjArray(other) {
61 }
62 RooRefArray& operator=(const RooRefArray& other) = default;
63 virtual ~RooRefArray() {} ;
64 protected:
65 ClassDef(RooRefArray,1) // Helper class for proxy lists
66} ;
67
68class RooAbsArg;
69/// Print at the prompt
70namespace cling {
71std::string printValue(RooAbsArg*);
72}
73
74class RooAbsArg : public TNamed, public RooPrintable {
75public:
78
79 // Constructors, cloning and assignment
80 RooAbsArg() ;
81 virtual ~RooAbsArg();
82 RooAbsArg(const char *name, const char *title);
83 RooAbsArg(const RooAbsArg& other, const char* name=0) ;
84 RooAbsArg& operator=(const RooAbsArg& other);
85 virtual TObject* clone(const char* newname=0) const = 0 ;
86 virtual TObject* Clone(const char* newname = 0) const {
87 return clone(newname && newname[0] != '\0' ? newname : nullptr);
88 }
89 virtual RooAbsArg* cloneTree(const char* newname=0) const ;
90
91 // Accessors to client-server relation information
92
93 /// Does value or shape of this arg depend on any other arg?
94 virtual Bool_t isDerived() const {
95 return kTRUE ;
96 }
97 Bool_t isCloneOf(const RooAbsArg& other) const ;
98
99 /// Check whether this object depends on values from an element in the `serverList`.
100 ///
101 /// @param serverList Test if one of the elements in this list serves values to `this`.
102 /// @param ignoreArg Ignore values served by this object.
103 /// @return True if values are served.
104 Bool_t dependsOnValue(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg=0) const {
105 return dependsOn(serverList,ignoreArg,kTRUE) ;
106 }
107 /// Check whether this object depends on values served from the object passed as `server`.
108 ///
109 /// @param server Test if `server` serves values to `this`.
110 /// @param ignoreArg Ignore values served by this object.
111 /// @return True if values are served.
112 Bool_t dependsOnValue(const RooAbsArg& server, const RooAbsArg* ignoreArg=0) const {
113 return dependsOn(server,ignoreArg,kTRUE) ;
114 }
115 Bool_t dependsOn(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg=0, Bool_t valueOnly=kFALSE) const ;
116 Bool_t dependsOn(const RooAbsArg& server, const RooAbsArg* ignoreArg=0, Bool_t valueOnly=kFALSE) const ;
117 Bool_t overlaps(const RooAbsArg& testArg, Bool_t valueOnly=kFALSE) const ;
118 Bool_t hasClients() const { return !_clientList.empty(); }
119
120 ////////////////////////////////////////////////////////////////////////////
121 /// \name Legacy RooFit interface.
122 /// This is a collection of functions that remain supported, but more elegant
123 /// interfaces are usually available.
124 /// @{
125
126 /// Retrieve a client iterator.
127 inline TIterator* clientIterator() const
128 R__SUGGEST_ALTERNATIVE("Use clients() and begin(), end() or range-based loops.") {
129 // Return iterator over all client RooAbsArgs
131 }
133 R__SUGGEST_ALTERNATIVE("Use valueClients() and begin(), end() or range-based loops.") {
134 // Return iterator over all shape client RooAbsArgs
136 }
138 R__SUGGEST_ALTERNATIVE("Use shapeClients() and begin(), end() or range-based loops.") {
139 // Return iterator over all shape client RooAbsArgs
141 }
142 inline TIterator* serverIterator() const
143 R__SUGGEST_ALTERNATIVE("Use servers() and begin(), end() or range-based loops.") {
144 // Return iterator over all server RooAbsArgs
146 }
147
149 R__SUGGEST_ALTERNATIVE("Use valueClients() and begin(), end() or range-based loops.") {
150 return RooFIter(std::unique_ptr<RefCountListLegacyIterator_t>(makeLegacyIterator(_clientListValue)));
151 }
153 R__SUGGEST_ALTERNATIVE("Use shapeClients() and begin(), end() or range-based loops.") {
154 return RooFIter(std::unique_ptr<RefCountListLegacyIterator_t>(makeLegacyIterator(_clientListShape)));
155 }
157 R__SUGGEST_ALTERNATIVE("Use servers() and begin(), end() or range-based loops.") {
158 return RooFIter(std::unique_ptr<RefCountListLegacyIterator_t>(makeLegacyIterator(_serverList)));
159 }
160
161 // --- Obsolete functions for backward compatibility
162 /// \deprecated Use getObservables()
163 inline RooArgSet* getDependents(const RooArgSet& set) const { return getObservables(set) ; }
164 /// \deprecated Use getObservables()
165 inline RooArgSet* getDependents(const RooAbsData* set) const { return getObservables(set) ; }
166 /// \deprecated Use getObservables()
167 inline RooArgSet* getDependents(const RooArgSet* depList) const { return getObservables(depList) ; }
168 /// \deprecated Use observableOverlaps()
169 inline Bool_t dependentOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const { return observableOverlaps(dset,testArg) ; }
170 /// \deprecated Use observableOverlaps()
171 inline Bool_t dependentOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const { return observableOverlaps(depList, testArg) ; }
172 /// \deprecated Use checkObservables()
173 inline Bool_t checkDependents(const RooArgSet* nset) const { return checkObservables(nset) ; }
174 /// \deprecated Use recursiveCheckObservables()
175 inline Bool_t recursiveCheckDependents(const RooArgSet* nset) const { return recursiveCheckObservables(nset) ; }
176 // --- End obsolete functions for backward compatibility
177 /// @}
178 ////////////////////////////////////////////////////////////////////////////
179
180 ////////////////////////////////////////////////////////////////////////////
181 /// \anchor clientServerInterface
182 /// \name Client-Server Interface
183 /// These functions allow RooFit to figure out who is serving values to whom.
184 /// @{
185
186 /// List of all clients of this object.
187 const RefCountList_t& clients() const {
188 return _clientList;
189 }
190 /// List of all value clients of this object. Value clients receive value updates.
192 return _clientListValue;
193 }
194 /// List of all shape clients of this object. Shape clients receive property information such as
195 /// changes of a value range.
197 return _clientListShape;
198 }
199
200 /// List of all servers of this object.
201 const RefCountList_t& servers() const {
202 return _serverList;
203 }
204 /// Return server of `this` with name `name`. Returns nullptr if not found.
205 inline RooAbsArg* findServer(const char *name) const {
206 const auto serverIt = _serverList.findByName(name);
207 return serverIt != _serverList.end() ? *serverIt : nullptr;
208 }
209 /// Return server of `this` that has the same name as `arg`. Returns `nullptr` if not found.
210 inline RooAbsArg* findServer(const RooAbsArg& arg) const {
211 return _serverList.findByNamePointer(&arg);
212 }
213 /// Return i-th server from server list.
214 inline RooAbsArg* findServer(Int_t index) const {
215 return _serverList.containedObjects()[index];
216 }
217 /// Check if `this` is serving values to `arg`.
218 inline Bool_t isValueServer(const RooAbsArg& arg) const {
220 }
221 /// Check if `this` is serving values to an object with name `name`.
222 inline Bool_t isValueServer(const char* name) const {
224 }
225 /// Check if `this` is serving shape to `arg`.
226 inline Bool_t isShapeServer(const RooAbsArg& arg) const {
228 }
229 /// Check if `this` is serving shape to an object with name `name`.
230 inline Bool_t isShapeServer(const char* name) const {
232 }
233 void leafNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=0, Bool_t recurseNonDerived=kFALSE) const ;
234 void branchNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=0, Bool_t recurseNonDerived=kFALSE) const ;
235 void treeNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=0,
236 Bool_t doBranch=kTRUE, Bool_t doLeaf=kTRUE,
237 Bool_t valueOnly=kFALSE, Bool_t recurseNonDerived=kFALSE) const ;
238
239
240 /// Is this object a fundamental type that can be added to a dataset?
241 /// Fundamental-type subclasses override this method to return kTRUE.
242 /// Note that this test is subtlely different from the dynamic isDerived()
243 /// test, e.g. a constant is not derived but is also not fundamental.
244 inline virtual Bool_t isFundamental() const {
245 return kFALSE;
246 }
247
248 /// Create a fundamental-type object that stores our type of value. The
249 /// created object will have a valid value, but not necessarily the same
250 /// as our value. The caller is responsible for deleting the returned object.
251 virtual RooAbsArg *createFundamental(const char* newname=0) const = 0;
252
253 /// Is this argument an l-value, i.e., can it appear on the left-hand side
254 /// of an assignment expression? LValues are also special since they can
255 /// potentially be analytically integrated and generated.
256 inline virtual Bool_t isLValue() const {
257 return kFALSE;
258 }
259
260
261 // Server redirection interface
262 Bool_t redirectServers(const RooAbsCollection& newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE) ;
263 Bool_t recursiveRedirectServers(const RooAbsCollection& newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE) ;
264
265 /// Function that is called at the end of redirectServers(). Can be overloaded
266 /// to inject some class-dependent behavior after server redirection, e.g.
267 /// resetting of caches. The return value is meant to be an error flag, so in
268 /// case something goes wrong the function should return `true`.
269 ///
270 /// \see redirectServers() For a detailed explanation of the function parameters.
271 ///
272 /// \param[in] newServerList One of the original parameters passed to redirectServers().
273 /// \param[in] mustReplaceAll One of the original parameters passed to redirectServers().
274 /// \param[in] nameChange One of the original parameters passed to redirectServers().
275 /// \param[in] isRecursiveStep One of the original parameters passed to redirectServers().
276 virtual bool redirectServersHook(const RooAbsCollection & /*newServerList*/, bool /*mustReplaceAll*/,
277 bool /*nameChange*/, bool /*isRecursiveStep*/)
278 {
279 return false;
280 }
281
282
283 virtual void serverNameChangeHook(const RooAbsArg* /*oldServer*/, const RooAbsArg* /*newServer*/) { } ;
284
285 void addServer(RooAbsArg& server, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE, std::size_t refCount = 1);
286 void addServerList(RooAbsCollection& serverList, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE) ;
287 void replaceServer(RooAbsArg& oldServer, RooAbsArg& newServer, Bool_t valueProp, Bool_t shapeProp) ;
288 void changeServer(RooAbsArg& server, Bool_t valueProp, Bool_t shapeProp) ;
289 void removeServer(RooAbsArg& server, Bool_t force=kFALSE) ;
290 RooAbsArg *findNewServer(const RooAbsCollection &newSet, Bool_t nameChange) const;
291
292
293 /// @}
294 ///////////////////////////////////////////////////////////////////////////////
295
296
297 // Parameter & observable interpretation of servers
298 friend class RooProdPdf ;
299 friend class RooAddPdf ;
300 friend class RooAddPdfOrig ;
301 RooArgSet* getVariables(Bool_t stripDisconnected=kTRUE) const ;
302 RooArgSet* getParameters(const RooAbsData* data, bool stripDisconnected=true) const ;
303 /// Return the parameters of this p.d.f when used in conjuction with dataset 'data'
304 RooArgSet* getParameters(const RooAbsData& data, bool stripDisconnected=true) const {
305 return getParameters(&data,stripDisconnected) ;
306 }
307 /// Return the parameters of the p.d.f given the provided set of observables
308 RooArgSet* getParameters(const RooArgSet& observables, bool stripDisconnected=true) const {
309 return getParameters(&observables,stripDisconnected);
310 }
311 RooArgSet* getParameters(const RooArgSet* observables, bool stripDisconnected=true) const;
312 virtual bool getParameters(const RooArgSet* observables, RooArgSet& outputSet, bool stripDisconnected=true) const;
313 /// Given a set of possible observables, return the observables that this PDF depends on.
314 RooArgSet* getObservables(const RooArgSet& set, Bool_t valueOnly=kTRUE) const {
315 return getObservables(&set,valueOnly) ;
316 }
317 RooArgSet* getObservables(const RooAbsData* data) const ;
318 /// Return the observables of this pdf given the observables defined by `data`.
319 RooArgSet* getObservables(const RooAbsData& data) const {
320 return getObservables(&data) ;
321 }
322 RooArgSet* getObservables(const RooArgSet* depList, bool valueOnly=true) const ;
323 bool getObservables(const RooAbsCollection* depList, RooArgSet& outputSet, bool valueOnly=true) const;
324 Bool_t observableOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const ;
325 Bool_t observableOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const ;
326 virtual Bool_t checkObservables(const RooArgSet* nset) const ;
327 Bool_t recursiveCheckObservables(const RooArgSet* nset) const ;
328 RooArgSet* getComponents() const ;
329
330
331
332 void attachArgs(const RooAbsCollection &set);
333 void attachDataSet(const RooAbsData &set);
334 void attachDataStore(const RooAbsDataStore &set);
335
336 // I/O streaming interface (machine readable)
337 virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) = 0 ;
338 virtual void writeToStream(std::ostream& os, Bool_t compact) const = 0 ;
339
340 /// Print the object to the defaultPrintStream().
341 /// \param[in] options **V** print verbose. **T** print a tree structure with all children.
342 virtual void Print(Option_t *options= 0) const {
343 // Printing interface (human readable)
345 }
346
347 virtual void printName(std::ostream& os) const ;
348 virtual void printTitle(std::ostream& os) const ;
349 virtual void printClassName(std::ostream& os) const ;
350 virtual void printAddress(std::ostream& os) const ;
351 virtual void printArgs(std::ostream& os) const ;
352 virtual void printMetaArgs(std::ostream& /*os*/) const {} ;
353 virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
354 virtual void printTree(std::ostream& os, TString indent="") const ;
355
356 virtual Int_t defaultPrintContents(Option_t* opt) const ;
357
358 // Accessors to attributes
359 void setAttribute(const Text_t* name, Bool_t value=kTRUE) ;
360 Bool_t getAttribute(const Text_t* name) const ;
361 inline const std::set<std::string>& attributes() const {
362 // Returns set of names of boolean attributes defined
363 return _boolAttrib ;
364 }
365
366 void setStringAttribute(const Text_t* key, const Text_t* value) ;
367 const Text_t* getStringAttribute(const Text_t* key) const ;
368 inline const std::map<std::string,std::string>& stringAttributes() const {
369 // Returns std::map<string,string> with all string attributes defined
370 return _stringAttrib ;
371 }
372
373 // Accessors to transient attributes
374 void setTransientAttribute(const Text_t* name, Bool_t value=kTRUE) ;
376 inline const std::set<std::string>& transientAttributes() const {
377 // Return set of transient boolean attributes
378 return _boolAttribTransient ;
379 }
380
381 /// Check if the "Constant" attribute is set.
382 inline Bool_t isConstant() const {
383 return _isConstant ; //getAttribute("Constant") ;
384 }
386
387 // Sorting
388 Int_t Compare(const TObject* other) const ;
389 virtual Bool_t IsSortable() const {
390 // Object is sortable in ROOT container class
391 return kTRUE ;
392 }
393
394 virtual bool operator==(const RooAbsArg& other) const = 0 ;
395 virtual bool isIdentical(const RooAbsArg& other, Bool_t assumeSameType=kFALSE) const = 0 ;
396
397 // Range management
398 virtual Bool_t inRange(const char*) const {
399 // Is value in range (dummy interface always returns true)
400 return kTRUE ;
401 }
402 virtual Bool_t hasRange(const char*) const {
403 // Has this argument a defined range (dummy interface always returns flase)
404 return kFALSE ;
405 }
406
407
409 enum CacheMode { Always=0, NotAdvised=1, Never=2 } ;
410 enum OperMode { Auto=0, AClean=1, ADirty=2 } ;
411
412 ////////////////////////////////////////////////////////////////////////////
413 /// \anchor optimisationInterface
414 /// \name Optimisation interface
415 /// These functions allow RooFit to optimise a computation graph, to keep track
416 /// of cached values, and to invalidate caches.
417 /// @{
418
419 // Cache mode optimization (tracks changes & do lazy evaluation vs evaluate always)
420 virtual void optimizeCacheMode(const RooArgSet& observables) ;
421 virtual void optimizeCacheMode(const RooArgSet& observables, RooArgSet& optNodes, RooLinkedList& processedNodes) ;
422
423
424 // Find constant terms in expression
425 Bool_t findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList) ;
426 Bool_t findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList, RooLinkedList& processedNodes) ;
427
428
429 // constant term optimization
430 virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE) ;
431
432 virtual CacheMode canNodeBeCached() const { return Always ; }
433 virtual void setCacheAndTrackHints(RooArgSet& /*trackNodes*/ ) {} ;
434
435 // Dirty state accessor
436 inline Bool_t isShapeDirty() const {
437 // Return true is shape has been invalidated by server value change
438 return isDerived()?_shapeDirty:kFALSE ;
439 }
440
441 inline Bool_t isValueDirty() const {
442 // Returns true of value has been invalidated by server value change
443 if (inhibitDirty()) return kTRUE ;
444 switch(_operMode) {
445 case AClean:
446 return kFALSE ;
447 case ADirty:
448 return kTRUE ;
449 case Auto:
450 if (_valueDirty) return isDerived() ;
451 return kFALSE ;
452 }
453 return kTRUE ; // we should never get here
454 }
455
457 // Returns true of value has been invalidated by server value change
458 if (inhibitDirty()) return kTRUE ;
459 switch(_operMode) {
460 case AClean:
461 return kFALSE ;
462 case ADirty:
463 return kTRUE ;
464 case Auto:
465 if (_valueDirty) {
467 return isDerived();
468 }
469 return kFALSE ;
470 }
471 return kTRUE ; // But we should never get here
472 }
473
474
476 // Returns true of value has been invalidated by server value change
477
478 if (inhibitDirty()) return kTRUE ;
479 switch(_operMode) {
480 case AClean:
481 return kFALSE ;
482 case ADirty:
483 return kTRUE ;
484 case Auto:
485 if (_valueDirty || _shapeDirty) {
488 return isDerived();
489 }
492 return kFALSE ;
493 }
494 return kTRUE ; // But we should never get here
495 }
496
497 // Cache management
498 void registerCache(RooAbsCache& cache) ;
499 void unRegisterCache(RooAbsCache& cache) ;
500 Int_t numCaches() const ;
501 RooAbsCache* getCache(Int_t index) const ;
502
503 /// Query the operation mode of this node.
504 inline OperMode operMode() const { return _operMode ; }
505 /// Set the operation mode of this node.
506 void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE) ;
507
508 // Dirty state modifiers
509 /// Mark the element dirty. This forces a re-evaluation when a value is requested.
511 if (_operMode == Auto && !inhibitDirty())
512 setValueDirty(nullptr);
513 }
514 /// Notify that a shape-like property (*e.g.* binning) has changed.
515 void setShapeDirty() { setShapeDirty(nullptr); }
516
517 const char* aggregateCacheUniqueSuffix() const ;
518 virtual const char* cacheUniqueSuffix() const { return 0 ; }
519
520 void wireAllCaches() ;
521
524
525 /// Overwrite the current value stored in this object, making it look like this object computed that value.
526 /// \param[in] value Value to store.
527 /// \param[in] notifyClients Notify users of this object that they need to
528 /// recompute their values.
529 virtual void setCachedValue(double /*value*/, bool /*notifyClients*/ = true) {};
530
531 /// @}
532 ////////////////////////////////////////////////////////////////////////////
533
534 //Debug hooks
535 static void verboseDirty(Bool_t flag) ;
536 void printDirty(Bool_t depth=kTRUE) const ;
537 static void setDirtyInhibit(Bool_t flag) ;
538
539 void graphVizTree(const char* fileName, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
540 void graphVizTree(std::ostream& os, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
541
542 void printComponentTree(const char* indent="",const char* namePat=0, Int_t nLevel=999) ;
543 void printCompactTree(const char* indent="",const char* fileName=0, const char* namePat=0, RooAbsArg* client=0) ;
544 void printCompactTree(std::ostream& os, const char* indent="", const char* namePat=0, RooAbsArg* client=0) ;
545 virtual void printCompactTreeHook(std::ostream& os, const char *ind="") ;
546
547 Bool_t addOwnedComponents(const RooArgSet& comps) ;
548 const RooArgSet* ownedComponents() const { return _ownedComponents ; }
549
551
553
554 RooAbsProxy* getProxy(Int_t index) const ;
555 Int_t numProxies() const ;
556
557 /// De-duplicated pointer to this object's name.
558 /// This can be used for fast name comparisons.
559 /// like `if (namePtr() == other.namePtr())`.
560 /// \note TNamed::GetName() will return a pointer that's
561 /// different for each object, but namePtr() always points
562 /// to a unique instance.
563 inline const TNamed* namePtr() const {
564 return _namePtr ;
565 }
566
567 void SetName(const char* name) ;
568 void SetNameTitle(const char *name, const char *title) ;
569
571 {
572 _myws = &ws;
573 return kFALSE;
574 };
575
576 virtual bool canComputeBatchWithCuda() const { return false; }
577 virtual bool isReducerNode() const { return false; }
578
580
581protected:
582 void graphVizAddConnections(std::set<std::pair<RooAbsArg*,RooAbsArg*> >&) ;
583
584 virtual void operModeHook() {} ;
585
586 virtual void optimizeDirtyHook(const RooArgSet* /*obs*/) {} ;
587
588 virtual Bool_t isValid() const ;
589
590 virtual void getParametersHook(const RooArgSet* /*nset*/, RooArgSet* /*list*/, Bool_t /*stripDisconnected*/) const {} ;
591 virtual void getObservablesHook(const RooArgSet* /*nset*/, RooArgSet* /*list*/) const {} ;
592
596 }
597
598 void clearValueDirty() const {
600 }
601 void clearShapeDirty() const {
603 }
604
605 /// Force element to re-evaluate itself when a value is requested.
606 void setValueDirty(const RooAbsArg* source);
607 /// Notify that a shape-like property (*e.g.* binning) has changed.
608 void setShapeDirty(const RooAbsArg* source);
609
610 virtual void ioStreamerPass2() ;
611 static void ioStreamerPass2Finalize() ;
612
613
614private:
615 void addParameters(RooAbsCollection& params, const RooArgSet* nset = nullptr, bool stripDisconnected = true) const;
616 std::size_t getParametersSizeEstimate(const RooArgSet* nset = nullptr) const;
617
619
620
621 protected:
622
623 // Client-Server relation and Proxy management
624 friend class RooArgSet ;
625 friend class RooAbsCollection ;
626 friend class RooCustomizer ;
627 friend class RooWorkspace ;
628 friend class RooExtendPdf ;
629 friend class RooRealIntegral ;
630 friend class RooAbsReal ;
631 friend class RooProjectedPdf ;
632 RefCountList_t _serverList ; // list of server objects
633 RefCountList_t _clientList; // list of client objects
634 RefCountList_t _clientListShape; // subset of clients that requested shape dirty flag propagation
635 RefCountList_t _clientListValue; // subset of clients that requested value dirty flag propagation
636
637 RooRefArray _proxyList ; // list of proxies
638
639 std::vector<RooAbsCache*> _cacheList ; //! list of caches
640
641
642 // Proxy management
643 friend class RooAddModel ;
644 friend class RooArgProxy ;
645 friend class RooSetProxy ;
646 friend class RooListProxy ;
647 friend class RooObjectFactory ;
648 friend class RooHistPdf ;
649 friend class RooHistFunc ;
650 void registerProxy(RooArgProxy& proxy) ;
651 void registerProxy(RooSetProxy& proxy) ;
652 void registerProxy(RooListProxy& proxy) ;
653 void unRegisterProxy(RooArgProxy& proxy) ;
654 void unRegisterProxy(RooSetProxy& proxy) ;
655 void unRegisterProxy(RooListProxy& proxy) ;
656 void setProxyNormSet(const RooArgSet* nset) ;
657
658 // Attribute list
659 std::set<std::string> _boolAttrib ; // Boolean attributes
660 std::map<std::string,std::string> _stringAttrib ; // String attributes
661 std::set<std::string> _boolAttribTransient ; //! Transient boolean attributes (not copied in ctor)
662
663 void printAttribList(std::ostream& os) const;
664
665 // Hooks for RooTreeData interface
667 friend class RooTreeDataStore ;
668 friend class RooVectorDataStore ;
669 friend class RooDataSet ;
670 friend class RooRealMPFE ;
671 virtual void syncCache(const RooArgSet* nset=0) = 0 ;
672 virtual void copyCache(const RooAbsArg* source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE) = 0 ;
673
674 virtual void attachToTree(TTree& t, Int_t bufSize=32000) = 0 ;
675 virtual void attachToVStore(RooVectorDataStore& vstore) = 0 ;
676 /// Attach this argument to the data store such that it reads data from there.
677 void attachToStore(RooAbsDataStore& store) ;
678
679 virtual void setTreeBranchStatus(TTree& t, Bool_t active) = 0 ;
680 virtual void fillTreeBranch(TTree& t) = 0 ;
681 TString cleanBranchName() const ;
682
683 // Global
684 friend std::ostream& operator<<(std::ostream& os, const RooAbsArg &arg);
685 friend std::istream& operator>>(std::istream& is, RooAbsArg &arg) ;
687
689 std::vector<RooAbsProxy*> cache;
690 bool isDirty = true;
691 };
692 ProxyListCache _proxyListCache; //! cache of the list of proxies. Avoids type casting.
693
694 // Debug stuff
695 static Bool_t _verboseDirty ; // Static flag controlling verbose messaging for dirty state changes
696 static Bool_t _inhibitDirty ; // Static flag controlling global inhibit of dirty state propagation
697 Bool_t _deleteWatch ; //! Delete watch flag
698
699 Bool_t inhibitDirty() const ;
700
701 public:
704 protected:
705
706
707 mutable Bool_t _valueDirty ; // Flag set if value needs recalculating because input values modified
708 mutable Bool_t _shapeDirty ; // Flag set if value needs recalculating because input shapes modified
709 mutable bool _allBatchesDirty{true}; //! Mark batches as dirty (only meaningful for RooAbsReal).
710
711 mutable OperMode _operMode ; // Dirty state propagation mode
712 mutable Bool_t _fast ; // Allow fast access mode in getVal() and proxies
713
714 // Owned components
715 RooArgSet* _ownedComponents ; //! Set of owned component
716
717 mutable Bool_t _prohibitServerRedirect ; //! Prohibit server redirects -- Debugging tool
718
719 mutable RooExpensiveObjectCache* _eocache{nullptr}; // Pointer to global cache manager for any expensive components created by this object
720
721 mutable TNamed* _namePtr ; //! De-duplicated name pointer. This will be equal for all objects with the same name.
722 Bool_t _isConstant ; //! Cached isConstant status
723
724 mutable Bool_t _localNoInhibitDirty ; //! Prevent 'AlwaysDirty' mode for this node
725
726/* RooArgSet _leafNodeCache ; //! Cached leaf nodes */
727/* RooArgSet _branchNodeCache //! Cached branch nodes */
728
729 mutable RooWorkspace *_myws; //! In which workspace do I live, if any
730
731 /// \cond Internal
732 // Legacy streamers need the following statics:
733 friend class RooFitResult;
734
735 public:
736 static std::map<RooAbsArg*,std::unique_ptr<TRefArray>> _ioEvoList; // temporary holding list for proxies needed in schema evolution
737 protected:
738 static std::stack<RooAbsArg*> _ioReadStack ; // reading stack
739 /// \endcond
740
741 ClassDef(RooAbsArg,8) // Abstract variable
742};
743
744std::ostream& operator<<(std::ostream& os, const RooAbsArg &arg);
745std::istream& operator>>(std::istream& is, RooAbsArg &arg);
746
747
748#endif
#define R__SUGGEST_ALTERNATIVE(ALTERNATIVE)
Definition: RConfig.hxx:521
std::ostream & operator<<(std::ostream &os, const RooAbsArg &arg)
Ostream operator.
Definition: RooAbsArg.cxx:1577
std::istream & operator>>(std::istream &is, RooAbsArg &arg)
Istream operator.
Definition: RooAbsArg.cxx:1586
char Text_t
Definition: RtypesCore.h:62
const Bool_t kFALSE
Definition: RtypesCore.h:101
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition: TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:74
RooExpensiveObjectCache & expensiveObjectCache() const
Definition: RooAbsArg.cxx:2337
virtual Bool_t IsSortable() const
Definition: RooAbsArg.h:389
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Definition: RooAbsArg.cxx:806
virtual RooAbsArg * cloneTree(const char *newname=0) const
Clone tree expression of objects.
Definition: RooAbsArg.cxx:2290
RooRefArray _proxyList
Definition: RooAbsArg.h:637
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Given a set of possible observables, return the observables that this PDF depends on.
Definition: RooAbsArg.h:314
virtual bool isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE) const =0
Bool_t _fast
Definition: RooAbsArg.h:712
void clearValueAndShapeDirty() const
Definition: RooAbsArg.h:593
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)=0
virtual Bool_t isValid() const
WVE (08/21/01) Probably obsolete now.
Definition: RooAbsArg.cxx:1422
TNamed * _namePtr
Definition: RooAbsArg.h:721
virtual Bool_t importWorkspaceHook(RooWorkspace &ws)
Definition: RooAbsArg.h:570
static void verboseDirty(Bool_t flag)
Activate verbose messaging related to dirty flag propagation.
Definition: RooAbsArg.cxx:273
void attachToStore(RooAbsDataStore &store)
Attach this argument to the data store such that it reads data from there.
Definition: RooAbsArg.cxx:2324
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default contents to print.
Definition: RooAbsArg.cxx:1493
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
Definition: RooAbsArg.h:563
const char * aggregateCacheUniqueSuffix() const
Definition: RooAbsArg.cxx:2349
Bool_t redirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE)
Replace all direct servers of this object with the new servers in newServerList.
Definition: RooAbsArg.cxx:1037
virtual Bool_t isLValue() const
Is this argument an l-value, i.e., can it appear on the left-hand side of an assignment expression?...
Definition: RooAbsArg.h:256
void changeServer(RooAbsArg &server, Bool_t valueProp, Bool_t shapeProp)
Change dirty flag propagation mask for specified server.
Definition: RooAbsArg.cxx:475
Bool_t isValueServer(const RooAbsArg &arg) const
Check if this is serving values to arg.
Definition: RooAbsArg.h:218
virtual void getObservablesHook(const RooArgSet *, RooArgSet *) const
Definition: RooAbsArg.h:591
ProxyListCache _proxyListCache
Definition: RooAbsArg.h:692
RooWorkspace * _myws
Prevent 'AlwaysDirty' mode for this node.
Definition: RooAbsArg.h:729
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:1904
void attachDataStore(const RooAbsDataStore &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Definition: RooAbsArg.cxx:1641
virtual bool operator==(const RooAbsArg &other) const =0
virtual void printClassName(std::ostream &os) const
Print object class name.
Definition: RooAbsArg.cxx:1453
RooArgSet * _ownedComponents
Definition: RooAbsArg.h:715
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition: RooAbsArg.h:515
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:841
virtual void setCachedValue(double, bool=true)
Overwrite the current value stored in this object, making it look like this object computed that valu...
Definition: RooAbsArg.h:529
void registerProxy(RooArgProxy &proxy)
Register an RooArgProxy in the proxy list.
Definition: RooAbsArg.cxx:1247
Bool_t checkDependents(const RooArgSet *nset) const
Definition: RooAbsArg.h:173
friend std::ostream & operator<<(std::ostream &os, const RooAbsArg &arg)
Ostream operator.
Definition: RooAbsArg.cxx:1577
RooFIter valueClientMIterator() const
Definition: RooAbsArg.h:148
void attachArgs(const RooAbsCollection &set)
Bind this node to objects in set.
Definition: RooAbsArg.cxx:1616
Bool_t isShapeServer(const RooAbsArg &arg) const
Check if this is serving shape to arg.
Definition: RooAbsArg.h:226
RooArgSet * getDependents(const RooArgSet &set) const
Definition: RooAbsArg.h:163
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
Definition: RooAbsArg.cxx:323
friend class RooObjectFactory
Definition: RooAbsArg.h:647
static void ioStreamerPass2Finalize()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2467
RooArgSet * getDependents(const RooAbsData *set) const
Definition: RooAbsArg.h:165
virtual CacheMode canNodeBeCached() const
Definition: RooAbsArg.h:432
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node.
Definition: RooAbsArg.cxx:509
virtual void setTreeBranchStatus(TTree &t, Bool_t active)=0
void setProhibitServerRedirect(Bool_t flag)
Definition: RooAbsArg.h:550
void setWorkspace(RooWorkspace &ws)
Definition: RooAbsArg.h:552
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multi-line detailed printing.
Definition: RooAbsArg.cxx:1503
friend class RooAddPdfOrig
Definition: RooAbsArg.h:300
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Definition: RooAbsArg.h:86
void addParameters(RooAbsCollection &params, const RooArgSet *nset=nullptr, bool stripDisconnected=true) const
Add all parameters of the function and its daughters to params.
Definition: RooAbsArg.cxx:590
const RooArgSet * ownedComponents() const
Definition: RooAbsArg.h:548
Bool_t isCloneOf(const RooAbsArg &other) const
Check if this object was created as a clone of 'other'.
Definition: RooAbsArg.cxx:281
Bool_t isShapeDirty() const
Definition: RooAbsArg.h:436
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
static void setDirtyInhibit(Bool_t flag)
Control global dirty inhibit mode.
Definition: RooAbsArg.cxx:264
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:1771
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:2186
void unRegisterProxy(RooArgProxy &proxy)
Remove proxy from proxy list.
Definition: RooAbsArg.cxx:1276
virtual bool canComputeBatchWithCuda() const
Definition: RooAbsArg.h:576
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:1964
const RefCountList_t & shapeClients() const
List of all shape clients of this object.
Definition: RooAbsArg.h:196
Bool_t inhibitDirty() const
Delete watch flag.
Definition: RooAbsArg.cxx:116
RooSTLRefCountList< RooAbsArg > RefCountList_t
Definition: RooAbsArg.h:76
const RefCountList_t & valueClients() const
List of all value clients of this object. Value clients receive value updates.
Definition: RooAbsArg.h:191
friend std::istream & operator>>(std::istream &is, RooAbsArg &arg)
Istream operator.
Definition: RooAbsArg.cxx:1586
RooArgSet * getObservables(const RooAbsData &data) const
Return the observables of this pdf given the observables defined by data.
Definition: RooAbsArg.h:319
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
Definition: RooAbsArg.h:523
std::set< std::string > _boolAttrib
Definition: RooAbsArg.h:659
void addServer(RooAbsArg &server, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE, std::size_t refCount=1)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
Definition: RooAbsArg.cxx:388
virtual void printTree(std::ostream &os, TString indent="") const
Print object tree structure.
Definition: RooAbsArg.cxx:1568
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
Definition: RooAbsArg.cxx:2040
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:244
virtual void printTitle(std::ostream &os) const
Print object title.
Definition: RooAbsArg.cxx:1443
Bool_t isValueOrShapeDirtyAndClear() const
Definition: RooAbsArg.h:475
RefCountList_t _clientListValue
Definition: RooAbsArg.h:635
void printAttribList(std::ostream &os) const
Transient boolean attributes (not copied in ctor)
Definition: RooAbsArg.cxx:1595
Bool_t dependentOverlaps(const RooAbsData *dset, const RooAbsArg &testArg) const
Definition: RooAbsArg.h:169
virtual void Print(Option_t *options=0) const
Print the object to the defaultPrintStream().
Definition: RooAbsArg.h:342
friend void RooRefArray::Streamer(TBuffer &)
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
Definition: RooAbsArg.cxx:336
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t doBranch=kTRUE, Bool_t doLeaf=kTRUE, Bool_t valueOnly=kFALSE, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
Definition: RooAbsArg.cxx:536
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:291
virtual void writeToStream(std::ostream &os, Bool_t compact) const =0
RooArgSet * getParameters(const RooArgSet &observables, bool stripDisconnected=true) const
Return the parameters of the p.d.f given the provided set of observables.
Definition: RooAbsArg.h:308
Bool_t hasClients() const
Definition: RooAbsArg.h:118
virtual void printAddress(std::ostream &os) const
Print class name of object.
Definition: RooAbsArg.cxx:1459
RooArgSet * getParameters(const RooAbsData &data, bool stripDisconnected=true) const
Return the parameters of this p.d.f when used in conjuction with dataset 'data'.
Definition: RooAbsArg.h:304
RooFIter serverMIterator() const
Definition: RooAbsArg.h:156
void setTransientAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:350
virtual void serverNameChangeHook(const RooAbsArg *, const RooAbsArg *)
Definition: RooAbsArg.h:283
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:2018
virtual void setCacheAndTrackHints(RooArgSet &)
Definition: RooAbsArg.h:433
const std::set< std::string > & attributes() const
Definition: RooAbsArg.h:361
Bool_t _isConstant
De-duplicated name pointer. This will be equal for all objects with the same name.
Definition: RooAbsArg.h:722
Bool_t isValueDirty() const
Definition: RooAbsArg.h:441
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:896
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:1651
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:2068
void clearValueDirty() const
Definition: RooAbsArg.h:598
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2439
void wireAllCaches()
Definition: RooAbsArg.cxx:2367
Bool_t _valueDirty
Definition: RooAbsArg.h:707
virtual ~RooAbsArg()
Destructor.
Definition: RooAbsArg.cxx:222
virtual Bool_t isDerived() const
Does value or shape of this arg depend on any other arg?
Definition: RooAbsArg.h:94
static Bool_t _inhibitDirty
Definition: RooAbsArg.h:696
virtual const char * cacheUniqueSuffix() const
Definition: RooAbsArg.h:518
RefCountListLegacyIterator_t * makeLegacyIterator(const RefCountList_t &list) const
Definition: RooAbsArg.cxx:2485
@ NotAdvised
Definition: RooAbsArg.h:409
const RefCountList_t & servers() const
List of all servers of this object.
Definition: RooAbsArg.h:201
TIterator * valueClientIterator() const
Definition: RooAbsArg.h:132
Bool_t _localNoInhibitDirty
Cached isConstant status.
Definition: RooAbsArg.h:724
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE)
Interface function signaling a request to perform constant term optimization.
Definition: RooAbsArg.cxx:1864
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Set the operation mode of this node.
Definition: RooAbsArg.cxx:1877
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:1411
OperMode _operMode
Mark batches as dirty (only meaningful for RooAbsReal).
Definition: RooAbsArg.h:711
virtual bool isReducerNode() const
Definition: RooAbsArg.h:577
RooLinkedList getCloningAncestors() const
Return ancestors in cloning chain of this RooAbsArg.
Definition: RooAbsArg.cxx:2078
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition: RooAbsArg.h:510
RooAbsArg * findServer(const RooAbsArg &arg) const
Return server of this that has the same name as arg. Returns nullptr if not found.
Definition: RooAbsArg.h:210
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
Definition: RooAbsArg.cxx:2276
Bool_t recursiveCheckObservables(const RooArgSet *nset) const
Recursively call checkObservables on all nodes in the expression tree.
Definition: RooAbsArg.cxx:815
const std::map< std::string, std::string > & stringAttributes() const
Definition: RooAbsArg.h:368
RooAbsCache * getCache(Int_t index) const
Return registered cache object by index.
Definition: RooAbsArg.cxx:2059
virtual void syncCache(const RooArgSet *nset=0)=0
void printDirty(Bool_t depth=kTRUE) const
Print information about current value dirty state information.
Definition: RooAbsArg.cxx:1663
bool _allBatchesDirty
Definition: RooAbsArg.h:709
static Bool_t _verboseDirty
cache of the list of proxies. Avoids type casting.
Definition: RooAbsArg.h:695
void registerCache(RooAbsCache &cache)
Register RooAbsCache with this object.
Definition: RooAbsArg.cxx:2031
virtual void optimizeCacheMode(const RooArgSet &observables)
Activate cache mode optimization with given definition of observables.
Definition: RooAbsArg.cxx:1695
RefCountList_t _clientListShape
Definition: RooAbsArg.h:634
virtual void attachToVStore(RooVectorDataStore &vstore)=0
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:1989
void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: RooAbsArg.cxx:2399
Bool_t recursiveCheckDependents(const RooArgSet *nset) const
Definition: RooAbsArg.h:175
Bool_t _prohibitServerRedirect
Set of owned component.
Definition: RooAbsArg.h:717
RooAbsArg * findServer(Int_t index) const
Return i-th server from server list.
Definition: RooAbsArg.h:214
void removeServer(RooAbsArg &server, Bool_t force=kFALSE)
Unregister another RooAbsArg as a server to us, ie, declare that we no longer depend on its value and...
Definition: RooAbsArg.cxx:439
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1375
@ DeActivate
Definition: RooAbsArg.h:408
@ ValueChange
Definition: RooAbsArg.h:408
@ ConfigChange
Definition: RooAbsArg.h:408
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:314
virtual void printName(std::ostream &os) const
Print object name.
Definition: RooAbsArg.cxx:1433
void replaceServer(RooAbsArg &oldServer, RooAbsArg &newServer, Bool_t valueProp, Bool_t shapeProp)
Replace 'oldServer' with 'newServer'.
Definition: RooAbsArg.cxx:464
const std::set< std::string > & transientAttributes() const
Definition: RooAbsArg.h:376
const RefCountList_t & clients() const
List of all clients of this object.
Definition: RooAbsArg.h:187
RooArgSet * getDependents(const RooArgSet *depList) const
Definition: RooAbsArg.h:167
virtual void getParametersHook(const RooArgSet *, RooArgSet *, Bool_t) const
Definition: RooAbsArg.h:590
virtual void printMetaArgs(std::ostream &) const
Definition: RooAbsArg.h:352
Bool_t isShapeServer(const char *name) const
Check if this is serving shape to an object with name name.
Definition: RooAbsArg.h:230
void addServerList(RooAbsCollection &serverList, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE)
Register a list of RooAbsArg as servers to us by calling addServer() for each arg in the list.
Definition: RooAbsArg.cxx:424
Bool_t dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0) const
Check whether this object depends on values from an element in the serverList.
Definition: RooAbsArg.h:104
TIterator * shapeClientIterator() const
Definition: RooAbsArg.h:137
void setProxyNormSet(const RooArgSet *nset)
Forward a change in the cached normalization argset to all the registered proxies.
Definition: RooAbsArg.cxx:1386
RefCountList_t _clientList
Definition: RooAbsArg.h:633
Bool_t dependsOnValue(const RooAbsArg &server, const RooAbsArg *ignoreArg=0) const
Check whether this object depends on values served from the object passed as server.
Definition: RooAbsArg.h:112
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1362
RooFIter shapeClientMIterator() const
Definition: RooAbsArg.h:152
RooAbsArg & operator=(const RooAbsArg &other)
Assign all boolean and string properties of the original object.
Definition: RooAbsArg.cxx:190
virtual bool redirectServersHook(const RooAbsCollection &, bool, bool, bool)
Function that is called at the end of redirectServers().
Definition: RooAbsArg.h:276
Bool_t isValueDirtyAndClear() const
Definition: RooAbsArg.h:456
Bool_t dependentOverlaps(const RooArgSet *depList, const RooAbsArg &testArg) const
Definition: RooAbsArg.h:171
RefCountList_t _serverList
Definition: RooAbsArg.h:632
void clearShapeDirty() const
Definition: RooAbsArg.h:601
virtual RooAbsArg * createFundamental(const char *newname=0) const =0
Create a fundamental-type object that stores our type of value.
RooExpensiveObjectCache * _eocache
Prohibit server redirects – Debugging tool.
Definition: RooAbsArg.h:719
RooArgSet * getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
Definition: RooAbsArg.cxx:788
std::set< std::string > _boolAttribTransient
Definition: RooAbsArg.h:661
Bool_t _shapeDirty
Definition: RooAbsArg.h:708
void setLocalNoDirtyInhibit(Bool_t flag) const
Definition: RooAbsArg.h:702
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Definition: RooAbsArg.cxx:578
RooAbsArg * findNewServer(const RooAbsCollection &newSet, Bool_t nameChange) const
Find the new server in the specified set that matches the old server.
Definition: RooAbsArg.cxx:1156
Bool_t isConstant() const
Check if the "Constant" attribute is set.
Definition: RooAbsArg.h:382
virtual void fillTreeBranch(TTree &t)=0
void branchNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all branch nodes of the arg tree starting with ourself as top node.
Definition: RooAbsArg.cxx:520
std::size_t getParametersSizeEstimate(const RooArgSet *nset=nullptr) const
Obtain an estimate of the number of parameters of the function and its daughters.
Definition: RooAbsArg.cxx:629
void graphVizTree(const char *fileName, const char *delimiter="\n", bool useTitle=false, bool useLatex=false)
Create a GraphViz .dot file visualizing the expression tree headed by this RooAbsArg object.
Definition: RooAbsArg.cxx:2107
virtual void operModeHook()
Definition: RooAbsArg.h:584
TIterator * clientIterator() const
Retrieve a client iterator.
Definition: RooAbsArg.h:127
virtual void optimizeDirtyHook(const RooArgSet *)
Definition: RooAbsArg.h:586
Bool_t getTransientAttribute(const Text_t *name) const
Check if a named attribute is set.
Definition: RooAbsArg.cxx:372
TIterator * serverIterator() const
Definition: RooAbsArg.h:142
std::map< std::string, std::string > _stringAttrib
Definition: RooAbsArg.h:660
virtual Bool_t inRange(const char *) const
Definition: RooAbsArg.h:398
Int_t numCaches() const
Return number of registered caches.
Definition: RooAbsArg.cxx:2050
RooAbsArg()
Default constructor.
Definition: RooAbsArg.cxx:125
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
Recursively replace all servers with the new servers in newSet.
Definition: RooAbsArg.cxx:1201
Bool_t isValueServer(const char *name) const
Check if this is serving values to an object with name name.
Definition: RooAbsArg.h:222
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Definition: RooAbsArg.cxx:1631
virtual Bool_t hasRange(const char *) const
Definition: RooAbsArg.h:402
virtual TObject * clone(const char *newname=0) const =0
virtual void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
Definition: RooAbsArg.cxx:1470
TIteratorToSTLInterface< RefCountList_t::Container_t > RefCountListLegacyIterator_t
Definition: RooAbsArg.h:77
RooAbsArg * findServer(const char *name) const
Return server of this with name name. Returns nullptr if not found.
Definition: RooAbsArg.h:205
void SetName(const char *name)
Set the name of the TNamed.
Definition: RooAbsArg.cxx:2382
Bool_t localNoDirtyInhibit() const
Definition: RooAbsArg.h:703
Bool_t _deleteWatch
Definition: RooAbsArg.h:697
std::vector< RooAbsCache * > _cacheList
Definition: RooAbsArg.h:639
OperMode operMode() const
Query the operation mode of this node.
Definition: RooAbsArg.h:504
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:910
RooAbsCache is the abstract base class for data members of RooAbsArgs that cache other (composite) Ro...
Definition: RooAbsCache.h:27
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:80
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:30
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:63
RooAddModel is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddModel.h:26
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddPdf.h:32
RooArgProxy is the abstract interface for RooAbsArg proxy classes.
Definition: RooArgProxy.h:24
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:35
To use as a key type for RooBatchCompute data maps and containers.
Definition: DataKey.h:29
static constexpr DataKey create(TObject const *obj)
If a class T implements a casting operator to DataKey, it needs a way to actually construct the DataK...
Definition: DataKey.h:40
RooCompositeDataStore combines several disjunct datasets into one.
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
Definition: RooCustomizer.h:35
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:36
RooExpensiveObjectCache is a singleton class that serves as repository for objects that are expensive...
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
Definition: RooExtendPdf.h:22
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Definition: RooFitResult.h:40
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
Definition: RooHistFunc.h:30
RooHistPdf implements a probablity density function sampled from a multidimensional histogram.
Definition: RooHistPdf.h:29
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:38
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
virtual StyleOption defaultPrintStyle(Option_t *opt) const
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
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,...
RooProdPdf is an efficient implementation of a product of PDFs of the form.
Definition: RooProdPdf.h:33
Class RooProjectedPdf is a RooAbsPdf implementation that represent a projection of a given input p....
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
RooRealMPFE is the multi-processor front-end for parallel calculation of RooAbsReal objects.
Definition: RooRealMPFE.h:30
RooRefArray & operator=(const RooRefArray &other)=default
RooRefArray(const RooRefArray &other)
Definition: RooAbsArg.h:60
virtual ~RooRefArray()
Definition: RooAbsArg.h:63
bool containsSameName(const char *name) const
Check if list contains an item using findByName().
T * findByNamePointer(const T *item) const
Find an item by comparing RooAbsArg::namePtr() adresses.
const Container_t & containedObjects() const
Direct reference to container of objects held by this list.
Container_t::const_iterator end() const
End of contained objects.
bool empty() const
Check if empty.
Container_t::const_iterator findByName(const char *name) const
Find an item by comparing strings returned by RooAbsArg::GetName()
bool containsByNamePtr(const T *obj) const
Check if list contains an item using findByNamePointer().
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
RooTreeDataStore is a TTree-backed data storage.
RooVectorDataStore uses std::vectors to store data columns.
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
Buffer base class used for serializing objects.
Definition: TBuffer.h:43
TIterator and GenericRooFIter front end with STL back end.
Iterator abstract base class.
Definition: TIterator.h:30
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
An array of TObjects.
Definition: TObjArray.h:37
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136
A TTree represents a columnar dataset.
Definition: TTree.h:79
std::vector< RooAbsProxy * > cache
Definition: RooAbsArg.h:689
void ws()
Definition: ws.C:66