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"
27#include <RooStringView.h>
28
29#include <deque>
30#include <iostream>
31#include <map>
32#include <memory>
33#include <set>
34#include <stack>
35#include <string>
36
37
38class TTree ;
39class RooArgSet ;
40class RooAbsCollection ;
42class RooAbsData ;
43class RooAbsDataStore ;
44class RooAbsProxy ;
45class RooArgProxy ;
46template<class RooCollection_t>
51class RooWorkspace ;
52
53class RooRefArray : public TObjArray {
54 public:
56 } ;
57 RooRefArray(const RooRefArray& other) : TObjArray(other) {
58 }
59 RooRefArray& operator=(const RooRefArray& other) = default;
60 ~RooRefArray() override {} ;
61 protected:
62 ClassDefOverride(RooRefArray,1) // Helper class for proxy lists
63} ;
64
65class RooAbsArg;
66/// Print at the prompt
67namespace cling {
68std::string printValue(RooAbsArg*);
69}
70
71class RooAbsArg : public TNamed, public RooPrintable {
72public:
75
76 // Constructors, cloning and assignment
77 RooAbsArg() ;
78 ~RooAbsArg() override;
79 RooAbsArg(const char *name, const char *title);
80 RooAbsArg(const RooAbsArg& other, const char* name=nullptr) ;
81 RooAbsArg& operator=(const RooAbsArg& other) = delete;
82 virtual TObject* clone(const char* newname=nullptr) const = 0 ;
83 TObject* Clone(const char* newname = nullptr) const override {
84 return clone(newname && newname[0] != '\0' ? newname : nullptr);
85 }
86 virtual RooAbsArg* cloneTree(const char* newname=nullptr) const ;
87
88 // Accessors to client-server relation information
89
90 /// Does value or shape of this arg depend on any other arg?
91 virtual bool isDerived() const {
92 return true ;
93 }
94 bool isCloneOf(const RooAbsArg& other) const ;
95
96 /// Check whether this object depends on values from an element in the `serverList`.
97 ///
98 /// @param serverList Test if one of the elements in this list serves values to `this`.
99 /// @param ignoreArg Ignore values served by this object.
100 /// @return True if values are served.
101 bool dependsOnValue(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg=nullptr) const {
102 return dependsOn(serverList,ignoreArg,true) ;
103 }
104 /// Check whether this object depends on values served from the object passed as `server`.
105 ///
106 /// @param server Test if `server` serves values to `this`.
107 /// @param ignoreArg Ignore values served by this object.
108 /// @return True if values are served.
109 bool dependsOnValue(const RooAbsArg& server, const RooAbsArg* ignoreArg=nullptr) const {
110 return dependsOn(server,ignoreArg,true) ;
111 }
112 bool dependsOn(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg=nullptr, bool valueOnly=false) const ;
113 bool dependsOn(const RooAbsArg& server, const RooAbsArg* ignoreArg=nullptr, bool valueOnly=false) const ;
114 bool overlaps(const RooAbsArg& testArg, bool valueOnly=false) const ;
115 bool hasClients() const { return !_clientList.empty(); }
116
117 ////////////////////////////////////////////////////////////////////////////
118 /// \name Legacy RooFit interface.
119 /// This is a collection of functions that remain supported, but more elegant
120 /// interfaces are usually available.
121 /// @{
122
123 /// Retrieve a client iterator.
124 inline TIterator* clientIterator() const
125 R__SUGGEST_ALTERNATIVE("Use clients() and begin(), end() or range-based loops.") {
126 // Return iterator over all client RooAbsArgs
128 }
130 R__SUGGEST_ALTERNATIVE("Use valueClients() and begin(), end() or range-based loops.") {
131 // Return iterator over all shape client RooAbsArgs
133 }
135 R__SUGGEST_ALTERNATIVE("Use shapeClients() and begin(), end() or range-based loops.") {
136 // Return iterator over all shape client RooAbsArgs
138 }
139 inline TIterator* serverIterator() const
140 R__SUGGEST_ALTERNATIVE("Use servers() and begin(), end() or range-based loops.") {
141 // Return iterator over all server RooAbsArgs
143 }
144
146 R__SUGGEST_ALTERNATIVE("Use valueClients() and begin(), end() or range-based loops.") {
147 return RooFIter(std::unique_ptr<RefCountListLegacyIterator_t>(makeLegacyIterator(_clientListValue)));
148 }
150 R__SUGGEST_ALTERNATIVE("Use shapeClients() and begin(), end() or range-based loops.") {
151 return RooFIter(std::unique_ptr<RefCountListLegacyIterator_t>(makeLegacyIterator(_clientListShape)));
152 }
154 R__SUGGEST_ALTERNATIVE("Use servers() and begin(), end() or range-based loops.") {
155 return RooFIter(std::unique_ptr<RefCountListLegacyIterator_t>(makeLegacyIterator(_serverList)));
156 }
157
158 // --- Obsolete functions for backward compatibility
159 /// \deprecated Use getObservables()
160 inline RooArgSet* getDependents(const RooArgSet& set) const { return getObservables(set) ; }
161 /// \deprecated Use getObservables()
162 inline RooArgSet* getDependents(const RooAbsData* set) const { return getObservables(set) ; }
163 /// \deprecated Use getObservables()
164 inline RooArgSet* getDependents(const RooArgSet* depList) const { return getObservables(depList) ; }
165 /// \deprecated Use observableOverlaps()
166 inline bool dependentOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const { return observableOverlaps(dset,testArg) ; }
167 /// \deprecated Use observableOverlaps()
168 inline bool dependentOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const { return observableOverlaps(depList, testArg) ; }
169 /// \deprecated Use checkObservables()
170 inline bool checkDependents(const RooArgSet* nset) const { return checkObservables(nset) ; }
171 /// \deprecated Use recursiveCheckObservables()
172 inline bool recursiveCheckDependents(const RooArgSet* nset) const { return recursiveCheckObservables(nset) ; }
173 // --- End obsolete functions for backward compatibility
174 /// @}
175 ////////////////////////////////////////////////////////////////////////////
176
177 ////////////////////////////////////////////////////////////////////////////
178 /// \anchor clientServerInterface
179 /// \name Client-Server Interface
180 /// These functions allow RooFit to figure out who is serving values to whom.
181 /// @{
182
183 /// List of all clients of this object.
184 const RefCountList_t& clients() const {
185 return _clientList;
186 }
187 /// List of all value clients of this object. Value clients receive value updates.
189 return _clientListValue;
190 }
191 /// List of all shape clients of this object. Shape clients receive property information such as
192 /// changes of a value range.
194 return _clientListShape;
195 }
196
197 /// List of all servers of this object.
198 const RefCountList_t& servers() const {
199 return _serverList;
200 }
201 /// Return server of `this` with name `name`. Returns nullptr if not found.
202 inline RooAbsArg* findServer(const char *name) const {
203 const auto serverIt = _serverList.findByName(name);
204 return serverIt != _serverList.end() ? *serverIt : nullptr;
205 }
206 /// Return server of `this` that has the same name as `arg`. Returns `nullptr` if not found.
207 inline RooAbsArg* findServer(const RooAbsArg& arg) const {
208 return _serverList.findByNamePointer(&arg);
209 }
210 /// Return i-th server from server list.
213 }
214 /// Check if `this` is serving values to `arg`.
215 inline bool isValueServer(const RooAbsArg& arg) const {
217 }
218 /// Check if `this` is serving values to an object with name `name`.
219 inline bool isValueServer(const char* name) const {
221 }
222 /// Check if `this` is serving shape to `arg`.
223 inline bool isShapeServer(const RooAbsArg& arg) const {
225 }
226 /// Check if `this` is serving shape to an object with name `name`.
227 inline bool isShapeServer(const char* name) const {
229 }
230 void leafNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=nullptr, bool recurseNonDerived=false) const ;
231 void branchNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=nullptr, bool recurseNonDerived=false) const ;
232 void treeNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=nullptr,
233 bool doBranch=true, bool doLeaf=true,
234 bool valueOnly=false, bool recurseNonDerived=false) const ;
235
236
237 /// Is this object a fundamental type that can be added to a dataset?
238 /// Fundamental-type subclasses override this method to return true.
239 /// Note that this test is subtlely different from the dynamic isDerived()
240 /// test, e.g. a constant is not derived but is also not fundamental.
241 inline virtual bool isFundamental() const {
242 return false;
243 }
244
245 /// Create a fundamental-type object that stores our type of value. The
246 /// created object will have a valid value, but not necessarily the same
247 /// as our value. The caller is responsible for deleting the returned object.
248 virtual RooAbsArg *createFundamental(const char* newname=nullptr) const = 0;
249
250 /// Is this argument an l-value, i.e., can it appear on the left-hand side
251 /// of an assignment expression? LValues are also special since they can
252 /// potentially be analytically integrated and generated.
253 inline virtual bool isLValue() const {
254 return false;
255 }
256
257
258 // Server redirection interface
259 bool redirectServers(const RooAbsCollection& newServerList, bool mustReplaceAll=false, bool nameChange=false, bool isRecursionStep=false) ;
260 bool recursiveRedirectServers(const RooAbsCollection& newServerList, bool mustReplaceAll=false, bool nameChange=false, bool recurseInNewSet=true) ;
261
262 virtual bool redirectServersHook(const RooAbsCollection & newServerList, bool mustReplaceAll,
263 bool nameChange, bool isRecursiveStep);
264
265 virtual void serverNameChangeHook(const RooAbsArg* /*oldServer*/, const RooAbsArg* /*newServer*/) { } ;
266
267 void addServer(RooAbsArg& server, bool valueProp=true, bool shapeProp=false, std::size_t refCount = 1);
268 void addServerList(RooAbsCollection& serverList, bool valueProp=true, bool shapeProp=false) ;
269 void replaceServer(RooAbsArg& oldServer, RooAbsArg& newServer, bool valueProp, bool shapeProp) ;
270 void changeServer(RooAbsArg& server, bool valueProp, bool shapeProp) ;
271 void removeServer(RooAbsArg& server, bool force=false) ;
272 RooAbsArg *findNewServer(const RooAbsCollection &newSet, bool nameChange) const;
273
274
275 /// @}
276 ///////////////////////////////////////////////////////////////////////////////
277
278
279 // Parameter & observable interpretation of servers
280 RooArgSet* getVariables(bool stripDisconnected=true) const ;
281 RooArgSet* getParameters(const RooAbsData* data, bool stripDisconnected=true) const ;
282 /// Return the parameters of this p.d.f when used in conjuction with dataset 'data'
283 RooArgSet* getParameters(const RooAbsData& data, bool stripDisconnected=true) const {
284 return getParameters(&data,stripDisconnected) ;
285 }
286 /// Return the parameters of the p.d.f given the provided set of observables
287 RooArgSet* getParameters(const RooArgSet& observables, bool stripDisconnected=true) const {
288 return getParameters(&observables,stripDisconnected);
289 }
290 RooArgSet* getParameters(const RooArgSet* observables, bool stripDisconnected=true) const;
291 virtual bool getParameters(const RooArgSet* observables, RooArgSet& outputSet, bool stripDisconnected=true) const;
292 /// Given a set of possible observables, return the observables that this PDF depends on.
293 RooArgSet* getObservables(const RooArgSet& set, bool valueOnly=true) const {
294 return getObservables(&set,valueOnly) ;
295 }
296 RooArgSet* getObservables(const RooAbsData* data) const ;
297 /// Return the observables of this pdf given the observables defined by `data`.
299 return getObservables(&data) ;
300 }
301 RooArgSet* getObservables(const RooArgSet* depList, bool valueOnly=true) const ;
302 bool getObservables(const RooAbsCollection* depList, RooArgSet& outputSet, bool valueOnly=true) const;
303 bool observableOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const ;
304 bool observableOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const ;
305 virtual bool checkObservables(const RooArgSet* nset) const ;
306 bool recursiveCheckObservables(const RooArgSet* nset) const ;
307 RooArgSet* getComponents() const ;
308
309
310
311 void attachArgs(const RooAbsCollection &set);
312 void attachDataSet(const RooAbsData &set);
313 void attachDataStore(const RooAbsDataStore &set);
314
315 // I/O streaming interface (machine readable)
316 virtual bool readFromStream(std::istream& is, bool compact, bool verbose=false) = 0 ;
317 virtual void writeToStream(std::ostream& os, bool compact) const = 0 ;
318
319 /// Print the object to the defaultPrintStream().
320 /// \param[in] options **V** print verbose. **T** print a tree structure with all children.
321 void Print(Option_t *options= nullptr) const override {
322 // Printing interface (human readable)
324 }
325
326 void printName(std::ostream& os) const override ;
327 void printTitle(std::ostream& os) const override ;
328 void printClassName(std::ostream& os) const override ;
329 void printAddress(std::ostream& os) const override ;
330 void printArgs(std::ostream& os) const override ;
331 virtual void printMetaArgs(std::ostream& /*os*/) const {} ;
332 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override;
333 void printTree(std::ostream& os, TString indent="") const override ;
334
335 Int_t defaultPrintContents(Option_t* opt) const override ;
336
337 // Accessors to attributes
338 void setAttribute(const Text_t* name, bool value=true) ;
339 bool getAttribute(const Text_t* name) const ;
340 inline const std::set<std::string>& attributes() const {
341 // Returns set of names of boolean attributes defined
342 return _boolAttrib ;
343 }
344
345 void setStringAttribute(const Text_t* key, const Text_t* value) ;
346 void removeStringAttribute(const Text_t* key) ;
347 const Text_t* getStringAttribute(const Text_t* key) const ;
348 inline const std::map<std::string,std::string>& stringAttributes() const {
349 // Returns std::map<string,string> with all string attributes defined
350 return _stringAttrib ;
351 }
352
353 // Accessors to transient attributes
354 void setTransientAttribute(const Text_t* name, bool value=true) ;
355 bool getTransientAttribute(const Text_t* name) const ;
356 inline const std::set<std::string>& transientAttributes() const {
357 // Return set of transient boolean attributes
358 return _boolAttribTransient ;
359 }
360
361 /// Check if the "Constant" attribute is set.
362 inline bool isConstant() const {
363 return _isConstant ; //getAttribute("Constant") ;
364 }
366
367 // Sorting
368 Int_t Compare(const TObject* other) const override ;
369 bool IsSortable() const override {
370 // Object is sortable in ROOT container class
371 return true ;
372 }
373
374 virtual bool operator==(const RooAbsArg& other) const = 0 ;
375 virtual bool isIdentical(const RooAbsArg& other, bool assumeSameType=false) const = 0 ;
376
377 // Range management
378 virtual bool inRange(const char*) const {
379 // Is value in range (dummy interface always returns true)
380 return true ;
381 }
382 virtual bool hasRange(const char*) const {
383 // Has this argument a defined range (dummy interface always returns flase)
384 return false ;
385 }
386
387
389 enum CacheMode { Always=0, NotAdvised=1, Never=2 } ;
390 enum OperMode { Auto=0, AClean=1, ADirty=2 } ;
391
392 ////////////////////////////////////////////////////////////////////////////
393 /// \anchor optimisationInterface
394 /// \name Optimisation interface
395 /// These functions allow RooFit to optimise a computation graph, to keep track
396 /// of cached values, and to invalidate caches.
397 /// @{
398
399 // Cache mode optimization (tracks changes & do lazy evaluation vs evaluate always)
400 virtual void optimizeCacheMode(const RooArgSet& observables) ;
401 virtual void optimizeCacheMode(const RooArgSet& observables, RooArgSet& optNodes, RooLinkedList& processedNodes) ;
402
403
404 // Find constant terms in expression
405 bool findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList) ;
406 bool findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList, RooLinkedList& processedNodes) ;
407
408
409 // constant term optimization
410 virtual void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTrackingOpt=true) ;
411
412 virtual CacheMode canNodeBeCached() const { return Always ; }
413 virtual void setCacheAndTrackHints(RooArgSet& /*trackNodes*/ ) {} ;
414
415 // Dirty state accessor
416 inline bool isShapeDirty() const {
417 // Return true is shape has been invalidated by server value change
418 return isDerived()?_shapeDirty:false ;
419 }
420
421 inline bool isValueDirty() const {
422 // Returns true of value has been invalidated by server value change
423 if (inhibitDirty()) return true ;
424 switch(_operMode) {
425 case AClean:
426 return false ;
427 case ADirty:
428 return true ;
429 case Auto:
430 if (_valueDirty) return isDerived() ;
431 return false ;
432 }
433 return true ; // we should never get here
434 }
435
436 inline bool isValueDirtyAndClear() const {
437 // Returns true of value has been invalidated by server value change
438 if (inhibitDirty()) return true ;
439 switch(_operMode) {
440 case AClean:
441 return false ;
442 case ADirty:
443 return true ;
444 case Auto:
445 if (_valueDirty) {
446 _valueDirty = false ;
447 return isDerived();
448 }
449 return false ;
450 }
451 return true ; // But we should never get here
452 }
453
454
455 inline bool isValueOrShapeDirtyAndClear() const {
456 // Returns true of value has been invalidated by server value change
457
458 if (inhibitDirty()) return true ;
459 switch(_operMode) {
460 case AClean:
461 return false ;
462 case ADirty:
463 return true ;
464 case Auto:
465 if (_valueDirty || _shapeDirty) {
466 _shapeDirty = false ;
467 _valueDirty = false ;
468 return isDerived();
469 }
470 _shapeDirty = false ;
471 _valueDirty = false ;
472 return false ;
473 }
474 return true ; // But we should never get here
475 }
476
477 // Cache management
478 void registerCache(RooAbsCache& cache) ;
479 void unRegisterCache(RooAbsCache& cache) ;
480 Int_t numCaches() const ;
482
483 /// Query the operation mode of this node.
484 inline OperMode operMode() const { return _operMode ; }
485 /// Set the operation mode of this node.
486 void setOperMode(OperMode mode, bool recurseADirty=true) ;
487
488 // Dirty state modifiers
489 /// Mark the element dirty. This forces a re-evaluation when a value is requested.
491 if (_operMode == Auto && !inhibitDirty())
492 setValueDirty(nullptr);
493 }
494 /// Notify that a shape-like property (*e.g.* binning) has changed.
495 void setShapeDirty() { setShapeDirty(nullptr); }
496
497 const char* aggregateCacheUniqueSuffix() const ;
498 virtual const char* cacheUniqueSuffix() const { return nullptr ; }
499
500 void wireAllCaches() ;
501
504
505 /// Overwrite the current value stored in this object, making it look like this object computed that value.
506 // \param[in] value Value to store.
507 // \param[in] notifyClients Notify users of this object that they need to
508 /// recompute their values.
509 virtual void setCachedValue(double /*value*/, bool /*notifyClients*/ = true) {};
510
511 /// @}
512 ////////////////////////////////////////////////////////////////////////////
513
514 //Debug hooks
515 static void verboseDirty(bool flag) ;
516 void printDirty(bool depth=true) const ;
517 static void setDirtyInhibit(bool flag) ;
518
519 void graphVizTree(const char* fileName, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
520 void graphVizTree(std::ostream& os, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
521
522 void printComponentTree(const char* indent="",const char* namePat=nullptr, Int_t nLevel=999) ;
523 void printCompactTree(const char* indent="",const char* fileName=nullptr, const char* namePat=nullptr, RooAbsArg* client=nullptr) ;
524 void printCompactTree(std::ostream& os, const char* indent="", const char* namePat=nullptr, RooAbsArg* client=nullptr) ;
525 virtual void printCompactTreeHook(std::ostream& os, const char *ind="") ;
526
527 // We want to support three cases here:
528 // * passing a RooArgSet
529 // * passing a RooArgList
530 // * passing an initializer list
531 // Before, there was only an overload taking a RooArg set, which caused an
532 // implicit creation of a RooArgSet when a RooArgList was passed. This needs
533 // to be avoided, because if the passed RooArgList is owning the argumnets,
534 // this information will be lost with the copy. The solution is to have one
535 // overload that takes a general RooAbsCollection, and one overload for
536 // RooArgList that is invoked in the case of passing an initializer list.
537 bool addOwnedComponents(const RooAbsCollection& comps) ;
539 bool addOwnedComponents(RooArgList&& comps) ;
540
541 // Transfer the ownership of one or more other RooAbsArgs to this RooAbsArg
542 // via a `std::unique_ptr`.
543 template<typename... Args_t>
544 bool addOwnedComponents(std::unique_ptr<Args_t>... comps) {
545 return addOwnedComponents({*comps.release() ...});
546 }
547 const RooArgSet* ownedComponents() const { return _ownedComponents ; }
548
550
551 void setWorkspace(RooWorkspace &ws) { _myws = &ws; }
552
554 Int_t numProxies() const ;
555
556 /// De-duplicated pointer to this object's name.
557 /// This can be used for fast name comparisons.
558 /// like `if (namePtr() == other.namePtr())`.
559 /// \note TNamed::GetName() will return a pointer that's
560 /// different for each object, but namePtr() always points
561 /// to a unique instance.
562 inline const TNamed* namePtr() const {
563 return _namePtr ;
564 }
565
566 void SetName(const char* name) override ;
567 void SetNameTitle(const char *name, const char *title) override ;
568
570 {
571 _myws = &ws;
572 return false;
573 };
574
575 virtual bool canComputeBatchWithCuda() const { return false; }
576 virtual bool isReducerNode() const { return false; }
577
578 virtual void applyWeightSquared(bool flag);
579
580 virtual std::unique_ptr<RooArgSet> fillNormSetForServer(RooArgSet const& normSet, RooAbsArg const& server) const;
581
582 virtual bool isCategory() const { return false; }
583
584protected:
585 void graphVizAddConnections(std::set<std::pair<RooAbsArg*,RooAbsArg*> >&) ;
586
587 virtual void operModeHook() {} ;
588
589 virtual void optimizeDirtyHook(const RooArgSet* /*obs*/) {} ;
590
591 virtual bool isValid() const ;
592
593 virtual void getParametersHook(const RooArgSet* /*nset*/, RooArgSet* /*list*/, bool /*stripDisconnected*/) const {} ;
594 virtual void getObservablesHook(const RooArgSet* /*nset*/, RooArgSet* /*list*/) const {} ;
595
597 _valueDirty=false ;
598 _shapeDirty=false ;
599 }
600
601 void clearValueDirty() const {
602 _valueDirty=false ;
603 }
604 void clearShapeDirty() const {
605 _shapeDirty=false ;
606 }
607
608 /// Force element to re-evaluate itself when a value is requested.
609 void setValueDirty(const RooAbsArg* source);
610 /// Notify that a shape-like property (*e.g.* binning) has changed.
611 void setShapeDirty(const RooAbsArg* source);
612
613 virtual void ioStreamerPass2() ;
614 static void ioStreamerPass2Finalize() ;
615
616
617private:
618 void addParameters(RooAbsCollection& params, const RooArgSet* nset = nullptr, bool stripDisconnected = true) const;
619 std::size_t getParametersSizeEstimate(const RooArgSet* nset = nullptr) const;
620
622
623
624 protected:
625 friend class RooAbsReal;
626
627 // Client-Server relation and Proxy management
628 friend class RooAbsCollection ;
629 friend class RooWorkspace ;
630 friend class RooRealIntegral ;
631 RefCountList_t _serverList ; // list of server objects
632 RefCountList_t _clientList; // list of client objects
633 RefCountList_t _clientListShape; // subset of clients that requested shape dirty flag propagation
634 RefCountList_t _clientListValue; // subset of clients that requested value dirty flag propagation
635
636 RooRefArray _proxyList ; // list of proxies
637
638 std::vector<RooAbsCache*> _cacheList ; //! list of caches
639
640
641 // Proxy management
642 friend class RooArgProxy ;
643 template<class RooCollection_t>
644 friend class RooCollectionProxy;
645 friend class RooHistPdf ;
646 friend class RooHistFunc ;
647 void registerProxy(RooArgProxy& proxy) ;
648 void registerProxy(RooSetProxy& proxy) ;
649 void registerProxy(RooListProxy& proxy) ;
650 void unRegisterProxy(RooArgProxy& proxy) ;
651 void unRegisterProxy(RooSetProxy& proxy) ;
652 void unRegisterProxy(RooListProxy& proxy) ;
653 void setProxyNormSet(const RooArgSet* nset) ;
654
655 // Attribute list
656 std::set<std::string> _boolAttrib ; // Boolean attributes
657 std::map<std::string,std::string> _stringAttrib ; // String attributes
658 std::set<std::string> _boolAttribTransient ; //! Transient boolean attributes (not copied in ctor)
659
660 void printAttribList(std::ostream& os) const;
661
662 // Hooks for RooTreeData interface
664 friend class RooTreeDataStore ;
665 friend class RooVectorDataStore ;
666 friend class RooDataSet ;
667 friend class RooRealMPFE ;
668 virtual void syncCache(const RooArgSet* nset=nullptr) = 0 ;
669 virtual void copyCache(const RooAbsArg* source, bool valueOnly=false, bool setValDirty=true) = 0 ;
670
671 virtual void attachToTree(TTree& t, Int_t bufSize=32000) = 0 ;
672 virtual void attachToVStore(RooVectorDataStore& vstore) = 0 ;
673 /// Attach this argument to the data store such that it reads data from there.
674 void attachToStore(RooAbsDataStore& store) ;
675
676 virtual void setTreeBranchStatus(TTree& t, bool active) = 0 ;
677 virtual void fillTreeBranch(TTree& t) = 0 ;
678 TString cleanBranchName() const ;
679
680 // Global
681 friend std::ostream& operator<<(std::ostream& os, const RooAbsArg &arg);
682 friend std::istream& operator>>(std::istream& is, RooAbsArg &arg) ;
684
686 std::vector<RooAbsProxy*> cache;
687 bool isDirty = true;
688 };
689 ProxyListCache _proxyListCache; //! cache of the list of proxies. Avoids type casting.
690
691 // Debug stuff
692 static bool _verboseDirty ; // Static flag controlling verbose messaging for dirty state changes
693 static bool _inhibitDirty ; // Static flag controlling global inhibit of dirty state propagation
694 bool _deleteWatch ; //! Delete watch flag
695
696 bool inhibitDirty() const ;
697
698 public:
699 void setLocalNoDirtyInhibit(bool flag) const { _localNoInhibitDirty = flag ; }
701
702 /// Returns the token for retrieving results in the BatchMode. For internal use only.
703 std::size_t dataToken() const { return _dataToken; }
704
705 /// Sets the token for retrieving results in the BatchMode. For internal use only.
706 void setDataToken(std::size_t index) { _dataToken = index; }
707 protected:
708
709
710 mutable bool _valueDirty ; // Flag set if value needs recalculating because input values modified
711 mutable bool _shapeDirty ; // Flag set if value needs recalculating because input shapes modified
712
713 mutable OperMode _operMode ; // Dirty state propagation mode
714 mutable bool _fast = false; // Allow fast access mode in getVal() and proxies
715
716 // Owned components
717 RooArgSet* _ownedComponents ; //! Set of owned component
718
719 mutable bool _prohibitServerRedirect ; //! Prohibit server redirects -- Debugging tool
720
721 mutable RooExpensiveObjectCache* _eocache{nullptr}; // Pointer to global cache manager for any expensive components created by this object
722
723 mutable const TNamed * _namePtr ; //! De-duplicated name pointer. This will be equal for all objects with the same name.
724 bool _isConstant ; //! Cached isConstant status
725
726 mutable bool _localNoInhibitDirty ; //! Prevent 'AlwaysDirty' mode for this node
727
728/* RooArgSet _leafNodeCache ; //! Cached leaf nodes */
729/* RooArgSet _branchNodeCache //! Cached branch nodes */
730
731 mutable RooWorkspace *_myws; //! In which workspace do I live, if any
732
733 std::size_t _dataToken = 0; //! Set by the RooFitDriver for this arg to retrieve its result in the run context
734
735 /// \cond Internal
736 // Legacy streamers need the following statics:
737 friend class RooFitResult;
738
739 public:
740 static std::map<RooAbsArg*,std::unique_ptr<TRefArray>> _ioEvoList; // temporary holding list for proxies needed in schema evolution
741 protected:
742 static std::stack<RooAbsArg*> _ioReadStack ; // reading stack
743 /// \endcond
744
745 ClassDefOverride(RooAbsArg,8) // Abstract variable
746};
747
748std::ostream& operator<<(std::ostream& os, const RooAbsArg &arg);
749std::istream& operator>>(std::istream& is, RooAbsArg &arg);
750
751
752#endif
#define R__SUGGEST_ALTERNATIVE(ALTERNATIVE)
Definition: RConfig.hxx:524
std::ostream & operator<<(std::ostream &os, const RooAbsArg &arg)
Ostream operator.
Definition: RooAbsArg.cxx:1570
std::istream & operator>>(std::istream &is, RooAbsArg &arg)
Istream operator.
Definition: RooAbsArg.cxx:1579
char Text_t
Definition: RtypesCore.h:62
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char mode
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:71
RooExpensiveObjectCache & expensiveObjectCache() const
Definition: RooAbsArg.cxx:2271
void setLocalNoDirtyInhibit(bool flag) const
Definition: RooAbsArg.h:699
bool overlaps(const RooAbsArg &testArg, bool valueOnly=false) const
Test if any of the nodes of tree are shared with that of the given tree.
Definition: RooAbsArg.cxx:860
RooRefArray _proxyList
Definition: RooAbsArg.h:636
void replaceServer(RooAbsArg &oldServer, RooAbsArg &newServer, bool valueProp, bool shapeProp)
Replace 'oldServer' with 'newServer'.
Definition: RooAbsArg.cxx:427
bool _isConstant
De-duplicated name pointer. This will be equal for all objects with the same name.
Definition: RooAbsArg.h:724
void clearValueAndShapeDirty() const
Definition: RooAbsArg.h:596
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
Definition: RooAbsArg.h:321
virtual void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true)=0
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Definition: RooAbsArg.cxx:805
void attachToStore(RooAbsDataStore &store)
Attach this argument to the data store such that it reads data from there.
Definition: RooAbsArg.cxx:2258
bool recursiveRedirectServers(const RooAbsCollection &newServerList, bool mustReplaceAll=false, bool nameChange=false, bool recurseInNewSet=true)
Recursively replace all servers with the new servers in newSet.
Definition: RooAbsArg.cxx:1165
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
Definition: RooAbsArg.h:562
const char * aggregateCacheUniqueSuffix() const
Definition: RooAbsArg.cxx:2283
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
Definition: RooAbsArg.cxx:1460
void printClassName(std::ostream &os) const override
Print object class name.
Definition: RooAbsArg.cxx:1443
bool dependentOverlaps(const RooAbsData *dset, const RooAbsArg &testArg) const
Definition: RooAbsArg.h:166
virtual void getObservablesHook(const RooArgSet *, RooArgSet *) const
Definition: RooAbsArg.h:594
ProxyListCache _proxyListCache
Definition: RooAbsArg.h:689
RooWorkspace * _myws
Prevent 'AlwaysDirty' mode for this node.
Definition: RooAbsArg.h:731
~RooAbsArg() override
Destructor.
Definition: RooAbsArg.cxx:177
void attachDataStore(const RooAbsDataStore &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Definition: RooAbsArg.cxx:1634
bool addOwnedComponents(std::unique_ptr< Args_t >... comps)
Definition: RooAbsArg.h:544
virtual bool operator==(const RooAbsArg &other) const =0
RooArgSet * _ownedComponents
Definition: RooAbsArg.h:717
void printAddress(std::ostream &os) const override
Print class name of object.
Definition: RooAbsArg.cxx:1449
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition: RooAbsArg.h:495
virtual bool isCategory() const
Definition: RooAbsArg.h:582
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:509
void setDataToken(std::size_t index)
Sets the token for retrieving results in the BatchMode. For internal use only.
Definition: RooAbsArg.h:706
virtual void syncCache(const RooArgSet *nset=nullptr)=0
void registerProxy(RooArgProxy &proxy)
Register an RooArgProxy in the proxy list.
Definition: RooAbsArg.cxx:1233
void setOperMode(OperMode mode, bool recurseADirty=true)
Set the operation mode of this node.
Definition: RooAbsArg.cxx:1866
friend std::ostream & operator<<(std::ostream &os, const RooAbsArg &arg)
Ostream operator.
Definition: RooAbsArg.cxx:1570
RooFIter valueClientMIterator() const
Definition: RooAbsArg.h:145
void setProhibitServerRedirect(bool flag)
Definition: RooAbsArg.h:549
void attachArgs(const RooAbsCollection &set)
Bind this node to objects in set.
Definition: RooAbsArg.cxx:1609
RooArgSet * getDependents(const RooArgSet &set) const
Definition: RooAbsArg.h:160
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
Definition: RooAbsArg.cxx:278
bool isShapeServer(const RooAbsArg &arg) const
Check if this is serving shape to arg.
Definition: RooAbsArg.h:223
bool isShapeDirty() const
Definition: RooAbsArg.h:416
static void ioStreamerPass2Finalize()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2393
bool isValueDirtyAndClear() const
Definition: RooAbsArg.h:436
RooArgSet * getDependents(const RooAbsData *set) const
Definition: RooAbsArg.h:162
virtual CacheMode canNodeBeCached() const
Definition: RooAbsArg.h:412
bool isConstant() const
Check if the "Constant" attribute is set.
Definition: RooAbsArg.h:362
bool _fast
Definition: RooAbsArg.h:714
void setWorkspace(RooWorkspace &ws)
Definition: RooAbsArg.h:551
virtual TObject * clone(const char *newname=nullptr) const =0
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:553
const RooArgSet * ownedComponents() const
Definition: RooAbsArg.h:547
void removeServer(RooAbsArg &server, bool force=false)
Unregister another RooAbsArg as a server to us, ie, declare that we no longer depend on its value and...
Definition: RooAbsArg.cxx:402
RooAbsArg & operator=(const RooAbsArg &other)=delete
void setTransientAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:313
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:2173
void unRegisterProxy(RooArgProxy &proxy)
Remove proxy from proxy list.
Definition: RooAbsArg.cxx:1262
bool checkDependents(const RooArgSet *nset) const
Definition: RooAbsArg.h:170
RooArgSet * getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
Definition: RooAbsArg.h:293
virtual bool canComputeBatchWithCuda() const
Definition: RooAbsArg.h:575
bool _shapeDirty
Definition: RooAbsArg.h:711
const RefCountList_t & shapeClients() const
List of all shape clients of this object.
Definition: RooAbsArg.h:193
void SetName(const char *name) override
Set the name of the TNamed.
Definition: RooAbsArg.cxx:2314
RooSTLRefCountList< RooAbsArg > RefCountList_t
Definition: RooAbsArg.h:73
const RefCountList_t & valueClients() const
List of all value clients of this object. Value clients receive value updates.
Definition: RooAbsArg.h:188
friend std::istream & operator>>(std::istream &is, RooAbsArg &arg)
Istream operator.
Definition: RooAbsArg.cxx:1579
RooArgSet * getObservables(const RooAbsData &data) const
Return the observables of this pdf given the observables defined by data.
Definition: RooAbsArg.h:298
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
Definition: RooAbsArg.h:503
virtual bool hasRange(const char *) const
Definition: RooAbsArg.h:382
std::set< std::string > _boolAttrib
Definition: RooAbsArg.h:656
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
Definition: RooAbsArg.cxx:2029
RefCountList_t _clientListValue
Definition: RooAbsArg.h:634
bool addOwnedComponents(const RooAbsCollection &comps)
Take ownership of the contents of 'comps'.
Definition: RooAbsArg.cxx:2185
void printAttribList(std::ostream &os) const
Transient boolean attributes (not copied in ctor)
Definition: RooAbsArg.cxx:1588
void printTree(std::ostream &os, TString indent="") const override
Print object tree structure.
Definition: RooAbsArg.cxx:1561
void SetNameTitle(const char *name, const char *title) override
Set all the TNamed parameters (name and title).
Definition: RooAbsArg.cxx:2331
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
Definition: RooAbsArg.cxx:299
bool 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:1762
virtual RooAbsArg * createFundamental(const char *newname=nullptr) const =0
Create a fundamental-type object that stores our type of value.
static bool _verboseDirty
cache of the list of proxies. Avoids type casting.
Definition: RooAbsArg.h:692
bool _deleteWatch
Definition: RooAbsArg.h:694
void addServerList(RooAbsCollection &serverList, bool valueProp=true, bool shapeProp=false)
Register a list of RooAbsArg as servers to us by calling addServer() for each arg in the list.
Definition: RooAbsArg.cxx:387
virtual bool readFromStream(std::istream &is, bool compact, bool verbose=false)=0
bool dependsOnValue(const RooAbsArg &server, const RooAbsArg *ignoreArg=nullptr) const
Check whether this object depends on values served from the object passed as server.
Definition: RooAbsArg.h:109
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:287
bool redirectServers(const RooAbsCollection &newServerList, bool mustReplaceAll=false, bool nameChange=false, bool isRecursionStep=false)
Replace all direct servers of this object with the new servers in newServerList.
Definition: RooAbsArg.cxx:999
virtual bool 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:253
bool isValueServer(const char *name) const
Check if this is serving values to an object with name name.
Definition: RooAbsArg.h:219
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:283
RooFIter serverMIterator() const
Definition: RooAbsArg.h:153
static void setDirtyInhibit(bool flag)
Control global dirty inhibit mode.
Definition: RooAbsArg.cxx:219
virtual void serverNameChangeHook(const RooAbsArg *, const RooAbsArg *)
Definition: RooAbsArg.h:265
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:2007
virtual void setCacheAndTrackHints(RooArgSet &)
Definition: RooAbsArg.h:413
bool recursiveCheckDependents(const RooArgSet *nset) const
Definition: RooAbsArg.h:172
const std::set< std::string > & attributes() const
Definition: RooAbsArg.h:340
bool isShapeServer(const char *name) const
Check if this is serving shape to an object with name name.
Definition: RooAbsArg.h:227
const TNamed * _namePtr
Definition: RooAbsArg.h:723
void printCompactTree(const char *indent="", const char *fileName=nullptr, const char *namePat=nullptr, RooAbsArg *client=nullptr)
Print tree structure of expression tree on stdout, or to file if filename is specified.
Definition: RooAbsArg.cxx:1893
virtual void getParametersHook(const RooArgSet *, RooArgSet *, bool) const
Definition: RooAbsArg.h:593
void clearValueDirty() const
Definition: RooAbsArg.h:601
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2365
void wireAllCaches()
Definition: RooAbsArg.cxx:2299
virtual bool importWorkspaceHook(RooWorkspace &ws)
Definition: RooAbsArg.h:569
bool _valueDirty
Definition: RooAbsArg.h:710
bool _prohibitServerRedirect
Set of owned component.
Definition: RooAbsArg.h:719
virtual const char * cacheUniqueSuffix() const
Definition: RooAbsArg.h:498
RefCountListLegacyIterator_t * makeLegacyIterator(const RefCountList_t &list) const
Definition: RooAbsArg.cxx:2411
@ NotAdvised
Definition: RooAbsArg.h:389
const RefCountList_t & servers() const
List of all servers of this object.
Definition: RooAbsArg.h:198
std::size_t _dataToken
In which workspace do I live, if any.
Definition: RooAbsArg.h:733
TIterator * valueClientIterator() const
Definition: RooAbsArg.h:129
bool dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr) const
Check whether this object depends on values from an element in the serverList.
Definition: RooAbsArg.h:101
void addServer(RooAbsArg &server, bool valueProp=true, bool shapeProp=false, std::size_t refCount=1)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
Definition: RooAbsArg.cxx:351
void removeStringAttribute(const Text_t *key)
Delete a string attribute with a given key.
Definition: RooAbsArg.cxx:290
RooArgSet * getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:2057
Int_t Compare(const TObject *other) const override
Utility function used by TCollection::Sort to compare contained TObjects We implement comparison by n...
Definition: RooAbsArg.cxx:1644
Int_t defaultPrintContents(Option_t *opt) const override
Define default contents to print.
Definition: RooAbsArg.cxx:1483
virtual bool isDerived() const
Does value or shape of this arg depend on any other arg?
Definition: RooAbsArg.h:91
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:1401
void printComponentTree(const char *indent="", const char *namePat=nullptr, Int_t nLevel=999)
Print tree structure of expression tree on given ostream, only branch nodes are printed.
Definition: RooAbsArg.cxx:1953
OperMode _operMode
Definition: RooAbsArg.h:713
virtual void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTrackingOpt=true)
Interface function signaling a request to perform constant term optimization.
Definition: RooAbsArg.cxx:1853
virtual bool isReducerNode() const
Definition: RooAbsArg.h:576
RooLinkedList getCloningAncestors() const
Return ancestors in cloning chain of this RooAbsArg.
Definition: RooAbsArg.cxx:2067
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition: RooAbsArg.h:490
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:269
bool isValueOrShapeDirtyAndClear() const
Definition: RooAbsArg.h:455
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:207
static void verboseDirty(bool flag)
Activate verbose messaging related to dirty flag propagation.
Definition: RooAbsArg.cxx:228
virtual bool inRange(const char *) const
Definition: RooAbsArg.h:378
virtual void setTreeBranchStatus(TTree &t, bool active)=0
const std::map< std::string, std::string > & stringAttributes() const
Definition: RooAbsArg.h:348
RooAbsCache * getCache(Int_t index) const
Return registered cache object by index.
Definition: RooAbsArg.cxx:2048
virtual void writeToStream(std::ostream &os, bool compact) const =0
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Implement multi-line detailed printing.
Definition: RooAbsArg.cxx:1493
virtual RooAbsArg * cloneTree(const char *newname=nullptr) const
Clone tree expression of objects.
Definition: RooAbsArg.cxx:2220
void registerCache(RooAbsCache &cache)
Register RooAbsCache with this object.
Definition: RooAbsArg.cxx:2020
virtual void optimizeCacheMode(const RooArgSet &observables)
Activate cache mode optimization with given definition of observables.
Definition: RooAbsArg.cxx:1686
RefCountList_t _clientListShape
Definition: RooAbsArg.h:633
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:1978
bool inhibitDirty() const
Delete watch flag.
Definition: RooAbsArg.cxx:109
bool 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:874
void changeServer(RooAbsArg &server, bool valueProp, bool shapeProp)
Change dirty flag propagation mask for specified server.
Definition: RooAbsArg.cxx:438
RooAbsArg * findServer(Int_t index) const
Return i-th server from server list.
Definition: RooAbsArg.h:211
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1361
@ DeActivate
Definition: RooAbsArg.h:388
@ ValueChange
Definition: RooAbsArg.h:388
@ ConfigChange
Definition: RooAbsArg.h:388
void printName(std::ostream &os) const override
Print object name.
Definition: RooAbsArg.cxx:1423
bool hasClients() const
Definition: RooAbsArg.h:115
const std::set< std::string > & transientAttributes() const
Definition: RooAbsArg.h:356
const RefCountList_t & clients() const
List of all clients of this object.
Definition: RooAbsArg.h:184
RooArgSet * getDependents(const RooArgSet *depList) const
Definition: RooAbsArg.h:164
bool isValueDirty() const
Definition: RooAbsArg.h:421
bool _localNoInhibitDirty
Cached isConstant status.
Definition: RooAbsArg.h:726
virtual void printMetaArgs(std::ostream &) const
Definition: RooAbsArg.h:331
virtual bool isIdentical(const RooAbsArg &other, bool assumeSameType=false) const =0
virtual void applyWeightSquared(bool flag)
Disables or enables the usage of squared weights.
Definition: RooAbsArg.cxx:2466
static bool _inhibitDirty
Definition: RooAbsArg.h:693
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:246
TIterator * shapeClientIterator() const
Definition: RooAbsArg.h:134
void setProxyNormSet(const RooArgSet *nset)
Forward a change in the cached normalization argset to all the registered proxies.
Definition: RooAbsArg.cxx:1372
std::size_t dataToken() const
Returns the token for retrieving results in the BatchMode. For internal use only.
Definition: RooAbsArg.h:703
void branchNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool recurseNonDerived=false) const
Fill supplied list with all branch nodes of the arg tree starting with ourself as top node.
Definition: RooAbsArg.cxx:483
RefCountList_t _clientList
Definition: RooAbsArg.h:632
void printDirty(bool depth=true) const
Print information about current value dirty state information.
Definition: RooAbsArg.cxx:1656
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1348
RooFIter shapeClientMIterator() const
Definition: RooAbsArg.h:149
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
Definition: RooAbsArg.h:83
RefCountList_t _serverList
Definition: RooAbsArg.h:631
void clearShapeDirty() const
Definition: RooAbsArg.h:604
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool recurseNonDerived=false) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node.
Definition: RooAbsArg.cxx:472
RooExpensiveObjectCache * _eocache
Prohibit server redirects – Debugging tool.
Definition: RooAbsArg.h:721
virtual bool isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:241
RooArgSet * getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
Definition: RooAbsArg.cxx:754
virtual bool isValid() const
WVE (08/21/01) Probably obsolete now.
Definition: RooAbsArg.cxx:1412
std::set< std::string > _boolAttribTransient
Definition: RooAbsArg.h:658
bool isCloneOf(const RooAbsArg &other) const
Check if this object was created as a clone of 'other'.
Definition: RooAbsArg.cxx:236
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:541
void printTitle(std::ostream &os) const override
Print object title.
Definition: RooAbsArg.cxx:1433
virtual bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep)
Function that is called at the end of redirectServers().
Definition: RooAbsArg.cxx:1217
virtual void fillTreeBranch(TTree &t)=0
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:592
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:2096
bool getTransientAttribute(const Text_t *name) const
Check if a named attribute is set.
Definition: RooAbsArg.cxx:335
virtual void operModeHook()
Definition: RooAbsArg.h:587
TIterator * clientIterator() const
Retrieve a client iterator.
Definition: RooAbsArg.h:124
virtual void optimizeDirtyHook(const RooArgSet *)
Definition: RooAbsArg.h:589
TIterator * serverIterator() const
Definition: RooAbsArg.h:139
bool recursiveCheckObservables(const RooArgSet *nset) const
Recursively call checkObservables on all nodes in the expression tree.
Definition: RooAbsArg.cxx:781
bool isValueServer(const RooAbsArg &arg) const
Check if this is serving values to arg.
Definition: RooAbsArg.h:215
std::map< std::string, std::string > _stringAttrib
Definition: RooAbsArg.h:657
bool localNoDirtyInhibit() const
Definition: RooAbsArg.h:700
Int_t numCaches() const
Return number of registered caches.
Definition: RooAbsArg.cxx:2039
virtual bool checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Definition: RooAbsArg.cxx:772
RooAbsArg()
Default constructor.
Definition: RooAbsArg.cxx:118
virtual std::unique_ptr< RooArgSet > fillNormSetForServer(RooArgSet const &normSet, RooAbsArg const &server) const
Fills a RooArgSet to be used as the normalization set for a server, given a normalization set for thi...
Definition: RooAbsArg.cxx:2482
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Definition: RooAbsArg.cxx:1624
TIteratorToSTLInterface< RefCountList_t::Container_t > RefCountListLegacyIterator_t
Definition: RooAbsArg.h:74
RooAbsArg * findServer(const char *name) const
Return server of this with name name. Returns nullptr if not found.
Definition: RooAbsArg.h:202
std::vector< RooAbsCache * > _cacheList
Definition: RooAbsArg.h:638
void treeNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool doBranch=true, bool doLeaf=true, bool valueOnly=false, bool recurseNonDerived=false) const
Fill supplied list with nodes of the arg tree, following all server links, starting with ourself as t...
Definition: RooAbsArg.cxx:499
bool IsSortable() const override
Definition: RooAbsArg.h:369
RooAbsArg * findNewServer(const RooAbsCollection &newSet, bool nameChange) const
Find the new server in the specified set that matches the old server.
Definition: RooAbsArg.cxx:1118
OperMode operMode() const
Query the operation mode of this node.
Definition: RooAbsArg.h:484
bool dependentOverlaps(const RooArgSet *depList, const RooAbsArg &testArg) const
Definition: RooAbsArg.h:168
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:62
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:33
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:62
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
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:56
RooCollectionProxy is the concrete proxy for RooArgSet or RooArgList objects.
RooCompositeDataStore combines several disjunct datasets into one.
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:55
RooExpensiveObjectCache is a singleton class that serves as repository for objects that are expensive...
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:31
RooHistPdf implements a probablity density function sampled from a multidimensional histogram.
Definition: RooHistPdf.h:30
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:38
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=nullptr)
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,...
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
void Streamer(TBuffer &) override
Stream an object of class RooRefArray.
Definition: RooAbsArg.cxx:2418
RooRefArray(const RooRefArray &other)
Definition: RooAbsArg.h:57
~RooRefArray() override
Definition: RooAbsArg.h:60
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().
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:31
Mother of all ROOT objects.
Definition: TObject.h:41
Basic string class.
Definition: TString.h:136
A TTree represents a columnar dataset.
Definition: TTree.h:79
std::vector< RooAbsProxy * > cache
Definition: RooAbsArg.h:686