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