#ifndef ROO_ABS_ARG
#define ROO_ABS_ARG
#include <assert.h>
#include "TNamed.h"
#include "THashList.h"
#include "RooPrintable.h"
#include "RooRefCountList.h"
#include "RooAbsCache.h"
#include <map>
#include <set>
#include <deque>
class TTree ;
class RooArgSet ;
class RooAbsCollection ;
class RooTreeData ;
class RooAbsData ;
class RooAbsProxy ;
class RooArgProxy ;
class RooSetProxy ;
class RooListProxy ;
class RooExpensiveObjectCache ;
class RooAbsArg : public TNamed, public RooPrintable {
public:
RooAbsArg() ;
virtual ~RooAbsArg();
RooAbsArg(const char *name, const char *title);
RooAbsArg(const RooAbsArg& other, const char* name=0) ;
virtual TObject* clone(const char* newname) const = 0 ;
virtual TObject* Clone(const char* newname=0) const {
return clone(newname?newname:GetName()) ;
}
virtual RooAbsArg* cloneTree(const char* newname=0) const ;
virtual Bool_t isDerived() const {
return _serverList.GetSize()?kTRUE:kFALSE;
}
Bool_t isCloneOf(const RooAbsArg& other) const ;
Bool_t dependsOnValue(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg=0) const {
return dependsOn(serverList,ignoreArg,kTRUE) ;
}
Bool_t dependsOnValue(const RooAbsArg& server, const RooAbsArg* ignoreArg=0) const {
return dependsOn(server,ignoreArg,kTRUE) ;
}
Bool_t dependsOn(const RooAbsCollection& serverList, const RooAbsArg* ignoreArg=0, Bool_t valueOnly=kFALSE) const ;
Bool_t dependsOn(const RooAbsArg& server, const RooAbsArg* ignoreArg=0, Bool_t valueOnly=kFALSE) const ;
Bool_t overlaps(const RooAbsArg& testArg) const ;
inline TIterator* clientIterator() const {
return _clientList.MakeIterator() ;
}
inline TIterator* valueClientIterator() const {
return _clientListValue.MakeIterator() ;
}
inline TIterator* shapeClientIterator() const {
return _clientListShape.MakeIterator() ;
}
inline TIterator* serverIterator() const {
return _serverList.MakeIterator() ;
}
inline RooAbsArg* findServer(const char *name) const {
return (RooAbsArg*)_serverList.FindObject(name);
}
inline RooAbsArg* findServer(const RooAbsArg& arg) const {
return (RooAbsArg*)_serverList.FindObject(&arg);
}
inline RooAbsArg* findServer(Int_t index) const {
return (RooAbsArg*)_serverList.At(index);
}
inline Bool_t isValueServer(const RooAbsArg& arg) const {
return _clientListValue.FindObject(&arg)?kTRUE:kFALSE ;
}
inline Bool_t isValueServer(const char* name) const {
return _clientListValue.FindObject(name)?kTRUE:kFALSE ;
}
inline Bool_t isShapeServer(const RooAbsArg& arg) const {
return _clientListShape.FindObject(&arg)?kTRUE:kFALSE ;
}
inline Bool_t isShapeServer(const char* name) const {
return _clientListShape.FindObject(name)?kTRUE:kFALSE ;
}
void leafNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=0, Bool_t recurseNonDerived=kFALSE) const ;
void branchNodeServerList(RooAbsCollection* list, const RooAbsArg* arg=0, Bool_t recurseNonDerived=kFALSE) const ;
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 ;
inline virtual Bool_t isFundamental() const {
return kFALSE;
}
virtual RooAbsArg *createFundamental(const char* newname=0) const = 0;
inline virtual Bool_t isLValue() const {
return kFALSE;
}
friend class RooProdPdf ;
friend class RooAddPdf ;
friend class RooAddPdfOrig ;
RooArgSet* getVariables() const ;
RooArgSet* getParameters(const RooAbsData* data) const ;
RooArgSet* getParameters(const RooAbsData& data) const {
return getParameters(&data) ;
}
RooArgSet* getParameters(const RooArgSet& set) const {
return getParameters(&set) ;
}
virtual RooArgSet* getParameters(const RooArgSet* depList) const ;
RooArgSet* getObservables(const RooArgSet& set) const {
return getObservables(&set) ;
}
RooArgSet* getObservables(const RooAbsData* data) const ;
RooArgSet* getObservables(const RooAbsData& data) const {
return getObservables(&data) ;
}
virtual RooArgSet* getObservables(const RooArgSet* depList) const ;
Bool_t observableOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const ;
Bool_t observableOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const ;
virtual Bool_t checkObservables(const RooArgSet* nset) const ;
Bool_t recursiveCheckObservables(const RooArgSet* nset) const ;
RooArgSet* getComponents() const ;
inline RooArgSet* getDependents(const RooArgSet& set) const { return getObservables(set) ; }
inline RooArgSet* getDependents(const RooAbsData* set) const { return getObservables(set) ; }
inline RooArgSet* getDependents(const RooArgSet* depList) const { return getObservables(depList) ; }
inline Bool_t dependentOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const { return observableOverlaps(dset,testArg) ; }
inline Bool_t dependentOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const { return observableOverlaps(depList, testArg) ; }
inline Bool_t checkDependents(const RooArgSet* nset) const { return checkObservables(nset) ; }
inline Bool_t recursiveCheckDependents(const RooArgSet* nset) const { return recursiveCheckObservables(nset) ; }
void attachDataSet(const RooAbsData &set);
virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) = 0 ;
virtual void writeToStream(ostream& os, Bool_t compact) const = 0 ;
inline virtual void Print(Option_t *options= 0) const {
printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
}
virtual void printName(ostream& os) const ;
virtual void printTitle(ostream& os) const ;
virtual void printClassName(ostream& os) const ;
virtual void printAddress(ostream& os) const ;
virtual void printArgs(ostream& os) const ;
virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
virtual void printTree(ostream& os, TString indent="") const ;
virtual Int_t defaultPrintContents(Option_t* opt) const ;
void setAttribute(const Text_t* name, Bool_t value=kTRUE) ;
Bool_t getAttribute(const Text_t* name) const ;
inline const std::set<std::string>& attributes() const {
return _boolAttrib ;
}
void setStringAttribute(const Text_t* key, const Text_t* value) ;
const Text_t* getStringAttribute(const Text_t* key) const ;
inline const std::map<std::string,std::string>& stringAttributes() const {
return _stringAttrib ;
}
void setTransientAttribute(const Text_t* name, Bool_t value=kTRUE) ;
Bool_t getTransientAttribute(const Text_t* name) const ;
inline const std::set<std::string>& transientAttributes() const {
return _boolAttribTransient ;
}
inline Bool_t isConstant() const {
return getAttribute("Constant") ;
}
RooLinkedList getCloningAncestors() const ;
Int_t Compare(const TObject* other) const ;
virtual Bool_t IsSortable() const {
return kTRUE ;
}
static void verboseDirty(Bool_t flag) ;
static void copyList(TList& dest, const TList& source) ;
void printDirty(Bool_t depth=kTRUE) const ;
static void setDirtyInhibit(Bool_t flag) ;
static void setACleanADirty(Bool_t flag) ;
virtual Bool_t operator==(const RooAbsArg& other) = 0 ;
virtual Bool_t inRange(const char*) const {
return kTRUE ;
}
virtual Bool_t hasRange(const char*) const {
return kFALSE ;
}
enum ConstOpCode { Activate=0, DeActivate=1, ConfigChange=2, ValueChange=3 } ;
friend class RooMinuit ;
virtual void optimizeCacheMode(const RooArgSet& observables) ;
virtual void optimizeCacheMode(const RooArgSet& observables, RooArgSet& optNodes, RooLinkedList& processedNodes) ;
Bool_t findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList) ;
Bool_t findConstantNodes(const RooArgSet& observables, RooArgSet& cacheList, RooLinkedList& processedNodes) ;
virtual void constOptimizeTestStatistic(ConstOpCode opcode) ;
void graphVizTree(const char* fileName) ;
void graphVizTree(ostream& os) ;
void printCompactTree(const char* indent="",const char* fileName=0, const char* namePat=0, RooAbsArg* client=0) ;
void printCompactTree(ostream& os, const char* indent="", const char* namePat=0, RooAbsArg* client=0) ;
virtual void printCompactTreeHook(ostream& os, const char *ind="") ;
inline Bool_t isShapeDirty() const {
return isDerived()?_shapeDirty:kFALSE ;
}
inline Bool_t isValueDirty() const {
if (inhibitDirty()) return kTRUE ;
switch(_operMode) {
case AClean: return flipAClean() ;
case ADirty: return kTRUE ;
case Auto: return (isDerived()?_valueDirty:kFALSE) ;
}
return kTRUE ;
}
void registerCache(RooAbsCache& cache) ;
void unRegisterCache(RooAbsCache& cache) ;
Int_t numCaches() const ;
RooAbsCache* getCache(Int_t index) const ;
enum OperMode { Auto=0, AClean=1, ADirty=2 } ;
inline OperMode operMode() const { return _operMode==AClean ? (flipAClean() ? ADirty : AClean ) : _operMode ; }
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE) ;
static UInt_t crc32(const char* data) ;
Bool_t addOwnedComponents(const RooArgSet& comps) ;
const RooArgSet* ownedComponents() const { return _ownedComponents ; }
void setProhibitServerRedirect(Bool_t flag) { _prohibitServerRedirect = flag ; }
protected:
void graphVizAddConnections(std::set<std::pair<RooAbsArg*,RooAbsArg*> >&) ;
friend class RooExtendPdf ;
friend class RooRealIntegral ;
friend class RooAbsReal ;
friend class RooProjectedPdf ;
virtual void operModeHook() {} ;
virtual void optimizeDirtyHook(const RooArgSet* ) {} ;
virtual Bool_t isValid() const ;
virtual void getParametersHook(const RooArgSet* , RooArgSet* ) const {} ;
virtual void getObservablesHook(const RooArgSet* , RooArgSet* ) const {} ;
public:
inline void setValueDirty() const { setValueDirty(0) ; }
inline void setShapeDirty() const { setShapeDirty(0) ; }
inline void clearValueDirty() const {
_valueDirty=kFALSE ;
}
inline void clearShapeDirty() const {
_shapeDirty=kFALSE ;
}
protected:
friend class RooArgSet ;
friend class RooAbsCollection ;
friend class RooCustomizer ;
friend class RooWorkspace ;
RooRefCountList _serverList ;
RooRefCountList _clientList ;
RooRefCountList _clientListShape ;
RooRefCountList _clientListValue ;
TList _proxyList ;
std::deque<RooAbsCache*> _cacheList ;
TIterator* _clientShapeIter ;
TIterator* _clientValueIter ;
public:
Bool_t redirectServers(const RooAbsCollection& newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE) ;
Bool_t recursiveRedirectServers(const RooAbsCollection& newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE) ;
virtual Bool_t redirectServersHook(const RooAbsCollection& , Bool_t , Bool_t , Bool_t ) { return kFALSE ; } ;
virtual void serverNameChangeHook(const RooAbsArg* , const RooAbsArg* ) { } ;
void addServer(RooAbsArg& server, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE) ;
void addServerList(RooAbsCollection& serverList, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE) ;
void replaceServer(RooAbsArg& oldServer, RooAbsArg& newServer, Bool_t valueProp, Bool_t shapeProp) ;
void changeServer(RooAbsArg& server, Bool_t valueProp, Bool_t shapeProp) ;
void removeServer(RooAbsArg& server, Bool_t force=kFALSE) ;
RooAbsArg *findNewServer(const RooAbsCollection &newSet, Bool_t nameChange) const;
protected:
friend class RooAddModel ;
friend class RooArgProxy ;
friend class RooSetProxy ;
friend class RooListProxy ;
void registerProxy(RooArgProxy& proxy) ;
void registerProxy(RooSetProxy& proxy) ;
void registerProxy(RooListProxy& proxy) ;
void unRegisterProxy(RooArgProxy& proxy) ;
void unRegisterProxy(RooSetProxy& proxy) ;
void unRegisterProxy(RooListProxy& proxy) ;
RooAbsProxy* getProxy(Int_t index) const ;
void setProxyNormSet(const RooArgSet* nset) ;
Int_t numProxies() const ;
std::set<std::string> _boolAttrib ;
std::map<std::string,std::string> _stringAttrib ;
std::set<std::string> _boolAttribTransient ;
void printAttribList(ostream& os) const;
friend class RooTreeData ;
friend class RooDataSet ;
friend class RooRealMPFE ;
virtual void syncCache(const RooArgSet* nset=0) = 0 ;
virtual void copyCache(const RooAbsArg* source) = 0 ;
virtual void attachToTree(TTree& t, Int_t bufSize=32000) = 0 ;
virtual void setTreeBranchStatus(TTree& t, Bool_t active) = 0 ;
virtual void fillTreeBranch(TTree& t) = 0 ;
TString cleanBranchName() const ;
friend ostream& operator<<(ostream& os, const RooAbsArg &arg);
friend istream& operator>>(istream& is, RooAbsArg &arg) ;
static Bool_t _verboseDirty ;
static Bool_t _inhibitDirty ;
static Bool_t _flipAClean ;
Bool_t _deleteWatch ;
static Bool_t flipAClean() ;
static Bool_t inhibitDirty() ;
void setValueDirty(const RooAbsArg* source) const ;
void setShapeDirty(const RooAbsArg* source) const ;
mutable Bool_t _valueDirty ;
mutable Bool_t _shapeDirty ;
mutable OperMode _operMode ;
RooArgSet* _ownedComponents ;
mutable Bool_t _prohibitServerRedirect ;
void setExpensiveObjectCache(RooExpensiveObjectCache& cache) { _eocache = &cache ; }
RooExpensiveObjectCache& expensiveObjectCache() const ;
mutable RooExpensiveObjectCache* _eocache ;
ClassDef(RooAbsArg,4)
};
ostream& operator<<(ostream& os, const RooAbsArg &arg);
istream& operator>>(istream& is, RooAbsArg &arg) ;
#endif
Last change: Mon Dec 15 13:02:44 2008
Last generated: 2008-12-15 13:02
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.