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