Logo ROOT   6.18/05
Reference Guide
RooAbsCollection.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\file RooAbsCollection.cxx
19\class RooAbsCollection
20\ingroup Roofitcore
21
22RooAbsCollection is an abstract container object that can hold
23multiple RooAbsArg objects. Collections are ordered and can
24contain multiple objects of the same name, (but a derived
25implementation can enforce unique names). The storage of objects is
26implemented using the container denoted by RooAbsCollection::Storage_t.
27**/
28
29#include "RooAbsCollection.h"
30
31#include "Riostream.h"
32#include "TClass.h"
33#include "TStopwatch.h"
34#include "TRegexp.h"
35#include "RooStreamParser.h"
36#include "RooFormula.h"
37#include "RooAbsRealLValue.h"
39#include "RooStringVar.h"
40#include "RooTrace.h"
41#include "RooArgList.h"
42#include "RooLinkedListIter.h"
43#include "RooCmdConfig.h"
44#include "RooRealVar.h"
45#include "RooGlobalFunc.h"
46#include "RooMsgService.h"
47#include <ROOT/RMakeUnique.hxx>
48
49#include <algorithm>
50#include <iomanip>
51
52using std::endl;
53using std::vector;
54using std::string;
55using std::ostream;
56using std::cout;
57
58#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
59char* operator+( streampos&, char* );
60#endif
61
63 ;
64
65////////////////////////////////////////////////////////////////////////////////
66/// Default constructor
67
69 _list(),
70 _ownCont(kFALSE),
71 _name(),
72 _allRRV(kTRUE)
73{
74 _list.reserve(8);
75}
76
77
78
79////////////////////////////////////////////////////////////////////////////////
80/// Empty collection constructor
81
83 _list(),
84 _ownCont(kFALSE),
85 _name(name),
86 _allRRV(kTRUE)
87{
88 _list.reserve(8);
89}
90
91
92
93////////////////////////////////////////////////////////////////////////////////
94/// Copy constructor. Note that a copy of a collection is always non-owning,
95/// even the source collection is owning. To create an owning copy of
96/// a collection (owning or not), use the snapshot() method.
97
99 TObject(other),
100 RooPrintable(other),
101 _list(),
102 _ownCont(kFALSE),
103 _name(name),
104 _allRRV(other._allRRV)
105{
106 RooTrace::create(this) ;
107 if (!name) setName(other.GetName()) ;
108
109 _list.reserve(other._list.size());
110
111 for (auto item : other._list) {
112 add(*item);
113 }
114}
115
116
117
118////////////////////////////////////////////////////////////////////////////////
119/// Destructor
120
122{
123 // Delete all variables in our list if we own them
124 if(_ownCont){
126 }
127}
128
129
130////////////////////////////////////////////////////////////////////////////////
131/// Examine client server dependencies in list and
132/// delete contents in safe order: any client
133/// is deleted before a server is deleted
134
136{
137 // Handle trivial case here
138 if (_list.size() > 1) {
139 std::vector<RooAbsArg*> tmp;
140 tmp.reserve(_list.size());
141 do {
142 tmp.clear();
143 for (auto arg : _list) {
144 // Check if arg depends on remainder of list
145 if (!arg->dependsOn(*this, arg)) tmp.push_back(arg);
146 }
147
148 // sort and uniquify, in case some elements occur more than once
149 std::sort(tmp.begin(), tmp.end());
150
151 tmp.erase(std::unique(tmp.begin(), tmp.end()), tmp.end());
152 // okay, can remove and delete what's in tmp
153 auto newEnd = _list.end();
154 for (auto item : tmp) {
155 newEnd = std::remove(_list.begin(), newEnd, item);
156 delete item;
157 }
158 _list.erase(newEnd, _list.end());
159 } while (!tmp.empty() && _list.size() > 1);
160
161 // Check if there are any remaining elements
162 if (_list.size() > 1) {
163 coutW(ObjectHandling) << "RooAbsCollection::safeDeleteList(" << GetName()
164 << ") WARNING: unable to delete following elements in client-server order " ;
165 Print("1") ;
166 }
167 }
168
169 // Built-in delete remaining elements
170 for (auto item : _list) {
171 delete item;
172 }
173 _list.clear();
174}
175
176
177
178////////////////////////////////////////////////////////////////////////////////
179/// Take a snap shot of current collection contents:
180/// An owning collection is returned containing clones of
181///
182/// - Elements in this collection
183/// - External dependents of all elements
184/// and recursively any dependents of those dependents
185/// (if deepCopy flag is set)
186///
187/// If deepCopy is specified, the client-server links between the cloned
188/// list elements and the cloned external dependents are reconnected to
189/// each other, making the snapshot a completely self-contained entity.
190///
191///
192
194{
195 // First create empty list
196 TString snapName ;
197 if (TString(GetName()).Length()>0) {
198 snapName.Append("Snapshot of ") ;
199 snapName.Append(GetName()) ;
200 }
202
203 Bool_t error = snapshot(*output,deepCopy) ;
204 if (error) {
205 delete output ;
206 return 0 ;
207 }
208
209 return output ;
210}
211
212
213
214////////////////////////////////////////////////////////////////////////////////
215/// Take a snap shot of current collection contents:
216/// An owning collection is returned containing clones of
217///
218/// - Elements in this collection
219/// - External dependents of all elements
220/// and recursively any dependents of those dependents
221/// (if deepCopy flag is set)
222///
223/// If deepCopy is specified, the client-server links between the cloned
224/// list elements and the cloned external dependents are reconnected to
225/// each other, making the snapshot a completely self-contained entity.
226///
227///
228
230{
231 // Copy contents
232 output.reserve(_list.size());
233 for (auto orig : _list) {
234 RooAbsArg *copy= (RooAbsArg*)orig->Clone();
235 output.add(*copy);
236 }
237
238 // Add external dependents
239 Bool_t error(kFALSE) ;
240 if (deepCopy) {
241 // Recursively add clones of all servers
242 // Can only do index access because collection might reallocate when growing
243 for (Storage_t::size_type i = 0; i < output._list.size(); ++i) {
244 const auto var = output._list[i];
245 error |= output.addServerClonesToList(*var);
246 }
247 }
248
249 // Handle eventual error conditions
250 if (error) {
251 coutE(ObjectHandling) << "RooAbsCollection::snapshot(): Errors occurred in deep clone process, snapshot not created" << endl ;
252 output._ownCont = kTRUE ;
253 return kTRUE ;
254 }
255
256
257
258 // Redirect all server connections to internal list members
259 for (auto var : output) {
260 var->redirectServers(output,deepCopy);
261 }
262
263
264 // Transfer ownership of contents to list
265 output._ownCont = kTRUE ;
266 return kFALSE ;
267}
268
269
270
271////////////////////////////////////////////////////////////////////////////////
272/// Add clones of servers of given argument to end of list
273
275{
276 Bool_t ret(kFALSE) ;
277
278 for (const auto server : var.servers()) {
279 RooAbsArg* tmp = find(*server) ;
280
281 if (!tmp) {
282 RooAbsArg* serverClone = (RooAbsArg*)server->Clone() ;
283 serverClone->setAttribute("SnapShot_ExtRefClone") ;
284 _list.push_back(serverClone) ;
285 if (_allRRV && dynamic_cast<RooRealVar*>(serverClone)==0) {
287 }
288 ret |= addServerClonesToList(*server) ;
289 } else {
290
291 }
292 }
293
294 return ret ;
295}
296
297
298
299////////////////////////////////////////////////////////////////////////////////
300/// The assignment operator sets the value of any argument in our set
301/// that also appears in the other set.
302
304{
305 if (&other==this) return *this ;
306
307 for (auto elem : _list) {
308 auto theirs = other.find(*elem);
309 if(!theirs) continue;
310 theirs->syncCache() ;
311 elem->copyCache(theirs) ;
312 elem->setAttribute("Constant",theirs->isConstant()) ;
313 }
314 return *this;
315}
316
317
318
319////////////////////////////////////////////////////////////////////////////////
320/// The assignment operator sets the value of any argument in our set
321/// that also appears in the other set.
322
324{
325 if (&other==this) return *this ;
326
327 // Short cut for 1 element assignment
328 if (getSize()==1 && getSize()==other.getSize() && oneSafe) {
329 other.first()->syncCache() ;
330 first()->copyCache(other.first(),kTRUE) ;
331 return *this ;
332 }
333
334 for (auto elem : _list) {
335 auto theirs = other.find(*elem);
336 if(!theirs) continue;
337 theirs->syncCache() ;
338 elem->copyCache(theirs,kTRUE) ;
339 }
340 return *this;
341}
342
343
344
345////////////////////////////////////////////////////////////////////////////////
346/// Functional equivalent of operator=() but assumes this and other collection
347/// have same layout. Also no attributes are copied
348
350{
351 if (&other==this) return ;
352 assert(_list.size() == other._list.size());
353
354 auto iter2 = other._list.begin();
355 for (auto iter1 = _list.begin();
356 iter1 != _list.end() && iter2 != other._list.end();
357 ++iter1, ++iter2) {
358 // Identical size of iterators is documented assumption of method
359
360 if (_allRRV) {
361 // All contents are known to be RooRealVars - fast version of assignment
362 auto ours = static_cast<RooRealVar*>(*iter1);
363 auto theirs = static_cast<RooRealVar*>(*iter2);
364 ours->copyCacheFast(*theirs,setValDirty);
365 } else {
366 (*iter2)->syncCache() ;
367 (*iter1)->copyCache(*iter2,kTRUE,setValDirty) ;
368 }
369 }
370
371}
372
373
374
375////////////////////////////////////////////////////////////////////////////////
376/// Add the specified argument to list. Returns kTRUE if successful, or
377/// else kFALSE if a variable of the same name is already in the list.
378/// This method can only be called on a list that is flagged as owning
379/// all of its contents, or else on an empty list (which will force the
380/// list into that mode).
381
383{
384 // check that we own our variables or else are empty
385 if(!_ownCont && (getSize() > 0) && !silent) {
386 coutE(ObjectHandling) << ClassName() << "::" << GetName() << "::addOwned: can only add to an owned list" << endl;
387 return kFALSE;
388 }
390
391 _list.push_back(&var);
392 if (_allRRV && dynamic_cast<RooRealVar*>(&var)==0) {
394 }
395
396 return kTRUE;
397}
398
399
400
401////////////////////////////////////////////////////////////////////////////////
402/// Add a clone of the specified argument to list. Returns a pointer to
403/// the clone if successful, or else zero if a variable of the same name
404/// is already in the list or the list does *not* own its variables (in
405/// this case, try add() instead.) Calling addClone() on an empty list
406/// forces it to take ownership of all its subsequent variables.
407
409{
410 // check that we own our variables or else are empty
411 if(!_ownCont && (getSize() > 0) && !silent) {
412 coutE(ObjectHandling) << ClassName() << "::" << GetName() << "::addClone: can only add to an owned list" << endl;
413 return 0;
414 }
416
417 // add a pointer to a clone of this variable to our list (we now own it!)
418 auto clone2 = static_cast<RooAbsArg*>(var.Clone());
419 if (clone2) _list.push_back(clone2);
420 if (_allRRV && dynamic_cast<const RooRealVar*>(&var)==0) {
422 }
423
424 return clone2;
425}
426
427
428
429////////////////////////////////////////////////////////////////////////////////
430/// Add the specified argument to list. Returns kTRUE if successful, or
431/// else kFALSE if a variable of the same name is already in the list
432/// or the list owns its variables (in this case, try addClone() or addOwned() instead).
433
435{
436 // check that this isn't a copy of a list
437 if(_ownCont && !silent) {
438 coutE(ObjectHandling) << ClassName() << "::" << GetName() << "::add: cannot add to an owned list" << endl;
439 return kFALSE;
440 }
441
442 // add a pointer to this variable to our list (we don't own it!)
443 _list.push_back(const_cast<RooAbsArg*>(&var)); //FIXME
444 if (_allRRV && dynamic_cast<const RooRealVar*>(&var)==0) {
446 }
447 return kTRUE;
448}
449
450
451
452////////////////////////////////////////////////////////////////////////////////
453/// Add a collection of arguments to this collection by calling add()
454/// for each element in the source collection
455
457{
458 Bool_t result(false) ;
459 _list.reserve(_list.size() + list._list.size());
460
461 for (auto item : list._list) {
462 result |= add(*item,silent);
463 }
464
465 return result;
466}
467
468
469
470////////////////////////////////////////////////////////////////////////////////
471/// Add a collection of arguments to this collection by calling addOwned()
472/// for each element in the source collection
473
475{
476 Bool_t result(false) ;
477 _list.reserve(_list.size() + list._list.size());
478
479 for (auto item : list._list) {
480 result |= addOwned(*item, silent) ;
481 }
482
483 return result;
484}
485
486
487
488////////////////////////////////////////////////////////////////////////////////
489/// Add a collection of arguments to this collection by calling addOwned()
490/// for each element in the source collection
491
493{
494 _list.reserve(_list.size() + list._list.size());
495
496 for (auto item : list._list) {
497 addClone(*item, silent);
498 }
499}
500
501
502
503////////////////////////////////////////////////////////////////////////////////
504/// Replace any args in our set with args of the same name from the other set
505/// and return kTRUE for success. Fails if this list is a copy of another.
506
508{
509 // check that this isn't a copy of a list
510 if(_ownCont) {
511 coutE(ObjectHandling) << "RooAbsCollection: cannot replace variables in a copied list" << endl;
512 return kFALSE;
513 }
514
515 // loop over elements in the other list
516 for (const auto * arg : other._list) {
517 // do we have an arg of the same name in our set?
518 auto found = find(*arg);
519 if (found) replace(*found,*arg);
520 }
521 return kTRUE;
522}
523
524
525
526////////////////////////////////////////////////////////////////////////////////
527/// Replace var1 with var2 and return kTRUE for success. Fails if
528/// this list is a copy of another, if var1 is not already in this set,
529/// or if var2 is already in this set. var1 and var2 do not need to have
530/// the same name.
531
533{
534 // check that this isn't a copy of a list
535 if(_ownCont) {
536 coutE(ObjectHandling) << "RooAbsCollection: cannot replace variables in a copied list" << endl;
537 return kFALSE;
538 }
539
540 // is var1 already in this list?
541 const char *name= var1.GetName();
542 auto var1It = std::find(_list.begin(), _list.end(), &var1);
543
544 if (var1It == _list.end()) {
545 coutE(ObjectHandling) << "RooAbsCollection: variable \"" << name << "\" is not in the list"
546 << " and cannot be replaced" << endl;
547 return kFALSE;
548 }
549
550
551 // is var2's name already in this list?
552 if (dynamic_cast<RooArgSet*>(this)) {
553 RooAbsArg *other = find(var2);
554 if(other != 0 && other != &var1) {
555 coutE(ObjectHandling) << "RooAbsCollection: cannot replace \"" << name
556 << "\" with already existing \"" << var2.GetName() << "\"" << endl;
557 return kFALSE;
558 }
559 }
560
561 // replace var1 with var2
562 *var1It = const_cast<RooAbsArg*>(&var2); //FIXME
563
564 if (_allRRV && dynamic_cast<const RooRealVar*>(&var2)==0) {
566 }
567
568 return kTRUE;
569}
570
571
572
573////////////////////////////////////////////////////////////////////////////////
574/// Remove the specified argument from our list. Return kFALSE if
575/// the specified argument is not found in our list. An exact pointer
576/// match is required, not just a match by name. A variable can be
577/// removed from a copied list and will be deleted at the same time.
578
580{
581 // is var already in this list?
582 const auto sizeBefore = _list.size();
583
584 _list.erase(std::remove(_list.begin(), _list.end(), &var), _list.end());
585
586 if (matchByNameOnly) {
587 const std::string name(var.GetName());
588 auto nameMatch = [&name](const RooAbsArg* elm) {
589 return elm->GetName() == name;
590 };
591 std::set<RooAbsArg*> toBeDeleted;
592
593 if (_ownCont) {
594 std::for_each(_list.begin(), _list.end(), [&toBeDeleted, nameMatch](RooAbsArg* elm){
595 if (nameMatch(elm)) {
596 toBeDeleted.insert(elm);
597 }
598 });
599 }
600
601 _list.erase(std::remove_if(_list.begin(), _list.end(), nameMatch), _list.end());
602
603 for (auto arg : toBeDeleted)
604 delete arg;
605 }
606
607 return sizeBefore != _list.size();
608}
609
610
611
612////////////////////////////////////////////////////////////////////////////////
613/// Remove each argument in the input list from our list using remove(const RooAbsArg&).
614/// Return kFALSE in case of problems.
615
616Bool_t RooAbsCollection::remove(const RooAbsCollection& list, Bool_t silent, Bool_t matchByNameOnly)
617{
618
619 auto oldSize = _list.size();
620 for (auto item : list._list) {
621 remove(*item, silent, matchByNameOnly);
622 }
623
624 return oldSize != _list.size();
625}
626
627
628
629////////////////////////////////////////////////////////////////////////////////
630/// Remove all arguments from our set, deleting them if we own them.
631/// This effectively restores our object to the state it would have
632/// just after calling the RooAbsCollection(const char*) constructor.
633
635{
636 if(_ownCont) {
639 }
640 else {
641 _list.clear();
642 }
643}
644
645
646
647////////////////////////////////////////////////////////////////////////////////
648/// Set given attribute in each element of the collection by
649/// calling each elements setAttribute() function.
650
652{
653 for (auto arg : _list) {
654 arg->setAttribute(name, value);
655 }
656}
657
658
659
660
661////////////////////////////////////////////////////////////////////////////////
662/// Create a subset of the current collection, consisting only of those
663/// elements with the specified attribute set. The caller is responsibe
664/// for deleting the returned collection
665
667{
668 TString selName(GetName()) ;
669 selName.Append("_selection") ;
670 RooAbsCollection *sel = (RooAbsCollection*) create(selName.Data()) ;
671
672 // Scan set contents for matching attribute
673 for (auto arg : _list) {
674 if (arg->getAttribute(name)==value)
675 sel->add(*arg) ;
676 }
677
678 return sel ;
679}
680
681
682
683
684////////////////////////////////////////////////////////////////////////////////
685/// Create a subset of the current collection, consisting only of those
686/// elements that are contained as well in the given reference collection.
687/// The caller is responsible for deleting the returned collection
688
690{
691 // Create output set
692 TString selName(GetName()) ;
693 selName.Append("_selection") ;
694 RooAbsCollection *sel = (RooAbsCollection*) create(selName.Data()) ;
695
696 // Scan set contents for matching attribute
697 for (auto arg : _list) {
698 if (refColl.find(*arg))
699 sel->add(*arg) ;
700 }
701
702 return sel ;
703}
704
705
706
707////////////////////////////////////////////////////////////////////////////////
708/// Create a subset of the current collection, consisting only of those
709/// elements with names matching the wildcard expressions in nameList,
710/// supplied as a comma separated list
711
713{
714 // Create output set
715 TString selName(GetName()) ;
716 selName.Append("_selection") ;
717 RooAbsCollection *sel = (RooAbsCollection*) create(selName.Data()) ;
718
719 const size_t bufSize = strlen(nameList) + 1;
720 char* buf = new char[bufSize] ;
721 strlcpy(buf,nameList,bufSize) ;
722 char* wcExpr = strtok(buf,",") ;
723 while(wcExpr) {
724 TRegexp rexp(wcExpr,kTRUE) ;
725 if (verbose) {
726 cxcoutD(ObjectHandling) << "RooAbsCollection::selectByName(" << GetName() << ") processing expression '" << wcExpr << "'" << endl ;
727 }
728
729 RooFIter iter = fwdIterator() ;
730 RooAbsArg* arg ;
731 while((arg=iter.next())) {
732 if (TString(arg->GetName()).Index(rexp)>=0) {
733 if (verbose) {
734 cxcoutD(ObjectHandling) << "RooAbsCollection::selectByName(" << GetName() << ") selected element " << arg->GetName() << endl ;
735 }
736 sel->add(*arg) ;
737 }
738 }
739 wcExpr = strtok(0,",") ;
740 }
741 delete[] buf ;
742
743 return sel ;
744}
745
746
747
748
749////////////////////////////////////////////////////////////////////////////////
750/// Check if this and other collection have identically-named contents
751
753{
754 // First check equal length
755 if (getSize() != otherColl.getSize()) return kFALSE ;
756
757 // Then check that each element of our list also occurs in the other list
758 auto compareByNamePtr = [](const RooAbsArg * left, const RooAbsArg * right) {
759 return left->namePtr() == right->namePtr();
760 };
761
762 return std::is_permutation(_list.begin(), _list.end(),
763 otherColl._list.begin(),
764 compareByNamePtr);
765}
766
767
768
769
770////////////////////////////////////////////////////////////////////////////////
771/// Check if this and other collection have common entries
772
774{
775 for (auto arg : _list) {
776 if (otherColl.find(*arg)) {
777 return kTRUE ;
778 }
779 }
780 return kFALSE ;
781}
782
783
784
785
786////////////////////////////////////////////////////////////////////////////////
787/// Find object with given name in list. A null pointer
788/// is returned if no object with the given name is found
789
791{
792 if (!name)
793 return nullptr;
794
795 decltype(_list)::const_iterator item;
796
797 if (_list.size() < 10) {
798 auto findByName = [name](const RooAbsArg * elm){
799 return strcmp(elm->GetName(), name) == 0;
800 };
801
802 item = std::find_if(_list.begin(), _list.end(), findByName);
803 }
804 else {
805 const TNamed* nptr= RooNameReg::known(name);
806 if (!nptr) return nullptr;
807
808 auto findByNamePtr = [nptr](const RooAbsArg* elm) {
809 return nptr == elm->namePtr();
810 };
811
812 item = std::find_if(_list.begin(), _list.end(), findByNamePtr);
813 }
814
815 return item != _list.end() ? *item : nullptr;
816}
817
818
819
820////////////////////////////////////////////////////////////////////////////////
821/// Find object with given name in list. A null pointer
822/// is returned if no object with the given name is found
823
825{
826 const auto nptr = arg.namePtr();
827 auto findByNamePtr = [nptr](const RooAbsArg * listItem) {
828 return nptr == listItem->namePtr();
829 };
830
831 auto item = std::find_if(_list.begin(), _list.end(), findByNamePtr);
832
833 return item != _list.end() ? *item : nullptr;
834}
835
836
837
838////////////////////////////////////////////////////////////////////////////////
839/// Return comma separated list of contained object names as STL string
840
842{
843 string retVal ;
844 for (auto arg : _list) {
845 retVal += arg->GetName();
846 retVal += ",";
847 }
848
849 retVal.erase(retVal.end()-1);
850
851 return retVal;
852}
853
854
855
856////////////////////////////////////////////////////////////////////////////////
857/// Return collection name
858
859void RooAbsCollection::printName(ostream& os) const
860{
861 os << GetName() ;
862}
863
864
865
866////////////////////////////////////////////////////////////////////////////////
867/// Return collection title
868
869void RooAbsCollection::printTitle(ostream& os) const
870{
871 os << GetTitle() ;
872}
873
874
875
876////////////////////////////////////////////////////////////////////////////////
877/// Return collection class name
878
879void RooAbsCollection::printClassName(ostream& os) const
880{
881 os << IsA()->GetName() ;
882}
883
884
885
886////////////////////////////////////////////////////////////////////////////////
887/// Define default RooPrinable print options for given Print() flag string
888/// For inline printing only show value of objects, for default print show
889/// name,class name value and extras of each object. In verbose mode
890/// also add object adress, argument and title
891
893{
894 if (opt && TString(opt)=="I") {
895 return kValue ;
896 }
897 if (opt && TString(opt).Contains("v")) {
899 }
900 return kName|kClassName|kValue ;
901}
902
903
904
905
906
907////////////////////////////////////////////////////////////////////////////////
908/// Print value of collection, i.e. a comma separated list of contained
909/// object names
910
911void RooAbsCollection::printValue(ostream& os) const
912{
913 Bool_t first2(kTRUE) ;
914 os << "(" ;
915 for (auto arg : _list) {
916 if (!first2) {
917 os << "," ;
918 } else {
919 first2 = kFALSE ;
920 }
921 if (arg->IsA()->InheritsFrom(RooStringVar::Class())) {
922 os << '\'' << ((RooStringVar *)arg)->getVal() << '\'';
923 } else {
924 os << arg->GetName();
925 }
926 }
927 os << ")" ;
928}
929
930
931
932////////////////////////////////////////////////////////////////////////////////
933/// Implement multiline printing of collection, one line for each contained object showing
934/// the requested content
935
936void RooAbsCollection::printMultiline(ostream&os, Int_t contents, Bool_t /*verbose*/, TString indent) const
937{
938 if (TString(GetName()).Length()>0 && (contents&kCollectionHeader)) {
939 os << indent << ClassName() << "::" << GetName() << ":" << (_ownCont?" (Owning contents)":"") << endl;
940 }
941
942 int index= 0;
943 TString deeper(indent);
944 deeper.Append(" ");
945
946 // Adjust the width of the name field to fit the largest name, if requested
947 Int_t maxNameLen(1) ;
948 Int_t nameFieldLengthSaved = RooPrintable::_nameLength ;
949 if (nameFieldLengthSaved==0) {
950 for (auto next : _list) {
951 Int_t len = strlen(next->GetName()) ;
952 if (len>maxNameLen) maxNameLen = len ;
953 }
954 RooPrintable::nameFieldLength(maxNameLen+1) ;
955 }
956
957 for (auto next : _list) {
958 os << indent << std::setw(3) << ++index << ") ";
959 next->printStream(os,contents,kSingleLine,"");
960 }
961
962 // Reset name field length, if modified
963 RooPrintable::nameFieldLength(nameFieldLengthSaved) ;
964}
965
966
967
968////////////////////////////////////////////////////////////////////////////////
969/// Base contents dumper for debugging purposes
970
972{
973 for (auto arg : _list) {
974 cout << arg << " " << arg->IsA()->GetName() << "::" << arg->GetName() << " (" << arg->GetTitle() << ")" << endl ;
975 }
976}
977
978
979
980////////////////////////////////////////////////////////////////////////////////
981/// Output content of collection as LaTex table. By default a table with two columns is created: the left
982/// column contains the name of each variable, the right column the value.
983///
984/// The following optional named arguments can be used to modify the default behavior
985/// <table>
986/// <tr><th> Argument <th> Effect
987/// <tr><td> `Columns(Int_t ncol)` <td> Fold table into multiple columns, i.e. ncol=3 will result in 3 x 2 = 6 total columns
988/// <tr><td> `Sibling(const RooAbsCollection& other)` <td> Define sibling list.
989/// The sibling list is assumed to have objects with the same
990/// name in the same order. If this is not the case warnings will be printed. If a single
991/// sibling list is specified, 3 columns will be output: the (common) name, the value of this
992/// list and the value in the sibling list. Multiple sibling lists can be specified by
993/// repeating the Sibling() command.
994/// <tr><td> `Format(const char* str)` <td> Classic format string, provided for backward compatibility
995/// <tr><td> `Format()` <td> Formatting arguments.
996/// <table>
997/// <tr><td> const char* what <td> Controls what is shown. "N" adds name, "E" adds error,
998/// "A" shows asymmetric error, "U" shows unit, "H" hides the value
999/// <tr><td> `FixedPrecision(int n)` <td> Controls precision, set fixed number of digits
1000/// <tr><td> `AutoPrecision(int n)` <td> Controls precision. Number of shown digits is calculated from error
1001/// and n specified additional digits (1 is sensible default)
1002/// <tr><td> `VerbatimName(Bool_t flag)` <td> Put variable name in a \\verb+ + clause.
1003/// </table>
1004/// <tr><td> `OutputFile(const char* fname)` <td> Send output to file with given name rather than standard output
1005///
1006/// </table>
1007///
1008/// Example use:
1009/// ```
1010/// list.printLatex(Columns(2), Format("NEU",AutoPrecision(1),VerbatimName()) );
1011/// ```
1012
1014 const RooCmdArg& arg3, const RooCmdArg& arg4,
1015 const RooCmdArg& arg5, const RooCmdArg& arg6,
1016 const RooCmdArg& arg7, const RooCmdArg& arg8) const
1017{
1018
1019
1020 // Define configuration for this method
1021 RooCmdConfig pc("RooAbsCollection::printLatex()") ;
1022 pc.defineInt("ncol","Columns",0,1) ;
1023 pc.defineString("outputFile","OutputFile",0,"") ;
1024 pc.defineString("format","Format",0,"NEYVU") ;
1025 pc.defineInt("sigDigit","Format",0,1) ;
1026 pc.defineObject("siblings","Sibling",0,0,kTRUE) ;
1027 pc.defineInt("dummy","FormatArgs",0,0) ;
1028 pc.defineMutex("Format","FormatArgs") ;
1029
1030 // Stuff all arguments in a list
1031 RooLinkedList cmdList;
1032 cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
1033 cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
1034 cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
1035 cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;
1036
1037 // Process & check varargs
1038 pc.process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
1039 if (!pc.ok(kTRUE)) {
1040 return ;
1041 }
1042
1043 const char* outFile = pc.getString("outputFile") ;
1044 if (outFile && strlen(outFile)) {
1045 std::ofstream ofs(outFile) ;
1046 if (pc.hasProcessed("FormatArgs")) {
1047 RooCmdArg* formatCmd = static_cast<RooCmdArg*>(cmdList.FindObject("FormatArgs")) ;
1048 formatCmd->addArg(RooFit::LatexTableStyle()) ;
1049 printLatex(ofs,pc.getInt("ncol"),0,0,pc.getObjectList("siblings"),formatCmd) ;
1050 } else {
1051 printLatex(ofs,pc.getInt("ncol"),pc.getString("format"),pc.getInt("sigDigit"),pc.getObjectList("siblings")) ;
1052 }
1053 } else {
1054 if (pc.hasProcessed("FormatArgs")) {
1055 RooCmdArg* formatCmd = static_cast<RooCmdArg*>(cmdList.FindObject("FormatArgs")) ;
1056 formatCmd->addArg(RooFit::LatexTableStyle()) ;
1057 printLatex(cout,pc.getInt("ncol"),0,0,pc.getObjectList("siblings"),formatCmd) ;
1058 } else {
1059 printLatex(cout,pc.getInt("ncol"),pc.getString("format"),pc.getInt("sigDigit"),pc.getObjectList("siblings")) ;
1060 }
1061 }
1062}
1063
1064
1065
1066
1067////////////////////////////////////////////////////////////////////////////////
1068/// Internal implementation function of printLatex
1069
1070void RooAbsCollection::printLatex(ostream& ofs, Int_t ncol, const char* option, Int_t sigDigit, const RooLinkedList& siblingList, const RooCmdArg* formatCmd) const
1071{
1072 // Count number of rows to print
1073 Int_t nrow = (Int_t) (getSize() / ncol + 0.99) ;
1074 Int_t i,j,k ;
1075
1076 // Sibling list do not need to print their name as it is supposed to be the same
1077 TString sibOption ;
1078 RooCmdArg sibFormatCmd ;
1079 if (option) {
1080 sibOption = option ;
1081 sibOption.ReplaceAll("N","") ;
1082 sibOption.ReplaceAll("n","") ;
1083 } else {
1084 sibFormatCmd = *formatCmd ;
1085 TString tmp = formatCmd->_s[0] ;
1086 tmp.ReplaceAll("N","") ;
1087 tmp.ReplaceAll("n","") ;
1088 static char buf[100] ;
1089 strlcpy(buf,tmp.Data(),100) ;
1090 sibFormatCmd._s[0] = buf ;
1091 }
1092
1093
1094 // Make list of lists ;
1095 RooLinkedList listList ;
1096 listList.Add((RooAbsArg*)this) ;
1097 RooFIter sIter = siblingList.fwdIterator() ;
1098 RooAbsCollection* col ;
1099 while((col=(RooAbsCollection*)sIter.next())) {
1100 listList.Add(col) ;
1101 }
1102
1103 RooLinkedList listListRRV ;
1104
1105 // Make list of RRV-only components
1106 RooFIter lIter = listList.fwdIterator() ;
1107 RooArgList* prevList = 0 ;
1108 while((col=(RooAbsCollection*)lIter.next())) {
1109 RooArgList* list = new RooArgList ;
1110 RooFIter iter = col->fwdIterator() ;
1111 RooAbsArg* arg ;
1112 while((arg=iter.next())) {
1113
1114 RooRealVar* rrv = dynamic_cast<RooRealVar*>(arg) ;
1115 if (rrv) {
1116 list->add(*rrv) ;
1117 } else {
1118 coutW(InputArguments) << "RooAbsCollection::printLatex: can only print RooRealVar in LateX, skipping non-RooRealVar object named "
1119 << arg->GetName() << endl ;
1120 }
1121 if (prevList && TString(rrv->GetName()).CompareTo(prevList->at(list->getSize()-1)->GetName())) {
1122 coutW(InputArguments) << "RooAbsCollection::printLatex: WARNING: naming and/or ordering of sibling list is different" << endl ;
1123 }
1124 }
1125 listListRRV.Add(list) ;
1126 if (prevList && list->getSize() != prevList->getSize()) {
1127 coutW(InputArguments) << "RooAbsCollection::printLatex: ERROR: sibling list(s) must have same length as self" << endl ;
1128 delete list ;
1129 listListRRV.Delete() ;
1130 return ;
1131 }
1132 prevList = list ;
1133 }
1134
1135 // Construct table header
1136 Int_t nlist = listListRRV.GetSize() ;
1137 TString subheader = "l" ;
1138 for (k=0 ; k<nlist ; k++) subheader += "c" ;
1139
1140 TString header = "\\begin{tabular}{" ;
1141 for (j=0 ; j<ncol ; j++) {
1142 if (j>0) header += "|" ;
1143 header += subheader ;
1144 }
1145 header += "}" ;
1146 ofs << header << endl ;
1147
1148
1149 // Print contents, delegating actual printing to RooRealVar::format()
1150 for (i=0 ; i<nrow ; i++) {
1151 for (j=0 ; j<ncol ; j++) {
1152 for (k=0 ; k<nlist ; k++) {
1153 RooRealVar* par = (RooRealVar*) ((RooArgList*)listListRRV.At(k))->at(i+j*nrow) ;
1154 if (par) {
1155 if (option) {
1156 TString* tmp = par->format(sigDigit,(k==0)?option:sibOption.Data()) ;
1157 ofs << *tmp ;
1158 delete tmp ;
1159 } else {
1160 TString* tmp = par->format((k==0)?*formatCmd:sibFormatCmd) ;
1161 ofs << *tmp ;
1162 delete tmp ;
1163 }
1164 }
1165 if (!(j==ncol-1 && k==nlist-1)) {
1166 ofs << " & " ;
1167 }
1168 }
1169 }
1170 ofs << "\\\\" << endl ;
1171 }
1172
1173 ofs << "\\end{tabular}" << endl ;
1174 listListRRV.Delete() ;
1175}
1176
1177
1178
1179
1180////////////////////////////////////////////////////////////////////////////////
1181/// Return true if all contained object report to have their
1182/// value inside the specified range
1183
1184Bool_t RooAbsCollection::allInRange(const char* rangeSpec) const
1185{
1186 if (!rangeSpec) return kTRUE ;
1187
1188 // Parse rangeSpec specification
1189 vector<string> cutVec ;
1190 if (rangeSpec && strlen(rangeSpec)>0) {
1191 if (strchr(rangeSpec,',')==0) {
1192 cutVec.push_back(rangeSpec) ;
1193 } else {
1194 const size_t bufSize = strlen(rangeSpec)+1;
1195 char* buf = new char[bufSize] ;
1196 strlcpy(buf,rangeSpec,bufSize) ;
1197 const char* oneRange = strtok(buf,",") ;
1198 while(oneRange) {
1199 cutVec.push_back(oneRange) ;
1200 oneRange = strtok(0,",") ;
1201 }
1202 delete[] buf ;
1203 }
1204 }
1205
1206 // Apply range based selection criteria
1207 Bool_t selectByRange = kTRUE ;
1208 for (auto arg : _list) {
1209 Bool_t selectThisArg = kFALSE ;
1210 UInt_t icut ;
1211 for (icut=0 ; icut<cutVec.size() ; icut++) {
1212 if (arg->inRange(cutVec[icut].c_str())) {
1213 selectThisArg = kTRUE ;
1214 break ;
1215 }
1216 }
1217 if (!selectThisArg) {
1218 selectByRange = kFALSE ;
1219 break ;
1220 }
1221 }
1222
1223 return selectByRange ;
1224}
1225
1226
1227
1228////////////////////////////////////////////////////////////////////////////////
1229
1231{
1232}
1233
1234
1235////////////////////////////////////////////////////////////////////////////////
1236
1238{
1239}
1240
1241////////////////////////////////////////////////////////////////////////////////
1242/// If one of the TObject we have a referenced to is deleted, remove the
1243/// reference.
1244
1246{
1247 if (obj && obj->InheritsFrom(RooAbsArg::Class())) remove(*(RooAbsArg*)obj,false,false);
1248}
1249
1250////////////////////////////////////////////////////////////////////////////////
1251/// Sort collection using std::sort and name comparison
1252
1254 //Windows seems to need an implementation where two different std::sorts are written
1255 //down in two different blocks. Switching between the two comparators using a ternary
1256 //operator does not compile on windows, although the signature is identical.
1257 if (reverse) {
1258 const auto cmpReverse = [](const RooAbsArg * l, const RooAbsArg * r) {
1259 return strcmp(l->GetName(), r->GetName()) > 0;
1260 };
1261
1262 std::sort(_list.begin(), _list.end(), cmpReverse);
1263 }
1264 else {
1265 const auto cmp = [](const RooAbsArg * l, const RooAbsArg * r) {
1266 return strcmp(l->GetName(), r->GetName()) < 0;
1267 };
1268
1269 std::sort(_list.begin(), _list.end(), cmp);
1270 }
1271}
1272
1273////////////////////////////////////////////////////////////////////////////////
1274/// Factory for legacy iterators.
1275
1276std::unique_ptr<RooAbsCollection::LegacyIterator_t> RooAbsCollection::makeLegacyIterator (bool forward) const {
1277 if (!forward)
1278 ccoutE(DataHandling) << "The legacy RooFit collection iterators don't support reverse iterations, any more. "
1279 << "Use begin() and end()" << endl;
1280 return std::make_unique<LegacyIterator_t>(_list);
1281}
1282
void Class()
Definition: Class.C:29
ROOT::R::TRInterface & r
Definition: Object.C:4
#define ccoutE(a)
Definition: RooMsgService.h:41
#define cxcoutD(a)
Definition: RooMsgService.h:79
#define coutW(a)
Definition: RooMsgService.h:33
#define coutE(a)
Definition: RooMsgService.h:34
int Int_t
Definition: RtypesCore.h:41
char Text_t
Definition: RtypesCore.h:58
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:365
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition: TGX11.cxx:109
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Definition: TString.cxx:1474
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:70
const TNamed * namePtr() const
Definition: RooAbsArg.h:506
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Definition: RooAbsArg.h:82
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:256
const RefCountList_t & servers() const
Definition: RooAbsArg.h:161
virtual void syncCache(const RooArgSet *nset=0)=0
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooFIter fwdIterator() const R__SUGGEST_ALTERNATIVE("begin()
One-time forward iterator.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
virtual TObject * create(const char *newname) const =0
RooAbsCollection()
Default constructor.
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, Bool_t oneSafe=kFALSE)
The assignment operator sets the value of any argument in our set that also appears in the other set.
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace var1 with var2 and return kTRUE for success.
Int_t getSize() const
void printLatex(const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg()) const
Output content of collection as LaTex table.
void sort(Bool_t reverse=false)
Sort collection using std::sort and name comparison.
Bool_t addServerClonesToList(const RooAbsArg &var)
Add clones of servers of given argument to end of list.
virtual void printName(std::ostream &os) const
Return collection name.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual ~RooAbsCollection()
Destructor.
RooAbsArg * first() const
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout.
RooAbsCollection * selectByName(const char *nameList, Bool_t verbose=kFALSE) const
Create a subset of the current collection, consisting only of those elements with names matching the ...
Bool_t overlaps(const RooAbsCollection &otherColl) const
Check if this and other collection have common entries.
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multiline printing of collection, one line for each contained object showing the requested ...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
std::unique_ptr< LegacyIterator_t > makeLegacyIterator(bool forward=true) const
Factory for legacy iterators.
void setAttribAll(const Text_t *name, Bool_t value=kTRUE)
Set given attribute in each element of the collection by calling each elements setAttribute() functio...
void dump() const
Base contents dumper for debugging purposes.
virtual void printTitle(std::ostream &os) const
Return collection title.
Bool_t equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically-named contents.
RooAbsCollection * selectByAttrib(const char *name, Bool_t value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
const char * GetName() const
Returns name of object.
virtual void printClassName(std::ostream &os) const
Return collection class name.
std::string contentsString() const
Return comma separated list of contained object names as STL string.
void setName(const char *name)
RooAbsCollection & operator=(const RooAbsCollection &other)
The assignment operator sets the value of any argument in our set that also appears in the other set.
void safeDeleteList()
Examine client server dependencies in list and delete contents in safe order: any client is deleted b...
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
Storage_t::const_iterator const_iterator
virtual void printValue(std::ostream &os) const
Print value of collection, i.e.
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default RooPrinable print options for given Print() flag string For inline printing only show ...
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition: RooArgList.h:88
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:27
void addArg(const RooCmdArg &arg)
Utility function to add nested RooCmdArg to payload of this RooCmdArg.
Definition: RooCmdArg.cxx:188
std::string _s[3]
Definition: RooCmdArg.h:111
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
Definition: RooCmdConfig.h:27
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:36
Int_t GetSize() const
Definition: RooLinkedList.h:61
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
RooFIter fwdIterator() const
Create a one-time-use forward iterator for this list.
TObject * At(Int_t index) const
Return object stored in sequential position given by index.
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:63
static const TNamed * known(const char *stringPtr)
If the name is already known, return its TNamed pointer. Otherwise return 0 (don't register the name)...
Definition: RooNameReg.cxx:124
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
static Int_t _nameLength
Definition: RooPrintable.h:57
static void nameFieldLength(Int_t newLen)
Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to gi...
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:36
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
Definition: RooRealVar.cxx:808
void copyCacheFast(const RooRealVar &other, Bool_t setValDirty=kTRUE)
Definition: RooRealVar.h:122
RooStringVar implements a string values RooAbsArg.
Definition: RooStringVar.h:23
static void create(const TObject *obj)
Register creation of object 'obj'.
Definition: RooTrace.cxx:68
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:401
Regular expression class.
Definition: TRegexp.h:31
Basic string class.
Definition: TString.h:131
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:418
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
TString & Append(const char *cs)
Definition: TString.h:559
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
@ DataHandling
Definition: RooGlobalFunc.h:59
@ InputArguments
Definition: RooGlobalFunc.h:58
@ ObjectHandling
Definition: RooGlobalFunc.h:58
RooCmdArg LatexTableStyle(Bool_t flag=kTRUE)
static constexpr double pc
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
Definition: NeuralNet.icc:544
auto * l
Definition: textangle.C:4
static void output(int code)
Definition: gifencode.c:226