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