110 static std::map<RooAbsArg *, std::unique_ptr<TRefArray>> ioEvoListInstance;
111 return ioEvoListInstance;
117 static std::stack<RooAbsArg *> ioReadStackInstance;
118 return ioReadStackInstance;
133 if (
name ==
nullptr || strlen(
name) == 0) {
134 throw std::logic_error(
135 "Each RooFit object needs a name. "
136 "Objects representing the same entity (e.g. an observable 'x') are identified using their name.");
159 valueProp = server->_clientListValue.containsByNamePtr(&other);
160 shapeProp = server->_clientListShape.containsByNamePtr(&other);
161 addServer(*server, valueProp, shapeProp);
178 std::vector<RooAbsArg *> clientListTmp(
_clientList.begin(),
181 for (
auto client : clientListTmp) {
182 client->setAttribute(
"ServerDied");
183 std::stringstream attr;
184 attr <<
"ServerDied:" <<
GetName() <<
"(" <<
reinterpret_cast<std::size_t
>(
this) <<
")";
185 client->setAttribute(attr.str().c_str());
186 client->removeServer(*
this,
true);
191 cxcoutD(Tracing) <<
"RooAbsArg::dtor(" <<
GetName() <<
"," <<
this
192 <<
") DeleteWatch: object is being destroyed" << std::endl;
197 <<
"\" should have been deleted first" << std::endl;
227 if (std::string{
"Constant"} ==
name) {
271 std::map<std::string, std::string>::const_iterator iter =
_stringAttrib.find(key);
272 return iter !=
_stringAttrib.end() ? iter->second.c_str() :
nullptr;
310 cxcoutF(LinkStateMgmt) <<
"RooAbsArg::addServer(" <<
this <<
"," <<
GetName()
311 <<
"): PROHIBITED SERVER ADDITION REQUESTED: adding server " << server.
GetName() <<
"("
312 << &server <<
") for " << (valueProp ?
"value " :
"") << (shapeProp ?
"shape" :
"")
314 throw std::logic_error(
"PROHIBITED SERVER ADDITION REQUESTED in RooAbsArg::addServer");
317 cxcoutD(LinkStateMgmt) <<
"RooAbsArg::addServer(" <<
this <<
"," <<
GetName() <<
"): adding server "
318 << server.
GetName() <<
"(" << &server <<
") for " << (valueProp ?
"value " :
"")
319 << (shapeProp ?
"shape" :
"") << std::endl;
348 for (
const auto arg : serverList) {
359 std::stringstream ss;
360 ss <<
"RooAbsArg::addServer(" <<
this <<
"," <<
GetName()
361 <<
"): PROHIBITED SERVER REMOVAL REQUESTED: removing server " << server.
GetName() <<
"(" << &server <<
")";
362 cxcoutF(LinkStateMgmt) << ss.str() << std::endl;
363 throw std::runtime_error(ss.str());
367 cxcoutD(LinkStateMgmt) <<
"RooAbsArg::removeServer(" <<
GetName() <<
"): removing server " << server.
GetName()
368 <<
"(" << &server <<
")" << std::endl;
399 coutW(LinkStateMgmt) <<
"replaceServer()"
400 <<
" is unsafe, because the server list will be out of sync with the proxy objects!"
401 <<
" If you want to safely replace a server, use RooAbsArg::redirectServers()."
402 <<
" See the docs to replaceServers() for more info." << std::endl;
407 addServer(newServer, propValue, propShape, count);
415 coutE(LinkStateMgmt) <<
"RooAbsArg::changeServer(" <<
GetName() <<
"): Server " << server.
GetName()
416 <<
" not registered" << std::endl;
422 coutE(LinkStateMgmt) <<
"RooAbsArg::changeServer(" <<
GetName() <<
"): Server " << server.
GetName()
423 <<
" doesn't have us registered as client" << std::endl;
466 bool valueOnly,
bool recurseFundamental)
const
479 if ((doBranch && doLeaf) || (doBranch && arg->
isDerived()) ||
483 list->add(*arg,
true);
494 if (!server->_clientListValue.containsByNamePtr(arg)) {
548 std::vector<RooAbsArg *> branchList;
550 if (server->isValueServer(*
this)) {
551 if (server->isFundamental()) {
552 if (!nset || !server->dependsOn(*nset)) {
553 nodeParamServers.
add(*server);
556 branchList.push_back(server);
562 std::sort(branchList.begin(), branchList.end());
563 const auto last = std::unique(branchList.begin(), branchList.end());
564 for (
auto serverIt = branchList.begin(); serverIt < last; ++serverIt) {
565 (*serverIt)->addParameters(nodeParamServers, nset, stripDisconnected);
572 params.
add(nodeParamServers,
true);
586 outputSet.
setName(
"parameters");
647 outputSet.
setName(
"dependents");
653 RooArgSet leafList(
"leafNodeServerList");
657 for (
const auto arg : leafList) {
658 if (arg->dependsOnValue(*dataList) && arg->isLValue()) {
663 for (
const auto arg : leafList) {
664 if (arg->dependsOn(*dataList) && arg->isLValue()) {
701 if (arg->getAttribute(
"ServerDied")) {
702 coutE(LinkStateMgmt) <<
"RooAbsArg::recursiveCheckObservables(" <<
GetName()
703 <<
"): ERROR: one or more servers of node " << arg->GetName() <<
" no longer exists!"
708 ret |= arg->checkObservables(nset);
722 for (
auto server : serverList) {
723 if (
dependsOn(*server, ignoreArg, valueOnly)) {
733 if (
this == ignoreArg)
737 if (testArgNamePtr ==
namePtr())
752 if (!valueOnly || server->isValueServer(*
this)) {
753 if (server->dependsOn(testArgNamePtr, ignoreArg, valueOnly)) {
804 if (source ==
nullptr) {
806 }
else if (source ==
this) {
808 coutE(LinkStateMgmt) <<
"RooAbsArg::setValueDirty(" <<
GetName()
809 <<
"): cyclical dependency detected, source = " << source->
GetName() << std::endl;
816 cxcoutD(LinkStateMgmt) <<
"RooAbsArg::setValueDirty(" << (source ? source->
GetName() :
"self") <<
"->"
818 <<
"raised" << std::endl;
824 client->setValueDirty(source);
834 cxcoutD(LinkStateMgmt) <<
"RooAbsArg::setShapeDirty(" <<
GetName() <<
"): dirty flag "
835 << (
_shapeDirty ?
"already " :
"") <<
"raised" << std::endl;
844 if (source ==
nullptr) {
846 }
else if (source ==
this) {
848 coutE(LinkStateMgmt) <<
"RooAbsArg::setShapeDirty(" <<
GetName() <<
"): cyclical dependency detected"
857 client->setShapeDirty(source);
858 client->setValueDirty(source);
886 bool isRecursionStep)
895 if (newSetOrig.
empty() || (newSetOrig.
size() == 1 && newSetOrig[0] ==
this))
899 std::unique_ptr<RooArgSet> newSetOwned;
903 newSetOwned = std::make_unique<RooArgSet>();
904 for (
auto arg : *newSet) {
906 if (std::string(
"REMOVAL_DUMMY") == arg->GetName()) {
908 if (arg->getAttribute(
"REMOVE_ALL")) {
909 newSetOwned->add(*arg);
911 newSetOwned->add(*arg);
914 newSetOwned->add(*arg);
917 newSet = newSetOwned.get();
923 RooAbsArg *newServer = oldServer->findNewServer(*newSet, nameChange);
926 if (mustReplaceAll) {
927 std::stringstream ss;
928 ss <<
"RooAbsArg::redirectServers(" << (
void *)
this <<
"," <<
GetName() <<
"): server "
929 << oldServer->GetName() <<
" (" << (
void *)oldServer <<
") not redirected"
930 << (nameChange ?
"[nameChange]" :
"");
931 const std::string errorMsg = ss.str();
932 coutE(LinkStateMgmt) << errorMsg << std::endl;
933 throw std::runtime_error(errorMsg);
938 if (newServer !=
this) {
955 if (mustReplaceAll && !ret2) {
957 coutE(LinkStateMgmt) <<
"RooAbsArg::redirectServers(" <<
GetName() <<
"): ERROR, proxy '" << p->
name()
958 <<
"' with arg '" << (ap ? ap->absArg()->
GetName() :
"<could not cast>")
959 <<
"' could not be adjusted" << std::endl;
974 const int clientListRefCount = oldServer->
_clientList.Remove(
this,
true);
975 const int clientListValueRefCount = oldServer->
_clientListValue.Remove(
this,
true);
976 const int clientListShapeRefCount = oldServer->
_clientListShape.Remove(
this,
true);
978 newServer->
_clientList.Add(
this, clientListRefCount);
989 bool isRecursionStep)
1006 bool nameChange =
false;
1013 auto newServerFound = replacements.find(oldServer);
1014 RooAbsArg *newServer = newServerFound != replacements.end() ? newServerFound->second :
nullptr;
1016 if (!newServer || newServer ==
this) {
1020 if (nameChange ==
false)
1021 nameChange = strcmp(newServerFound->first->GetName(), newServerFound->second->GetName()) != 0;
1024 newList.
add(*newServer);
1029 if (newList.
empty())
1038 p->changePointer(replacements);
1057 newServer = newSet.
find(*
this);
1061 TString nameAttrib(
"ORIGNAME:");
1064 if (
auto tmp = std::unique_ptr<RooAbsCollection>{newSet.
selectByAttrib(nameAttrib,
true)}) {
1072 if (tmp->size() > 1) {
1073 std::stringstream ss;
1074 ss <<
"RooAbsArg::redirectServers(" <<
GetName() <<
"): FATAL Error, " << tmp->size() <<
" servers with "
1075 << nameAttrib <<
" attribute";
1076 coutF(LinkStateMgmt) << ss.str() << std::endl;
1078 throw std::runtime_error(ss.str());
1082 newServer = tmp->first();
1091 bool recurseInNewSet, std::set<RooAbsArg const *> &callStack)
1095 auto it = callStack.lower_bound(arg);
1096 if (it != callStack.end() && arg == *it) {
1099 callStack.insert(it, arg);
1110 oocxcoutD(arg, LinkStateMgmt) <<
"RooAbsArg::recursiveRedirectServers(" << arg <<
"," << arg->
GetName()
1111 <<
") newSet = " << newSet <<
" mustReplaceAll = " << (mustReplaceAll ?
"T" :
"F")
1112 <<
" nameChange = " << (nameChange ?
"T" :
"F")
1113 <<
" recurseInNewSet = " << (recurseInNewSet ?
"T" :
"F") << std::endl;
1119 for (
const auto server : arg->
servers()) {
1120 ret |= recursiveRedirectServersImpl(server, newSet, mustReplaceAll, nameChange, recurseInNewSet, callStack);
1123 callStack.erase(arg);
1139 bool recurseInNewSet)
1142 std::set<const RooAbsArg *> callStack;
1144 return recursiveRedirectServersImpl(
this, newSet, mustReplaceAll, nameChange, recurseInNewSet, callStack);
1177 coutE(LinkStateMgmt) <<
"RooAbsArg::registerProxy(" <<
GetName() <<
"): proxy named " << proxy.
GetName()
1178 <<
" for arg " << proxy.
absArg()->
GetName() <<
" already registered" << std::endl;
1215 coutE(LinkStateMgmt) <<
"RooAbsArg::registerProxy(" <<
GetName() <<
"): proxy named " << proxy.
GetName()
1216 <<
" already registered" << std::endl;
1244 coutE(LinkStateMgmt) <<
"RooAbsArg::registerProxy(" <<
GetName() <<
"): proxy named " << proxy.
GetName()
1245 <<
" already registered" << std::endl;
1253 if (
_proxyList.GetEntries() != nProxyOld + 1) {
1254 std::cout <<
"RooAbsArg::registerProxy(" <<
GetName() <<
") proxy registration failure! nold=" << nProxyOld
1255 <<
" nnew=" <<
_proxyList.GetEntries() << std::endl;
1305 p->changeNormSet(nset);
1318 coutE(Contents) <<
"RooAbsArg::attachToTree(" <<
GetName() <<
"): Cannot be attached to a TTree" << std::endl;
1388 os <<
indent <<
"--- RooAbsArg ---" << std::endl;
1390 os <<
indent <<
" Value State: ";
1392 case ADirty: os <<
"FORCED DIRTY";
break;
1393 case AClean: os <<
"FORCED clean";
break;
1396 os << std::endl <<
indent <<
" Shape State: " << (
isShapeDirty() ?
"DIRTY" :
"clean") << std::endl;
1398 os <<
indent <<
" Attributes: ";
1402 os <<
indent <<
" Address: " << (
void *)
this << std::endl;
1404 os <<
indent <<
" Clients: " << std::endl;
1406 os <<
indent <<
" (" << (
void *)client <<
"," << (
_clientListValue.containsByNamePtr(client) ?
"V" :
"-")
1412 os <<
indent <<
" Servers: " << std::endl;
1414 os <<
indent <<
" (" << (
void *)server <<
"," << (server->_clientListValue.containsByNamePtr(
this) ?
"V" :
"-")
1415 << (server->_clientListShape.containsByNamePtr(
this) ?
"S" :
"-") <<
") ";
1420 os <<
indent <<
" Proxies: " << std::endl;
1425 os <<
indent <<
" " << proxy->
name() <<
" -> ";
1426 if (
auto *argProxy =
dynamic_cast<RooArgProxy *
>(proxy)) {
1427 if (
RooAbsArg *parg = argProxy->absArg()) {
1430 os <<
" (empty)" << std::endl;
1441 throw std::runtime_error(
"Unsupported proxy type.");
1473 std::set<std::string>::const_iterator iter =
_boolAttrib.begin();
1476 os << (first ?
" [" :
",") << *iter;
1495 for (
auto const &branch : branches) {
1496 branch->redirectServers(
set,
false,
false);
1535 branch->printDirty(
false);
1539 std::cout <<
GetName() <<
" : ";
1541 case AClean: std::cout <<
"FORCED clean";
break;
1542 case ADirty: std::cout <<
"FORCED DIRTY";
break;
1545 std::cout << std::endl;
1562 coutI(Optimization) <<
"RooAbsArg::optimizeCacheMode(" <<
GetName() <<
") nodes " << opt
1563 <<
" depend on observables, "
1564 <<
"changing cache operation mode from change tracking to unconditional evaluation" << std::endl;
1593 auto obj = processedNodes.
findArg(
this);
1594 assert(obj !=
this);
1597 cxcoutI(Optimization) <<
"RooAbsArg::optimizeCacheMode(" <<
GetName() <<
" node " <<
this <<
" exists already as "
1598 << obj <<
" but with the SAME name !" << std::endl;
1601 processedNodes.
Add(
this);
1608 <<
"RooAbsArg::optimizeCacheMode(" <<
GetName()
1609 <<
") integral depends on value of one or more observables and will be evaluated for every event"
1612 optimizedNodes.
add(*
this,
true);
1626 server->optimizeCacheMode(observables, optimizedNodes, processedNodes);
1639 coutI(Optimization) <<
"RooAbsArg::findConstantNodes(" <<
GetName() <<
"): components " << cacheList
1640 <<
" depend exclusively on constant parameters and will be precalculated and cached"
1657 if (processedNodes.
findArg(
this)) {
1660 processedNodes.
Add(
this);
1668 if (!param->isConstant()) {
1688 cxcoutD(Optimization) <<
"RooAbsArg::findConstantNodes(" <<
GetName()
1689 <<
") adding self to list of constant nodes" << std::endl;
1693 cacheList.
add(*
this,
false);
1701 if (server->isDerived()) {
1702 server->findConstantNodes(observables, cacheList, processedNodes);
1722 server->constOptimizeTestStatistic(opcode, doAlsoTrackingOpt);
1744 if (mode ==
ADirty && recurseADirty) {
1746 clientV->setOperMode(mode);
1759 std::ofstream ofs(filename);
1793 case Auto: os <<
" [Auto," << (
isValueDirty() ?
"Dirty" :
"Clean") <<
"] ";
break;
1794 case AClean: os <<
" [ACLEAN] ";
break;
1795 case ADirty: os <<
" [ADIRTY] ";
break;
1825 if (rmodel && rmodel->isConvolved())
1853 TString cleanName(rawBranchName);
1924 std::ofstream ofs(fileName);
1926 coutE(InputArguments) <<
"RooAbsArg::graphVizTree() ERROR: Cannot open graphViz output file with name "
1927 << fileName << std::endl;
1943 coutE(InputArguments)
1944 <<
"RooAbsArg::graphVizTree() ERROR: output stream provided as input argument is in invalid state"
1952 os <<
"digraph \"" <<
GetName() <<
"\"{" << std::endl;
1960 std::string nodeName = node->GetName();
1961 std::string nodeTitle = node->GetTitle();
1962 std::string nodeLabel = (useTitle && !nodeTitle.empty()) ? nodeTitle : nodeName;
1965 std::string::size_type position = nodeLabel.find(
'#');
1966 while (useLatex && position != nodeLabel.npos) {
1967 nodeLabel.replace(position, 1,
"\\");
1970 std::string typeFormat =
"\\texttt{";
1971 std::string nodeType = (useLatex) ? typeFormat + node->ClassName() +
"}" : node->ClassName();
1973 os <<
"\"" << nodeName <<
"\" [ color=" << (node->isFundamental() ?
"blue" :
"red") <<
", label=\"" << nodeType
1974 << delimiter << nodeLabel;
1976 if (
auto realNode =
dynamic_cast<RooAbsReal *
>(node)) {
1977 os << delimiter << realNode->getVal();
1980 os <<
"\"];" << std::endl;
1984 std::set<std::pair<RooAbsArg *, RooAbsArg *>> links;
1988 for (
auto const &link : links) {
1989 os <<
"\"" << link.first->GetName() <<
"\" -> \"" << link.second->GetName() <<
"\";" << std::endl;
1993 os <<
"}" << std::endl;
2003 linkSet.insert(std::make_pair(
this, server));
2004 server->graphVizAddConnections(linkSet);
2083 return Form(
"%s", suffix.c_str());
2090 for (
auto const &arg : branches) {
2120 ioReadStack().push(
this);
2122 ioReadStack().pop();
2132 ioEvoList()[newObj] = std::make_unique<TRefArray>(onfileProxyList);
2148 auto iter = ioEvoList().find(
this);
2149 if (iter != ioEvoList().end()) {
2153 _proxyList.Expand(iter->second->GetEntriesFast());
2154 for (
int i = 0; i < iter->second->GetEntriesFast(); i++) {
2158 ioEvoList().erase(iter);
2172 for (
const auto &iter : ioEvoList()) {
2175 if (!iter.first->_proxyList.GetEntriesFast())
2176 iter.first->_proxyList.Expand(iter.second->GetEntriesFast());
2177 for (
int i = 0; i < iter.second->GetEntriesFast(); i++) {
2178 iter.first->_proxyList.Add(iter.second->At(i));
2182 ioEvoList().clear();
2203 auto refArray = std::make_unique<TRefArray>();
2204 refArray->Streamer(R__b);
2209 if (!refArray->IsEmpty()) {
2210 ioEvoList()[ioReadStack().top()] = std::move(refArray);
2219 for (
TObject *tmpObj : *
this) {
2220 refArray.
Add(tmpObj);
2232 std::stringstream s;
2234 s <<
"An instance of " << raa->
ClassName() <<
".";
2246 for (
auto *server :
servers()) {
2247 server->applyWeightSquared(flag);
2251std::unique_ptr<RooAbsArg>
2254 auto newArg = std::unique_ptr<RooAbsArg>{
static_cast<RooAbsArg *
>(
Clone())};
2266 if (
_dataToken != std::numeric_limits<std::size_t>::max()) {
2267 std::stringstream errMsg;
2268 errMsg <<
"The data token for \"" <<
GetName() <<
"\" is already set!"
2269 <<
" Are you trying to evaluate the same object by multiple RooFit::Evaluator instances?"
2270 <<
" This is not allowed.";
2271 throw std::runtime_error(errMsg.str());
std::ostream & operator<<(std::ostream &os, RooAbsArg const &arg)
Ostream operator.
std::istream & operator>>(std::istream &is, RooAbsArg &arg)
Istream operator.
RooCollectionProxy< RooArgList > RooListProxy
RooCollectionProxy< RooArgSet > RooSetProxy
static Roo_reg_AGKInteg1D instance
int Int_t
Signed integer 4 bytes (int).
char Text_t
General string (char).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
const char Option_t
Option string (const char).
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
RooExpensiveObjectCache & expensiveObjectCache() const
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.
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
! Cached isConstant status
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
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.
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
std::map< std::string, std::string > _stringAttrib
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.
ProxyListCache _proxyListCache
! cache of the list of proxies. Avoids type casting.
bool recursiveRedirectServers(const RooAbsCollection &newSet, bool mustReplaceAll=false, bool nameChange=false, bool recurseInNewSet=true)
Recursively replace all servers with the new servers in newSet.
~RooAbsArg() override
Destructor.
void attachDataStore(const RooAbsDataStore &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
RooArgSet * _ownedComponents
! Set of owned component
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.
void setDataToken(std::size_t index)
Sets the token for retrieving results in the BatchMode. For internal use only.
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().
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.
bool isShapeDirty() const
static void ioStreamerPass2Finalize()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
friend class RooVectorDataStore
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 ¶ms, const RooArgSet *nset=nullptr, bool stripDisconnected=true) const
Add all parameters of the function and its daughters to params.
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...
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.
void SetName(const char *name) override
Set the name of the TNamed.
RooSTLRefCountList< RooAbsArg > RefCountList_t
std::set< std::string > _boolAttrib
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
RefCountList_t _clientListValue
bool addOwnedComponents(const RooAbsCollection &comps)
Take ownership of the contents of 'comps'.
void printAttribList(std::ostream &os) const
Print the attribute list.
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).
friend void RooRefArray::Streamer(TBuffer &)
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
bool _deleteWatch
! Delete watch flag
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 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.
static void setDirtyInhibit(bool flag)
Control global dirty inhibit mode.
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 ...
const TNamed * _namePtr
! De-duplicated name pointer, equal for all objects with the same name.
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
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
friend class RooRealIntegral
RooFit::OwningPtr< RooArgSet > getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
bool _prohibitServerRedirect
! Prohibit server redirects – Debugging tool
virtual const char * cacheUniqueSuffix() const
RefCountListLegacyIterator_t * makeLegacyIterator(const RefCountList_t &list) const
const RefCountList_t & servers() const
List of all servers of this object.
bool dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr) const
Check whether this object depends on values from an element in the serverList.
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.
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?
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.
virtual void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTrackingOpt=true)
Interface function signaling a request to perform constant term optimization.
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
static void verboseDirty(bool flag)
Activate verbose messaging related to dirty flag propagation.
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree).
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
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
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.
Int_t numProxies() const
Return the number of registered proxies.
void printName(std::ostream &os) const override
Print object name.
bool isValueDirty() const
friend class RooTreeDataStore
bool _localNoInhibitDirty
! Prevent 'AlwaysDirty' mode for this node
virtual void printMetaArgs(std::ostream &) const
virtual void applyWeightSquared(bool flag)
Disables or enables the usage of squared weights.
static bool _inhibitDirty
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.
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
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.
RefCountList_t _serverList
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
! Pointer to global cache manager for expensive components.
virtual bool isFundamental() const
Is this object a fundamental type that can be added to a dataset?
virtual bool isValid() const
WVE (08/21/01) Probably obsolete now.
std::set< std::string > _boolAttribTransient
! Transient boolean attributes (not copied in ctor)
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().
std::vector< RooAbsCache * > _cacheList
! list of caches
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)
Private helper function for RooAbsArg::redirectServers().
bool getTransientAttribute(const Text_t *name) const
Check if a named attribute is set.
virtual void operModeHook()
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.
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.
friend class RooAbsCollection
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
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...
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.
Abstract base class for data members of RooAbsArgs that cache other (composite) RooAbsArg expressions...
virtual void operModeHook()
Interface for operation mode changes.
virtual void findConstantNodes(const RooArgSet &, RooArgSet &, RooLinkedList &)
Interface for constant term node finding calls.
virtual void printCompactTreeHook(std::ostream &, const char *)
Interface for printing of cache guts in tree mode printing.
virtual bool redirectServersHook(const RooAbsCollection &, bool, bool, bool)
Interface for server redirect calls.
virtual void optimizeCacheMode(const RooArgSet &, RooArgSet &, RooLinkedList &)
Interface for processing of cache mode optimization calls.
Abstract container object that can hold multiple RooAbsArg objects.
RooAbsCollection * selectByAttrib(const char *name, bool value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
const char * GetName() const override
Returns name of object.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
void clear()
Clear contents. If the collection is owning, it will also delete the contents.
void sort(bool reverse=false)
Sort collection using std::sort and name comparison.
void setName(const char *name)
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for a data collection.
virtual const RooArgSet * get(Int_t index) const =0
Abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
Abstract interface for proxy classes.
virtual void print(std::ostream &os, bool addContents=false) const
Print proxy name.
virtual const char * name() const
virtual bool changePointer(const RooAbsCollection &newServerSet, bool nameChange=false, bool factoryInitMode=false)=0
RooArgList is a container object that can hold multiple RooAbsArg objects.
bool isShapeServer() const
Returns true if contents is shape server of owner.
RooAbsArg * absArg() const
Return pointer to contained argument.
bool isValueServer() const
Returns true of contents is value server of owner.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Represents a constant real-valued object.
Singleton class that serves as repository for objects that are expensive to calculate.
static RooExpensiveObjectCache & instance()
Return reference to singleton instance.
void markAsCompiled(RooAbsArg &arg) const
void compileServers(RooAbsArg &arg, RooArgSet const &normSet)
Switches the message service to a different level while the instance is alive.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
RooAbsArg * findArg(const RooAbsArg *) const
Return pointer to object with given name in collection.
virtual void Add(TObject *arg)
TObject * FindObject(const char *name) const override
Return pointer to object with given name.
Registry for const char* names.
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
static RooNameReg & instance()
Return reference to singleton instance.
static void incrementRenameCounter()
The renaming counter has to be incremented every time a RooAbsArg is renamed.
@ kRenamedArg
TNamed flag to indicate that some RooAbsArg has been renamed (flag set in new name).
virtual StyleOption defaultPrintStyle(Option_t *opt) const
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,...
virtual void printValue(std::ostream &os) const
Interface to print value of object.
Variable that can be changed from the outside.
TClass * IsA() const override
void Streamer(TBuffer &) override
Stream an object of class RooRefArray.
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
TObject()
TObject constructor.
An array of references to TObjects.
void Add(TObject *obj) override
void Streamer(TBuffer &) override
Stream all objects in the array to or from the I/O buffer.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Append(const char *cs)
A TTree represents a columnar dataset.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
RooAbsArg * cloneTreeWithSameParametersImpl(RooAbsArg const &arg, RooArgSet const *observables)