00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef ROO_CMD_ARG
00018 #define ROO_CMD_ARG
00019
00020 #include <string>
00021 #include "TNamed.h"
00022 #include "TString.h"
00023 #include "RooLinkedList.h"
00024 class RooAbsData ;
00025 class RooArgSet ;
00026
00027 class RooCmdArg : public TNamed {
00028 public:
00029
00030 RooCmdArg();
00031 RooCmdArg(const char* name,
00032 Int_t i1=0, Int_t i2=0,
00033 Double_t d1=0, Double_t d2=0,
00034 const char* s1=0, const char* s2=0,
00035 const TObject* o1=0, const TObject* o2=0, const RooCmdArg* ca=0, const char* s3=0,
00036 const RooArgSet* c1=0, const RooArgSet* c2=0) ;
00037 RooCmdArg(const RooCmdArg& other) ;
00038 RooCmdArg& operator=(const RooCmdArg& other) ;
00039 void addArg(const RooCmdArg& arg) ;
00040 void setProcessRecArgs(Bool_t flag, Bool_t prefix=kTRUE) {
00041
00042 _procSubArgs = flag ;
00043 _prefixSubArgs = prefix ;
00044 }
00045
00046 RooLinkedList& subArgs() {
00047
00048 return _argList ;
00049 }
00050
00051 virtual TObject* Clone(const char* newName=0) const {
00052 RooCmdArg* newarg = new RooCmdArg(*this) ;
00053 if (newName) { newarg->SetName(newName) ; }
00054 return newarg ;
00055 }
00056
00057 virtual ~RooCmdArg();
00058
00059 static const RooCmdArg& none() ;
00060
00061 const char* opcode() const {
00062
00063 return strlen(GetName()) ? GetName() : 0 ;
00064 }
00065
00066 void setInt(Int_t idx,Int_t value) {
00067 _i[idx] = value ;
00068 }
00069 void setDouble(Int_t idx,Double_t value) {
00070 _d[idx] = value ;
00071 }
00072 void setString(Int_t idx,const char* value) {
00073 _s[idx] = value ;
00074 }
00075 void setObject(Int_t idx,TObject* value) {
00076 _o[idx] = value ;
00077 }
00078 void setSet(Int_t idx,const RooArgSet& set) ;
00079
00080 Int_t getInt(Int_t idx) const {
00081
00082 return _i[idx] ;
00083 }
00084 Double_t getDouble(Int_t idx) const {
00085
00086 return _d[idx] ;
00087 }
00088 const char* getString(Int_t idx) const {
00089
00090 return (_s[idx].size()>0) ? _s[idx].c_str() : 0 ;
00091 }
00092 const TObject* getObject(Int_t idx) const {
00093
00094 return _o[idx] ;
00095 }
00096
00097 const RooArgSet* getSet(Int_t idx) const ;
00098
00099 protected:
00100
00101 static const RooCmdArg _none ;
00102 friend class RooCmdConfig ;
00103
00104 private:
00105
00106 friend class RooAbsCollection ;
00107
00108
00109 Double_t _d[2] ;
00110 Int_t _i[2] ;
00111 std::string _s[3] ;
00112 TObject* _o[2] ;
00113 Bool_t _procSubArgs ;
00114 RooArgSet* _c ;
00115 RooLinkedList _argList ;
00116 Bool_t _prefixSubArgs ;
00117
00118 ClassDef(RooCmdArg,2)
00119 };
00120
00121 #endif
00122
00123