46 const RooCmdArg RooCmdArg::_none ;
52 const RooCmdArg& RooCmdArg::none()
61 RooCmdArg::RooCmdArg() : TNamed(
"",
"")
63 _procSubArgs = kFALSE ;
64 _prefixSubArgs = kTRUE ;
79 RooCmdArg::RooCmdArg(
const char* name, Int_t i1, Int_t i2, Double_t d1, Double_t d2,
80 const char* s1,
const char* s2,
const TObject* o1,
const TObject* o2,
81 const RooCmdArg* ca,
const char* s3,
const RooArgSet* c1,
const RooArgSet* c2) :
91 _o[0] = (TObject*) o1 ;
92 _o[1] = (TObject*) o2 ;
95 if (c1||c2) _c =
new RooArgSet[2] ;
96 if (c1) _c[0].add(*c1) ;
97 if (c2) _c[1].add(*c2) ;
99 _procSubArgs = kTRUE ;
100 _prefixSubArgs = kTRUE ;
102 _argList.Add(
new RooCmdArg(*ca)) ;
111 RooCmdArg::RooCmdArg(
const RooCmdArg& other) :
114 _i[0] = other._i[0] ;
115 _i[1] = other._i[1] ;
116 _d[0] = other._d[0] ;
117 _d[1] = other._d[1] ;
118 _s[0] = other._s[0] ;
119 _s[1] = other._s[1] ;
120 _s[2] = other._s[2] ;
121 _o[0] = other._o[0] ;
122 _o[1] = other._o[1] ;
124 _c =
new RooArgSet[2] ;
125 _c[0].add(other._c[0]) ;
126 _c[1].add(other._c[1]) ;
131 _procSubArgs = other._procSubArgs ;
132 _prefixSubArgs = other._prefixSubArgs ;
133 for (Int_t i=0 ; i<other._argList.GetSize() ; i++) {
134 _argList.Add(
new RooCmdArg((RooCmdArg&)*other._argList.At(i))) ;
142 RooCmdArg& RooCmdArg::operator=(
const RooCmdArg& other)
144 if (&other==
this)
return *this ;
146 SetName(other.GetName()) ;
147 SetTitle(other.GetTitle()) ;
149 _i[0] = other._i[0] ;
150 _i[1] = other._i[1] ;
151 _d[0] = other._d[0] ;
152 _d[1] = other._d[1] ;
153 _s[0] = other._s[0] ;
154 _s[1] = other._s[1] ;
155 _s[2] = other._s[2] ;
156 _o[0] = other._o[0] ;
157 _o[1] = other._o[1] ;
158 if (!_c) _c =
new RooArgSet[2] ;
160 _c[0].removeAll() ; _c[0].add(other._c[0]) ;
161 _c[1].removeAll() ; _c[1].add(other._c[1]) ;
164 _procSubArgs = other._procSubArgs ;
165 _prefixSubArgs = other._prefixSubArgs ;
167 for (Int_t i=0 ; i<other._argList.GetSize() ; i++) {
168 _argList.Add(
new RooCmdArg((RooCmdArg&)*other._argList.At(i))) ;
179 RooCmdArg::~RooCmdArg()
182 if (_c)
delete[] _c ;
190 void RooCmdArg::addArg(
const RooCmdArg& arg)
192 _argList.Add(
new RooCmdArg(arg)) ;
200 const RooArgSet* RooCmdArg::getSet(Int_t idx)
const {
201 return _c ? &_c[idx] : 0 ;
208 void RooCmdArg::setSet(Int_t idx,
const RooArgSet& set)
211 _c =
new RooArgSet[2] ;
213 _c[idx].removeAll() ;
220 void RooCmdArg::Print(
const char*)
const {
221 std::cout << GetName()
222 <<
":\ndoubles\t" << _d[0] <<
" " << _d[1]
223 <<
"\nints\t" << _i[0] <<
" " << _i[1]
224 <<
"\nstrings\t" << _s[0] <<
" " << _s[1] <<
" " << _s[2]
225 <<
"\nobjects\t" << _o[0] <<
" " << _o[1] << std::endl;