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