Logo ROOT  
Reference Guide
RooCmdConfig.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
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
17
18/**
19\file RooCmdConfig.cxx
20\class RooCmdConfig
21\ingroup Roofitcore
22
23Class RooCmdConfig is a configurable parser for RooCmdArg named
24arguments. It maps the contents of named arguments named to integers,
25doubles, strings and TObjects that can be retrieved after processing
26a set of RooCmdArgs. The parser also has options to enforce syntax
27rules such as (conditionally) required arguments, mutually exclusive
28arguments and dependencies between arguments
29**/
30
31#include <RooCmdConfig.h>
32#include <RooMsgService.h>
33
34#include <ROOT/StringUtils.hxx>
35
36#include <iostream>
37
38
39namespace {
40
41template<class Collection>
42typename Collection::const_iterator findVar(Collection const& coll, const char * name) {
43 return std::find_if(coll.begin(), coll.end(), [name](auto const& v){ return v.name == name; });
44}
45
46}
47
48
49using namespace std;
50
52
53
54////////////////////////////////////////////////////////////////////////////////
55/// Constructor taking descriptive name of owner/user which
56/// is used as prefix for any warning or error messages
57/// generated by this parser
58
59RooCmdConfig::RooCmdConfig(const char* methodName) :
60 TObject(),
61 _name(methodName)
62{
68}
69
70
71namespace {
72
73void cloneList(TList const& inList, TList & outList) {
74 outList.SetOwner(true);
75 std::unique_ptr<TIterator> iter{inList.MakeIterator()} ;
76 while(auto elem = iter->Next()) {
77 outList.Add(elem->Clone()) ;
78 }
79}
80
81} // namespace
82
83
84////////////////////////////////////////////////////////////////////////////////
85/// Copy constructor
86
88 : TObject(other), _iList(other._iList), _dList(other._dList),
89 _sList(other._sList), _oList(other._oList), _cList(other._cList)
90{
91 _name = other._name ;
92 _verbose = other._verbose ;
93 _error = other._error ;
95
96 cloneList(other._rList, _rList); // Required cmd list
97 cloneList(other._fList, _fList); // Forbidden cmd list
98 cloneList(other._mList, _mList); // Mutex cmd list
99 cloneList(other._yList, _yList); // Dependency cmd list
100 cloneList(other._pList, _pList); // Processed cmd list
101}
102
103
104
105////////////////////////////////////////////////////////////////////////////////
106/// Return string with names of arguments that were required, but not
107/// processed
108
109std::string RooCmdConfig::missingArgs() const
110{
111 std::string ret = "";
112
113 bool first = true;
114 std::unique_ptr<TIterator> iter{_rList.MakeIterator()};
115 while(auto const& s = iter->Next()) {
116 if (first) {
117 first=kFALSE ;
118 } else {
119 ret += ", ";
120 }
121 ret += static_cast<TObjString*>(s)->String();
122 }
123
124 return ret;
125}
126
127
128
129////////////////////////////////////////////////////////////////////////////////
130/// Define that processing argument name refArgName requires processing
131/// of argument named neededArgName to successfully complete parsing
132
133void RooCmdConfig::defineDependency(const char* refArgName, const char* neededArgName)
134{
135 _yList.Add(new TNamed(refArgName,neededArgName)) ;
136}
137
138
139
140////////////////////////////////////////////////////////////////////////////////
141/// Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName
142/// Define default value for this int property to be defVal in case named argument is not processed
143
144Bool_t RooCmdConfig::defineInt(const char* name, const char* argName, Int_t intNum, Int_t defVal)
145{
146 if (findVar(_iList, name) != _iList.end()) {
147 coutE(InputArguments) << "RooCmdConfig::defintInt: name '" << name << "' already defined" << endl ;
148 return kTRUE ;
149 }
150
151 _iList.emplace_back();
152 auto& ri = _iList.back();
153 ri.name = name;
154 ri.argName = argName;
155 ri.val = defVal;
156 ri.num = intNum;
157 return kFALSE ;
158}
159
160
161
162////////////////////////////////////////////////////////////////////////////////
163/// Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name argName
164/// Define default value for this Double_t property to be defVal in case named argument is not processed
165
166Bool_t RooCmdConfig::defineDouble(const char* name, const char* argName, Int_t doubleNum, Double_t defVal)
167{
168 if (findVar(_dList, name) != _dList.end()) {
169 coutE(InputArguments) << "RooCmdConfig::defineDouble: name '" << name << "' already defined" << endl ;
170 return kTRUE ;
171 }
172
173 _dList.emplace_back();
174 auto& rd = _dList.back();
175 rd.name = name;
176 rd.argName = argName;
177 rd.val = defVal;
178 rd.num = doubleNum;
179 return kFALSE ;
180}
181
182
183
184////////////////////////////////////////////////////////////////////////////////
185/// Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name argName
186/// Define default value for this Double_t property to be defVal in case named argument is not processed
187/// If appendMode is true, values found in multiple matching RooCmdArg arguments will be concatenated
188/// in the output string. If it is false, only the value of the last processed instance is retained
189
190Bool_t RooCmdConfig::defineString(const char* name, const char* argName, Int_t stringNum, const char* defVal, Bool_t appendMode)
191{
192 if (findVar(_sList, name) != _sList.end()) {
193 coutE(InputArguments) << "RooCmdConfig::defineString: name '" << name << "' already defined" << endl ;
194 return kTRUE ;
195 }
196
197 _sList.emplace_back();
198 auto& rs = _sList.back();
199 rs.name = name;
200 rs.argName = argName;
201 rs.val = defVal;
202 rs.appendMode = appendMode;
203 rs.num = stringNum;
204 return kFALSE ;
205}
206
207
208
209////////////////////////////////////////////////////////////////////////////////
210/// Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName
211/// Define default value for this TObject property to be defVal in case named argument is not processed.
212/// If isArray is true, an array of TObjects is harvested in case multiple matching named arguments are processed.
213/// If isArray is false, only the TObject in the last processed named argument is retained
214
215Bool_t RooCmdConfig::defineObject(const char* name, const char* argName, Int_t setNum, const TObject* defVal, Bool_t isArray)
216{
217
218 if (findVar(_oList, name) != _oList.end()) {
219 coutE(InputArguments) << "RooCmdConfig::defineObject: name '" << name << "' already defined" << endl ;
220 return kTRUE ;
221 }
222
223 _oList.emplace_back();
224 auto& os = _oList.back();
225 os.name = name;
226 os.argName = argName;
227 os.val.Add(const_cast<TObject*>(defVal));
228 os.appendMode = isArray;
229 os.num = setNum;
230 return kFALSE ;
231}
232
233
234
235////////////////////////////////////////////////////////////////////////////////
236/// Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName
237/// Define default value for this TObject property to be defVal in case named argument is not processed.
238/// If isArray is true, an array of TObjects is harvested in case multiple matching named arguments are processed.
239/// If isArray is false, only the TObject in the last processed named argument is retained
240
241Bool_t RooCmdConfig::defineSet(const char* name, const char* argName, Int_t setNum, const RooArgSet* defVal)
242{
243
244 if (findVar(_cList, name) != _cList.end()) {
245 coutE(InputArguments) << "RooCmdConfig::defineObject: name '" << name << "' already defined" << endl ;
246 return kTRUE ;
247 }
248
249 _cList.emplace_back();
250 auto& cs = _cList.back();
251 cs.name = name;
252 cs.argName = argName;
253 cs.val = const_cast<RooArgSet*>(defVal);
254 cs.num = setNum;
255 return kFALSE ;
256}
257
258
259
260////////////////////////////////////////////////////////////////////////////////
261/// Print configuration of parser
262
264{
265 // Find registered integer fields for this opcode
266 for(auto const& ri : _iList) {
267 cout << ri.name << "[Int_t] = " << ri.val << endl ;
268 }
269
270 // Find registered double fields for this opcode
271 for(auto const& rd : _dList) {
272 cout << rd.name << "[Double_t] = " << rd.val << endl ;
273 }
274
275 // Find registered string fields for this opcode
276 for(auto const& rs : _sList) {
277 cout << rs.name << "[string] = \"" << rs.val << "\"" << endl ;
278 }
279
280 // Find registered argset fields for this opcode
281 for(auto const& ro : _oList) {
282 cout << ro.name << "[TObject] = " ;
283 auto const * obj = ro.val.At(0);
284 if (obj) {
285 cout << obj->GetName() << endl ;
286 } else {
287
288 cout << "(null)" << endl ;
289 }
290 }
291}
292
293
294
295////////////////////////////////////////////////////////////////////////////////
296/// Process given list with RooCmdArgs
297
299{
300 Bool_t ret(kFALSE) ;
301 for(auto * arg : static_range_cast<RooCmdArg*>(argList)) {
302 ret |= process(*arg) ;
303 }
304 return ret ;
305}
306
307
308
309////////////////////////////////////////////////////////////////////////////////
310/// Process given RooCmdArg
311
313{
314 // Retrive command code
315 const char* opc = arg.opcode() ;
316
317 // Ignore empty commands
318 if (!opc) return kFALSE ;
319
320 // Check if not forbidden
321 if (_fList.FindObject(opc)) {
322 coutE(InputArguments) << _name << " ERROR: argument " << opc << " not allowed in this context" << endl ;
323 _error = kTRUE ;
324 return kTRUE ;
325 }
326
327 // Check if this code generates any dependencies
328 TObject* dep = _yList.FindObject(opc) ;
329 if (dep) {
330 // Dependent command found, add to required list if not already processed
331 if (!_pList.FindObject(dep->GetTitle())) {
332 _rList.Add(new TObjString(dep->GetTitle())) ;
333 if (_verbose) {
334 cout << "RooCmdConfig::process: " << opc << " has unprocessed dependent " << dep->GetTitle()
335 << ", adding to required list" << endl ;
336 }
337 } else {
338 if (_verbose) {
339 cout << "RooCmdConfig::process: " << opc << " dependent " << dep->GetTitle() << " is already processed" << endl ;
340 }
341 }
342 }
343
344 // Check for mutexes
345 TObject * mutex = _mList.FindObject(opc) ;
346 if (mutex) {
347 if (_verbose) {
348 cout << "RooCmdConfig::process: " << opc << " excludes " << mutex->GetTitle()
349 << ", adding to forbidden list" << endl ;
350 }
351 _fList.Add(new TObjString(mutex->GetTitle())) ;
352 }
353
354
355 Bool_t anyField(kFALSE) ;
356
357 // Find registered integer fields for this opcode
358 for(auto& ri : _iList) {
359 if (!TString(opc).CompareTo(ri.argName)) {
360 ri.val = arg.getInt(ri.num) ;
361 anyField = kTRUE ;
362 if (_verbose) {
363 cout << "RooCmdConfig::process " << ri.name << "[Int_t]" << " set to " << ri.val << endl ;
364 }
365 }
366 }
367
368 // Find registered double fields for this opcode
369 for(auto& rd : _dList) {
370 if (!TString(opc).CompareTo(rd.argName)) {
371 rd.val = arg.getDouble(rd.num) ;
372 anyField = kTRUE ;
373 if (_verbose) {
374 cout << "RooCmdConfig::process " << rd.name << "[Double_t]" << " set to " << rd.val << endl ;
375 }
376 }
377 }
378
379 // Find registered string fields for this opcode
380 for(auto& rs : _sList) {
381 if (rs.argName == opc) {
382
383 // RooCmdArg::getString can return nullptr, so we have to protect against this
384 auto const * newStr = arg.getString(rs.num);
385
386 if (!rs.val.empty() && rs.appendMode) {
387 rs.val += ",";
388 rs.val += newStr ? newStr : "(null)";
389 } else {
390 if(newStr) rs.val = newStr;
391 }
392 anyField = kTRUE ;
393 if (_verbose) {
394 std::cout << "RooCmdConfig::process " << rs.name << "[string]" << " set to " << rs.val << std::endl ;
395 }
396 }
397 }
398
399 // Find registered TObject fields for this opcode
400 for(auto& os : _oList) {
401 if (!TString(opc).CompareTo(os.argName)) {
402 if(!os.appendMode) os.val.Clear();
403 os.val.Add(const_cast<TObject*>(arg.getObject(os.num)));
404 anyField = kTRUE ;
405 if (_verbose) {
406 cout << "RooCmdConfig::process " << os.name << "[TObject]" << " set to " ;
407 if (os.val.At(0)) {
408 cout << os.val.At(0)->GetName() << endl ;
409 } else {
410 cout << "(null)" << endl ;
411 }
412 }
413 }
414 }
415
416 // Find registered RooArgSet fields for this opcode
417 for(auto& cs : _cList) {
418 if (!TString(opc).CompareTo(cs.argName)) {
419 cs.val = const_cast<RooArgSet*>(arg.getSet(cs.num));
420 anyField = kTRUE ;
421 if (_verbose) {
422 cout << "RooCmdConfig::process " << cs.name << "[RooArgSet]" << " set to " ;
423 if (cs.val) {
424 cout << cs.val->GetName() << endl ;
425 } else {
426 cout << "(null)" << endl ;
427 }
428 }
429 }
430 }
431
432 Bool_t multiArg = !TString("MultiArg").CompareTo(opc) ;
433
434 if (!anyField && !_allowUndefined && !multiArg) {
435 coutE(InputArguments) << _name << " ERROR: unrecognized command: " << opc << endl ;
436 }
437
438
439 // Remove command from required-args list (if it was there)
440 TObject* obj;
441 while ( (obj = _rList.FindObject(opc)) ) {
442 _rList.Remove(obj);
443 }
444
445 // Add command the processed list
446 TNamed *pcmd = new TNamed(opc,opc) ;
447 _pList.Add(pcmd) ;
448
449 Bool_t depRet = kFALSE ;
450 if (arg.procSubArgs()) {
451 for (Int_t ia=0 ; ia<arg.subArgs().GetSize() ; ia++) {
452 RooCmdArg* subArg = static_cast<RooCmdArg*>(arg.subArgs().At(ia)) ;
453 if (strlen(subArg->GetName())>0) {
454 RooCmdArg subArgCopy(*subArg) ;
455 if (arg.prefixSubArgs()) {
456 subArgCopy.SetName(Form("%s::%s",arg.GetName(),subArg->GetName())) ;
457 }
458 depRet |= process(subArgCopy) ;
459 }
460 }
461 }
462
463 return ((anyField||_allowUndefined)?kFALSE:kTRUE)||depRet ;
464}
465
466
467
468////////////////////////////////////////////////////////////////////////////////
469/// Return true if RooCmdArg with name 'cmdName' has been processed
470
471Bool_t RooCmdConfig::hasProcessed(const char* cmdName) const
472{
473 return _pList.FindObject(cmdName) ? kTRUE : kFALSE ;
474}
475
476
477
478////////////////////////////////////////////////////////////////////////////////
479/// Return integer property registered with name 'name'. If no
480/// property is registered, return defVal
481
483{
484 auto found = findVar(_iList, name);
485 return found != _iList.end() ? found->val : defVal;
486}
487
488
489
490////////////////////////////////////////////////////////////////////////////////
491/// Return Double_t property registered with name 'name'. If no
492/// property is registered, return defVal
493
495{
496 auto found = findVar(_dList, name);
497 return found != _dList.end() ? found->val : defVal;
498}
499
500
501
502////////////////////////////////////////////////////////////////////////////////
503/// Return string property registered with name 'name'. If no
504/// property is registered, return defVal. If convEmptyToNull
505/// is true, empty string will be returned as null pointers
506
507const char* RooCmdConfig::getString(const char* name, const char* defVal, Bool_t convEmptyToNull)
508{
509 auto found = findVar(_sList, name);
510 if(found == _sList.end()) return defVal;
511 return (convEmptyToNull && found->val.empty()) ? nullptr : found->val.c_str();
512}
513
514
515
516////////////////////////////////////////////////////////////////////////////////
517/// Return TObject property registered with name 'name'. If no
518/// property is registered, return defVal
519
521{
522 auto found = findVar(_oList, name);
523 return found != _oList.end() ? found->val.At(0) : defVal ;
524}
525
526
527////////////////////////////////////////////////////////////////////////////////
528/// Return RooArgSet property registered with name 'name'. If no
529/// property is registered, return defVal
530
532{
533 auto found = findVar(_cList, name);
534 return found != _cList.end() ? found->val : defVal ;
535}
536
537
538
539////////////////////////////////////////////////////////////////////////////////
540/// Return list of objects registered with name 'name'
541
543{
544 const static RooLinkedList defaultDummy ;
545 auto found = findVar(_oList, name);
546 return found != _oList.end() ? found->val : defaultDummy ;
547}
548
549
550
551////////////////////////////////////////////////////////////////////////////////
552/// Return true of parsing was successful
553
555{
556 if (_rList.GetSize()==0 && !_error) return kTRUE ;
557
558 if (verbose) {
559 std::string margs = missingArgs() ;
560 if (!margs.empty()) {
561 coutE(InputArguments) << _name << " ERROR: missing arguments: " << margs << endl ;
562 } else {
563 coutE(InputArguments) << _name << " ERROR: illegal combination of arguments and/or missing arguments" << endl ;
564 }
565 }
566 return kFALSE ;
567}
568
569
570
571////////////////////////////////////////////////////////////////////////////////
572/// Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList
573
574void RooCmdConfig::stripCmdList(RooLinkedList& cmdList, const char* cmdsToPurge) const
575{
576 // Sanity check
577 if (!cmdsToPurge) return ;
578
579 // Copy command list for parsing
580 for(auto const& name : ROOT::Split(cmdsToPurge, ",")) {
581 if (TObject* cmd = cmdList.FindObject(name.c_str())) {
582 cmdList.Remove(cmd);
583 }
584 }
585
586}
587
588
589
590////////////////////////////////////////////////////////////////////////////////
591/// Utility function to filter commands listed in cmdNameList from cmdInList. Filtered arguments are put in the returned list.
592/// If removeFromInList is true then these commands are removed from the input list
593
594RooLinkedList RooCmdConfig::filterCmdList(RooLinkedList& cmdInList, const char* cmdNameList, bool removeFromInList) const
595{
596 RooLinkedList filterList ;
597 if (!cmdNameList) return filterList ;
598
599 // Copy command list for parsing
600 for(auto const& name : ROOT::Split(cmdNameList, ",")) {
601 if (TObject* cmd = cmdInList.FindObject(name.c_str())) {
602 if (removeFromInList) {
603 cmdInList.Remove(cmd) ;
604 }
605 filterList.Add(cmd) ;
606 }
607 }
608 return filterList ;
609}
610
611
612
613////////////////////////////////////////////////////////////////////////////////
614/// Find a given double in a list of RooCmdArg.
615/// Should only be used to initialise base classes in constructors.
616double RooCmdConfig::decodeDoubleOnTheFly(const char* callerID, const char* cmdArgName, int idx, double defVal,
617 std::initializer_list<std::reference_wrapper<const RooCmdArg>> args) {
618 RooCmdConfig pc(callerID);
619 pc.allowUndefined();
620 pc.defineDouble("theDouble", cmdArgName, idx, defVal);
621 pc.process(args.begin(), args.end());
622 return pc.getDouble("theDouble");
623}
#define coutE(a)
Definition: RooMsgService.h:33
const Bool_t kFALSE
Definition: RtypesCore.h:101
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:375
char name[80]
Definition: TGX11.cxx:110
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition: TString.cxx:2447
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:26
Double_t getDouble(Int_t idx) const
Return double stored in slot idx.
Definition: RooCmdArg.h:91
const RooArgSet * getSet(Int_t idx) const
Return RooArgSet stored in slot idx.
Definition: RooCmdArg.cxx:205
RooLinkedList const & subArgs() const
Return list of sub-arguments in this RooCmdArg.
Definition: RooCmdArg.h:52
Int_t getInt(Int_t idx) const
Definition: RooCmdArg.h:86
bool procSubArgs() const
Definition: RooCmdArg.h:113
bool prefixSubArgs() const
Definition: RooCmdArg.h:114
const char * opcode() const
Definition: RooCmdArg.h:67
const char * getString(Int_t idx) const
Return string stored in slot idx.
Definition: RooCmdArg.h:95
const TObject * getObject(Int_t idx) const
Return TObject stored in slot idx.
Definition: RooCmdArg.h:99
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
Definition: RooCmdConfig.h:31
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
std::vector< Var< RooArgSet * > > _cList
RooArgSet list.
Definition: RooCmdConfig.h:122
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
TList _pList
Processed cmd list.
Definition: RooCmdConfig.h:128
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
std::vector< Var< RooLinkedList > > _oList
Object list.
Definition: RooCmdConfig.h:121
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
std::vector< Var< int > > _iList
Integer list.
Definition: RooCmdConfig.h:118
std::vector< Var< double > > _dList
Double list.
Definition: RooCmdConfig.h:119
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
void print() const
Print configuration of parser.
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
Bool_t defineSet(const char *name, const char *argName, Int_t setNum, const RooArgSet *set=0)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
RooArgSet * getSet(const char *name, RooArgSet *set=0)
Return RooArgSet property registered with name 'name'.
std::vector< Var< std::string > > _sList
String list.
Definition: RooCmdConfig.h:120
TList _yList
Dependency cmd list.
Definition: RooCmdConfig.h:127
TList _fList
Forbidden cmd list.
Definition: RooCmdConfig.h:125
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
void stripCmdList(RooLinkedList &cmdList, const char *cmdsToPurge) const
Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList.
RooCmdConfig(const char *methodName)
Constructor taking descriptive name of owner/user which is used as prefix for any warning or error me...
static double decodeDoubleOnTheFly(const char *callerID, const char *cmdArgName, int idx, double defVal, std::initializer_list< std::reference_wrapper< const RooCmdArg > > args)
Find a given double in a list of RooCmdArg.
TList _mList
Mutex cmd list.
Definition: RooCmdConfig.h:126
Bool_t _verbose
Definition: RooCmdConfig.h:114
RooLinkedList filterCmdList(RooLinkedList &cmdInList, const char *cmdNameList, bool removeFromInList=true) const
Utility function to filter commands listed in cmdNameList from cmdInList.
Bool_t _allowUndefined
Definition: RooCmdConfig.h:116
std::string missingArgs() const
Return string with names of arguments that were required, but not processed.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
TList _rList
Required cmd list.
Definition: RooCmdConfig.h:124
TString _name
Definition: RooCmdConfig.h:112
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:38
TObject * At(int index) const
Return object stored in sequential position given by index.
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:67
TObject * FindObject(const char *name) const override
Return pointer to obejct with given name.
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:184
A doubly linked list.
Definition: TList.h:44
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition: TList.cxx:578
void Add(TObject *obj) override
Definition: TList.h:87
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition: TList.cxx:822
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Return a list iterator.
Definition: TList.cxx:722
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
Collectable string class.
Definition: TObjString.h:28
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:403
Basic string class.
Definition: TString.h:136
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:442
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
Definition: StringUtils.cxx:23
@ InputArguments
Definition: RooGlobalFunc.h:64
static constexpr double s
static constexpr double pc
Definition: first.py:1
const char * String
Definition: TXMLSetup.cxx:94