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