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