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