Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooSimWSTool.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/// \class RooSimWSTool
19/// The RooSimWSTool is a tool operating on RooWorkspace objects that
20/// can clone PDFs into a series of variations that are joined together
21/// into a RooSimultaneous PDF.
22///
23/// ## Splitting a single PDF
24/// The simplest use case is to take a workspace PDF as prototype and
25/// "split" a parameter of that PDF into two specialized parameters
26/// depending on a category in the dataset.
27///
28/// For example, given a Gaussian
29/// PDF \f$ G(x \,|\, m,s) \f$ we want to construct a \f$ G_a(x \,|\, m_a,s) \f$ and a \f$ G_b(x \,|\, m_b,s) \f$
30/// with different mean parameters to be fit to a dataset with observables
31/// \f$ (x,c) \f$ where \f$ c \f$ is a category with states 'a' and 'b'.
32///
33/// Using RooSimWSTool, one can create a simultaneous PDF from \f$ G_a \f$ and \f$ G_b \f$
34/// from \f$ G \f$ with the following commands:
35/// ```
36/// RooSimWSTool wst(wspace);
37/// wst.build("G_sim", "G", SplitParam("m","c"));
38/// ```
39///
40/// #### Splitting using a product category
41/// From this simple example one can go to builds of arbitrary complexity
42/// by specifying multiple SplitParam arguments on multiple parameters
43/// involving multiple splitting categories. Splits can also be performed
44/// in the product of multiple categories, *i.e.*,
45/// ```
46/// wst.build("G_sim", "G", SplitParam("m","c,d"));
47/// ```
48/// splits the parameter \f$ m \f$ in the product of the states of \f$ c \f$ and
49/// \f$ d \f$.
50///
51/// #### Constrained split
52/// Another possibility
53/// is the "constrained" split, which clones the parameter for all but one state
54/// and inserts a formula specialization in a chosen state that evaluates
55/// to \f$ 1 - \sum_i(a_i) \f$ where \f$ a_i \f$ are all other specializations. For example,
56/// given a category \f$ c \f$ with the states `"A","B","C","D"`, the specification
57/// ```
58/// SplitParamConstrained("m","c","D")
59/// ```
60/// will create the parameters \f$ m_A,m_B,m_C \f$ and a formula expression \f$ m_D \f$
61/// that evaluates to \f$ (1-(m_A+m_B+m_C)) \f$. Constrained splits can also be
62/// specified in the product of categories. In that case, the name of the
63/// remainder state follows the syntax `"{State1;State2}"`, where `State1` and
64/// `State2` are the state names of the two spitting categories.
65///
66/// ## Splitting multiple PDFs
67/// The examples so far deal with a single prototype PDF. It is also
68/// possible to build with multiple prototype PDFs by specifying a
69/// mapping between the prototype to use and the names of states of
70/// a "master" splitting category. To specify these configurations,
71/// an intermediate `MultiBuildConfig` must be composed with all
72/// the necessary specifications. This, for example,
73/// ```
74/// RooSimWSTool::MultiBuildConfig mbc("mc");
75/// mbc.addPdf("I","G",SplitParam("m,s","c"));
76/// mbc.addPdf("II,III","F",SplitParam("a","c,d"));
77/// ```
78/// configures a build with two prototype PDFs \f$ G \f$ and \f$ F \f$.
79/// Prototype \f$ G \f$ is used for state `"I"` of the master split category
80/// `mc` and prototype \f$ F \f$ is used for states `"II"` and `"III"` of the
81/// master split category `mc`. Furthermore, the parameters \f$ m,s \f$ of
82/// prototype \f$ G \f$ are split
83/// in category \f$ c \f$ while the parameter \f$ a \f$ of prototype \f$ F \f$ is split in
84/// the product of the categories \f$ c \f$ and \f$ d \f$. The actual build is then
85/// performed by passing the build configuration to RooSimWSTool, *e.g.*,
86/// ```
87/// wst.build("MASTER", mbc);
88/// ```
89/// By default, a specialisation is built for each permutation of
90/// states of the splitting categories that are used. It is possible
91/// to restrict the building of specialised PDFs to a subset of states
92/// by adding a restriction on the number of states to build as follows:
93/// ```
94/// mbc.restrictBuild("c","A,B");
95/// ```
96/// The restrictBuild method can be called multiple times, but at most
97/// once for each splitting category in use. For simple builds with a single
98/// prototype, restriction can be specified with a Restrict() argument
99/// on the build command line.
100///
101
102
103#include "RooSimWSTool.h"
104
106#include "RooMsgService.h"
107#include "RooCategory.h"
108#include "RooRealVar.h"
109#include "RooAbsPdf.h"
110#include "RooSuperCategory.h"
111#include "RooCustomizer.h"
112#include "RooMultiCategory.h"
113#include "RooSimultaneous.h"
114#include "RooGlobalFunc.h"
115#include "RooFracRemainder.h"
116#include "RooFactoryWSTool.h"
117
118using std::string, std::map, std::list, std::pair, std::vector;
119
120namespace {
121
122class SimWSIFace : public RooFactoryWSTool::IFace {
123public:
124 std::string create(RooFactoryWSTool& ft, const char* typeName, const char* instanceName, std::vector<std::string> args) override ;
125} ;
126
127static Int_t init();
128
129Int_t dummy = init() ;
130
131Int_t init()
132{
133 static SimWSIFace iface{};
134 RooFactoryWSTool::registerSpecial("SIMCLONE",&iface);
135 RooFactoryWSTool::registerSpecial("MSIMCLONE",&iface);
136 (void) dummy;
137 return 0 ;
138}
139
140}
141
142////////////////////////////////////////////////////////////////////////////////
143/// Constructor of SimWSTool on given workspace. All input is taken from the workspace
144/// All output is stored in the workspace
145
147{
148}
149
150
151
152////////////////////////////////////////////////////////////////////////////////
153/// Destructor
154
158
159
160
161////////////////////////////////////////////////////////////////////////////////
162/// Build a RooSimultaneous PDF with name simPdfName from cloning specializations of protytpe PDF protoPdfName.
163/// <table>
164/// <tr><th> Optional Arguments <th> Effect
165/// <tr><td> SplitParam(varname, catname) <td> Split parameter(s) with given name(s) in category(s) with given names
166/// <tr><td> SplitParam(var, cat) <td> Split given parameter(s) in given category(s)
167/// <tr><td> SplitParamConstrained(vname, cname, remainder) <td> Make constrained split in parameter(s) with given name(s) in category(s) with given names
168/// putting remainder fraction formula in state with name "remainder"
169/// <tr><td> SplitParamConstrained(var,cat,remainder) <td> Make constrained split in parameter(s) with given name(s) in category(s) with given names
170/// putting remainder fraction formula in state with name "remainder"
171/// <tr><td> Restrict(catName,stateNameList) <td> Restrict build by only considered listed state names of category with given name
172
173RooSimultaneous* RooSimWSTool::build(const char* simPdfName, const char* protoPdfName, const RooCmdArg& arg1,const RooCmdArg& arg2,
174 const RooCmdArg& arg3,const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
175{
176 BuildConfig bc(protoPdfName,arg1,arg2,arg3,arg4,arg5,arg6) ;
177 return build(simPdfName,bc) ;
178}
179
180
181
182////////////////////////////////////////////////////////////////////////////////
183/// Build a RooSimultaneous PDF with name simPdfName from cloning specializations of protytpe PDF protoPdfName.
184/// Use the provided BuildConfig or MultiBuildConfig object to configure the build
185
186RooSimultaneous* RooSimWSTool::build(const char* simPdfName,BuildConfig& bc, bool verbose)
187{
188 auto obc = validateConfig(bc);
189 if (!obc) return nullptr;
190
191 if (verbose) {
192 obc->print() ;
193 }
194
195 RooSimultaneous* ret = executeBuild(simPdfName,*obc,verbose) ;
196
197 return ret ;
198}
199
200
201
202////////////////////////////////////////////////////////////////////////////////
203/// Validate build configuration. If not syntax errors or missing objects are found,
204/// return an ObjBuildConfig in which all names are replaced with object pointers.
205
206std::unique_ptr<RooSimWSTool::ObjBuildConfig> RooSimWSTool::validateConfig(BuildConfig& bc)
207{
208 // Create empty object version of build config
209 auto obc = std::make_unique<ObjBuildConfig>();
210
211 if (!bc._masterCatName.empty()) {
212 obc->_masterCat = _ws->cat(bc._masterCatName);
213 if (!obc->_masterCat) {
214 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: associated workspace " << _ws->GetName()
215 << " does not contain a category named " << bc._masterCatName
216 << " that was designated as master index category in the build configuration"
217 << std::endl;
218 return nullptr;
219 }
220 } else {
221 obc->_masterCat = nullptr;
222 }
223
224 map<string,SplitRule>::iterator pdfiter ;
225 // Check that we have the p.d.f.s
226 for (pdfiter = bc._pdfmap.begin() ; pdfiter != bc._pdfmap.end() ; ++pdfiter) {
227
228 // Check that p.d.f exists
229 RooAbsPdf* pdf = _ws->pdf(pdfiter->second.GetName()) ;
230 if (!pdf) {
231 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: associated workspace " << _ws->GetName()
232 << " does not contain a pdf named " << pdfiter->second.GetName() << std::endl ;
233 return nullptr;
234 }
235
236 // Create empty object version of split rule set
237 ObjSplitRule osr ;
238
239 // Convert names of parameters and splitting categories to objects in workspace, fill object split rule
240 SplitRule& sr = pdfiter->second ;
241
242 map<string, pair<list<string>,string> >::iterator pariter ;
243 for (pariter=sr._paramSplitMap.begin() ; pariter!=sr._paramSplitMap.end() ; ++pariter) {
244
245 // Check that variable with given name exists in workspace
246 RooAbsArg* farg = _ws->fundArg(pariter->first) ;
247 if (!farg) {
248 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: associated workspace " << _ws->GetName()
249 << " does not contain a variable named " << pariter->first.c_str()
250 << " as specified in splitting rule of parameter " << pariter->first << " of p.d.f " << pdf << std::endl ;
251 return nullptr;
252 }
253
254 // Check that given variable is indeed related to given p.d.f
255 if (!pdf->dependsOn(*farg)) {
256 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: specified parameter " << pariter->first
257 << " in split is not function of p.d.f " << pdf->GetName() << std::endl ;
258 return nullptr;
259 }
260
261
262 RooArgSet splitCatSet ;
263 list<string>::iterator catiter ;
264 for (catiter = pariter->second.first.begin() ; catiter!=pariter->second.first.end() ; ++catiter) {
265 RooAbsCategory* cat = _ws->catfunc(*catiter) ;
266 if (!cat) {
267 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: associated workspace " << _ws->GetName()
268 << " does not contain a category named " << catiter->c_str()
269 << " as specified in splitting rule of parameter " << pariter->first << " of p.d.f " << pdf << std::endl ;
270 return nullptr;
271 }
272 splitCatSet.add(*cat) ;
273 }
274
275 // Check if composite splitCatSet does not contain category functions that depend on other categories used in the same split
276 for(RooAbsArg * arg : splitCatSet) {
277 RooArgSet tmp(splitCatSet) ;
278 tmp.remove(*arg) ;
279 if (arg->dependsOnValue(tmp)) {
280 oocoutE(nullptr, InputArguments) << "RooSimWSTool::build() ERROR: Ill defined split: splitting category function " << arg->GetName()
281 << " used in composite split " << splitCatSet << " of parameter " << farg->GetName() << " of pdf " << pdf->GetName()
282 << " depends on one or more of the other splitting categories in the composite split" << std::endl ;
283 return nullptr;
284 }
285 }
286
287 // If a constrained split is specified, check that split parameter is a real-valued type
288 if (!pariter->second.second.empty()) {
289 if (!dynamic_cast<RooAbsReal*>(farg)) {
290 oocoutE(nullptr, InputArguments) << "RooSimWSTool::build() ERROR: Constrained split specified in non real-valued parameter " << farg->GetName() << std::endl ;
291 return nullptr;
292 }
293 }
294
295 // Fill object build config with object split rule
296 osr._paramSplitMap[farg].first.add(splitCatSet) ;
297 osr._paramSplitMap[farg].second = pariter->second.second ;
298
299 // For multi-pdf configurations, check that the master index state name associated with this p.d.f exists as a state in the master category
300 if (obc->_masterCat) {
301 list<string>::iterator misi ;
302 for (misi=sr._miStateNameList.begin() ; misi!=sr._miStateNameList.end() ; ++misi) {
303 const RooCatType* ctype = obc->_masterCat->lookupType(misi->c_str(),false) ;
304 if (ctype==nullptr) {
305 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: master index category " << obc->_masterCat->GetName()
306 << " does not have a state named " << *misi << " which was specified as state associated with p.d.f "
307 << sr.GetName() << std::endl ;
308 return nullptr;
309 }
310 osr._miStateList.push_back(ctype) ;
311 }
312 }
313
314 // Add specified split cats to global list of all splitting categories
315 obc->_usedSplitCats.add(splitCatSet,true) ;
316
317 }
318 // Need to add clause here for SplitRules without any split (which can happen in MultiBuildConfigs)
319 if (sr._paramSplitMap.empty()) {
320
321 if (obc->_masterCat) {
322 list<string>::iterator misi ;
323 for (misi=sr._miStateNameList.begin() ; misi!=sr._miStateNameList.end() ; ++misi) {
324 const RooCatType* ctype = obc->_masterCat->lookupType(misi->c_str(),false) ;
325 if (ctype==nullptr) {
326 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: master index category " << obc->_masterCat->GetName()
327 << " does not have a state named " << *misi << " which was specified as state associated with p.d.f "
328 << sr.GetName() << std::endl ;
329 return nullptr;
330 }
331 osr._miStateList.push_back(ctype) ;
332 }
333 }
334 }
335
336 obc->_pdfmap[pdf] = osr ;
337
338 }
339
340 // Check validity of build restriction specifications, if any
341 map<string,string>::iterator riter ;
342 for (riter=bc._restr.begin() ; riter!=bc._restr.end() ; ++riter) {
343 RooCategory* cat = _ws->cat(riter->first) ;
344 if (!cat) {
345 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: associated workspace " << _ws->GetName()
346 << " does not contain a category named " << riter->first
347 << " for which build was requested to be restricted to states " << riter->second << std::endl ;
348 return nullptr;
349 }
350
351 char buf[4096] ;
352 list<const RooCatType*> rlist ;
353 strlcpy(buf,riter->second.c_str(),4096) ;
354
355 char* tok = strtok(buf,"{,}") ;
356 while(tok) {
357 const RooCatType* ctype = cat->lookupType(tok,false) ;
358 if (!ctype) {
359 oocoutE(nullptr, ObjectHandling) << "RooSimWSTool::build() ERROR: restricted build category " << cat->GetName()
360 << " does not have state " << tok << " as specified in restriction list" << std::endl ;
361 return nullptr;
362 }
363 rlist.push_back(ctype) ;
364 tok = strtok(nullptr,"{,}") ;
365 }
366
367 obc->_restr[cat] = rlist ;
368 }
369
370 return obc ;
371}
372
373
374
375
376////////////////////////////////////////////////////////////////////////////////
377/// Internal build driver from validation ObjBuildConfig.
378
379RooSimultaneous* RooSimWSTool::executeBuild(const char* simPdfName, ObjBuildConfig& obc, bool verbose)
380{
381 RooArgSet cleanupList ;
382
383 RooAbsCategoryLValue* physCat = obc._masterCat ;
384
385 RooArgSet physModelSet ;
386 map<string,RooAbsPdf*> stateMap ;
387
388 map<RooAbsPdf*,ObjSplitRule>::iterator physIter = obc._pdfmap.begin() ;
389 while(physIter!=obc._pdfmap.end()) {
390
391
392 RooAbsPdf* physModel = physIter->first ;
393 physModelSet.add(*physModel,true) ; // silence duplicate insertion warnings
394
395 list<const RooCatType*>::iterator stiter ;
396 for (stiter=physIter->second._miStateList.begin() ; stiter!=physIter->second._miStateList.end() ; ++stiter) {
397 stateMap[(*stiter)->GetName()] = physModel ;
398 }
399
400 // Continue with next mapping
401 ++physIter ;
402 }
403 if (verbose) {
404 oocoutI(nullptr, ObjectHandling) << "RooSimWSTool::executeBuild: list of prototype pdfs " << physModelSet << std::endl ;
405 }
406
407 RooArgSet splitCatSet(obc._usedSplitCats) ;
408 if (physCat) splitCatSet.add(*physCat) ;
409
410 RooArgSet splitCatSetFund ;
411 for(auto * scat : static_range_cast<RooAbsCategory*>(splitCatSet)) {
412 if (scat->isFundamental()) {
413 splitCatSetFund.add(*scat) ;
414 } else {
415 std::unique_ptr<RooArgSet> scatvars{scat->getVariables()};
416 splitCatSetFund.add(*scatvars) ;
417 }
418 }
419
420
421 RooAbsCategoryLValue* masterSplitCat = nullptr;
422 if (splitCatSetFund.size()>1) {
423 auto masterSplitCatOwner = std::make_unique<RooSuperCategory>("masterSplitCat","Master splitting category",splitCatSetFund);
424 masterSplitCat = masterSplitCatOwner.get();
425 cleanupList.addOwned(std::move(masterSplitCatOwner));
426 } else {
427 masterSplitCat = static_cast<RooAbsCategoryLValue*>(splitCatSetFund.first()) ;
428 }
429 if (verbose) {
430 oocoutI(nullptr, ObjectHandling) << "RooSimWSTool::executeBuild: list of splitting categories " << splitCatSet << std::endl ;
431 }
432
433 RooArgSet splitNodeListOwned ; // owns all newly created components
434 RooArgSet splitNodeListAll ; // all leaf nodes, preload with ws contents to auto-connect existing specializations
435 std::vector<std::unique_ptr<RooCustomizer>> customizerList ;
436
437 // Loop over requested physics models and build components
438 for(auto * physModel : static_range_cast<RooAbsPdf*>(physModelSet)) {
439 if (verbose) {
440 oocoutI(nullptr, ObjectHandling) << "RooSimPdfBuilder::executeBuild: processing prototype pdf " << physModel->GetName() << std::endl ;
441 }
442
443 customizerList.push_back(std::make_unique<RooCustomizer>(*physModel,*masterSplitCat,splitNodeListOwned,&splitNodeListAll));
444 RooCustomizer* physCustomizer = customizerList.back().get();
445
446 map<RooAbsArg*, pair<RooArgSet,string> >::iterator splitIter ;
447 for (splitIter = obc._pdfmap[physModel]._paramSplitMap.begin() ; splitIter != obc._pdfmap[physModel]._paramSplitMap.end() ; ++splitIter) {
448
449 // If split is composite, first make multicategory with name 'A,B,C' and insert in WS
450
451 // Construct name of (composite) split category (function)
452 RooArgSet& splitCatSetTmp = splitIter->second.first ;
453 string splitName = makeSplitName(splitCatSetTmp) ;
454
455 // If composite split object does not exist yet, create it now
456 RooAbsCategory* splitCat = _ws->catfunc(splitName) ;
457 if (!splitCat) {
458 auto splitCatOwner = std::make_unique<RooMultiCategory>(splitName.c_str(),splitName.c_str(),splitCatSetTmp);
459 splitCat = splitCatOwner.get();
460 _ws->import(*splitCat,RooFit::Silence(!verbose)) ;
461 cleanupList.addOwned(std::move(splitCatOwner)) ;
462 }
463
464 // If remainder category needs to be made, create RFV of appropriate for that and insert in WS
465 if(!splitIter->second.second.empty()) {
466
467 // Check that specified split name is in fact valid
468 if (!splitCat->hasLabel(splitIter->second.second)) {
469 oocoutE(nullptr, InputArguments) << "RooSimWSTool::executeBuild() ERROR: name of remainder state for constrained split, '"
470 << splitIter->second.second << "' , does not match any state name of (composite) split category " << splitCat->GetName() << std::endl ;
471 return nullptr;
472 }
473
474 // First build manually the specializations of all non-remainder states, as the remainder state depends on these
475 RooArgSet fracLeafList ;
476 for(auto const& type : *splitCat) {
477
478 std::string const& typeName = type.first;
479
480 // Skip remainder state
481 if (splitIter->second.second == typeName) continue ;
482
483 // Construct name of split leaf
484 std::string splitLeafName = std::string{splitIter->first->GetName()} + "_" + typeName;
485
486 // Check if split leaf already exists
487 RooAbsArg* splitLeaf = _ws->fundArg(splitLeafName) ;
488 if (!splitLeaf) {
489 // If not create it now
490 splitLeaf = static_cast<RooAbsArg*>(splitIter->first->clone(splitLeafName.c_str()));
491 _ws->import(*splitLeaf,RooFit::Silence(!verbose)) ;
492 }
493 fracLeafList.add(*splitLeaf) ;
494 }
495
496
497 // Build specialization for remainder state and insert in workspace
498 auto fracRem = std::make_unique<RooFracRemainder>(Form("%s_%s",splitIter->first->GetName(),splitIter->second.second.c_str()),"Remainder fraction",fracLeafList);
499 _ws->import(*fracRem) ;
500 cleanupList.addOwned(std::move(fracRem));
501
502 }
503
504
505 // Add split definition to customizer
506 physCustomizer->splitArgs(*splitIter->first,*splitCat) ;
507 }
508 }
509
510 // List all existing workspace components as prebuilt items for the customizers at this point
511 splitNodeListAll.add(_ws->components()) ;
512
513 if (verbose) {
514 oocoutI(nullptr, ObjectHandling) << "RooSimWSTool::executeBuild: configured customizers for all prototype pdfs" << std::endl ;
515 }
516
517 // Create fit category from physCat and splitCatList ;
518 RooArgSet fitCatList ;
519 if (physCat) fitCatList.add(*physCat) ;
520
521 // Add observables of splitCatSet members, rather than splitCatSet members directly
522 // as there may be cat->cat functions in here
523 for(auto * scat : static_range_cast<RooAbsCategory*>(splitCatSet)) {
524 if (scat->isFundamental()) {
525 fitCatList.add(*scat) ;
526 } else {
527 fitCatList.add(*std::unique_ptr<RooArgSet>{scat->getVariables()}) ;
528 }
529 }
530
531
532 string mcatname = string(simPdfName) + "_index" ;
533 RooAbsCategoryLValue* fitCat = nullptr;
534 if (fitCatList.size()>1) {
535 auto fitCatOwner = std::make_unique<RooSuperCategory>(mcatname.c_str(),mcatname.c_str(),fitCatList);
536 fitCat = fitCatOwner.get();
537 cleanupList.addOwned(std::move(fitCatOwner));
538 } else {
539 fitCat = static_cast<RooAbsCategoryLValue*>(fitCatList.first()) ;
540 }
541
542 // Create master PDF
543 auto simPdfOwner = std::make_unique<RooSimultaneous>(simPdfName,simPdfName,*fitCat);
544 RooSimultaneous* simPdf = simPdfOwner.get();
545 cleanupList.addOwned(std::move(simPdfOwner));
546
547 // Add component PDFs to master PDF
548 for (auto const& fcState : *fitCat) {
549 const std::string fcStateName = fcState.first;
550
551 // Select fitCat state
552 fitCat->setLabel(fcStateName.c_str());
553
554 // Check if this fitCat state is selected
555 bool select(false) ;
556 if (!obc._restr.empty()) {
557 for(auto * splitCat : static_range_cast<RooAbsCategory*>(fitCatList)) {
558 // Find selected state list
559
560 list<const RooCatType*> slist = obc._restr[splitCat] ;
561 if (slist.empty()) {
562 continue ;
563 }
564
565 list<const RooCatType*>::iterator sli ;
566 for (sli=slist.begin() ; sli!=slist.end() ; ++sli) {
567 if (string(splitCat->getCurrentLabel())==(*sli)->GetName()) {
568 select=true ;
569 }
570 }
571 }
572 if (!select) continue ;
573 } else {
574 select = true ;
575 }
576
577 // Select appropriate PDF for this physCat state
578 RooCustomizer* physCustomizer ;
579 if (physCat) {
580 RooAbsPdf* pdf = stateMap[physCat->getCurrentLabel()] ;
581 if (pdf==nullptr) {
582 continue ;
583 }
584 const std::string pdfName = pdf->GetName();
585 auto found = std::find_if(customizerList.begin(), customizerList.end(),
586 [&](auto const& c){ return pdfName == c->pdf().GetName(); });
587 physCustomizer = found != customizerList.end() ? found->get() : nullptr;
588 } else {
589 physCustomizer = customizerList.front().get();
590 }
591
592 if (verbose) {
593 oocoutI(nullptr, ObjectHandling) << "RooSimWSTool::executeBuild: Customizing prototype pdf " << physCustomizer->pdf().GetName()
594 << " for mode " << fcStateName << std::endl ;
595 }
596
597 // Customizer PDF for current state and add to master simPdf
598 RooAbsPdf* fcPdf = static_cast<RooAbsPdf*>(physCustomizer->build(masterSplitCat->getCurrentLabel(),false)) ;
599 simPdf->addPdf(*fcPdf,fcStateName.c_str()) ;
600 }
601
602 _ws->import(*simPdf,obc._conflProtocol,RooFit::Silence(!verbose)) ;
603
604 // Delete customizers
605 return static_cast<RooSimultaneous*>(_ws->pdf(simPdf->GetName())) ;
606}
607
608
609
610////////////////////////////////////////////////////////////////////////////////
611/// Construct name of composite split
612
613std::string RooSimWSTool::makeSplitName(const RooArgSet& splitCatSet)
614{
615 std::string name ;
616
617 bool first=true ;
618 for(RooAbsArg * arg : splitCatSet) {
619 if (first) {
620 first=false;
621 } else {
622 name += "," ;
623 }
624 name += arg->GetName() ;
625 }
626
627 return name ;
628}
629
630
631
632
633////////////////////////////////////////////////////////////////////////////////
634/// Specify that parameters names listed in paramNameList be split in (product of) category(s)
635/// listed in categoryNameList
636
637void RooSimWSTool::SplitRule::splitParameter(const char* paramNameList, const char* categoryNameList)
638{
639 char paramBuf[4096] ;
640 char catBuf[4096] ;
641 strlcpy(paramBuf,paramNameList,4096) ;
642 strlcpy(catBuf,categoryNameList,4096) ;
643
644 // First parse category list
645 list<string> catList ;
646 char* cat = strtok(catBuf,"{,}") ;
647 while(cat) {
648 catList.push_back(cat) ;
649 cat = strtok(nullptr,"{,}") ;
650 }
651
652 // Now parse parameter list
653 char* param = strtok(paramBuf,"{,}") ;
654 while(param) {
655 _paramSplitMap[param] = pair<list<string>,string>(catList,"") ;
656 param = strtok(nullptr,"{,}") ;
657 }
658}
659
660
661////////////////////////////////////////////////////////////////////////////////
662/// Specify that parameters names listed in paramNameList be split in constrained way in (product of) category(s)
663/// listed in categoryNameList and that remainder fraction formula be put in state with name remainderStateName
664
665void RooSimWSTool::SplitRule::splitParameterConstrained(const char* paramNameList, const char* categoryNameList, const char* remainderStateName)
666{
667 char paramBuf[4096] ;
668 char catBuf[4096] ;
669 strlcpy(paramBuf,paramNameList,4096) ;
670 strlcpy(catBuf,categoryNameList,4096) ;
671
672 // First parse category list
673 list<string> catList ;
674 char* cat = strtok(catBuf,"{,}") ;
675 while(cat) {
676 catList.push_back(cat) ;
677 cat = strtok(nullptr,"{,}") ;
678 }
679
680 // Now parse parameter list
681 char* param = strtok(paramBuf,"{,}") ;
682 while(param) {
683 _paramSplitMap[param] = pair<list<string>,string>(catList,remainderStateName) ;
684 param = strtok(nullptr,"{,}") ;
685 }
686}
687
688
689////////////////////////////////////////////////////////////////////////////////
690/// Construct the SplitRule object from a list of named arguments past to RooSimWSTool::build
691/// This method parses any SplitParam and SplitParamComstrained argument in the list
692
693void RooSimWSTool::SplitRule::configure(const RooCmdArg& arg1,const RooCmdArg& arg2,const RooCmdArg& arg3,
694 const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
695{
696 list<const RooCmdArg*> cmdList ;
697 cmdList.push_back(&arg1) ; cmdList.push_back(&arg2) ;
698 cmdList.push_back(&arg3) ; cmdList.push_back(&arg4) ;
699 cmdList.push_back(&arg5) ; cmdList.push_back(&arg6) ;
700
701 list<const RooCmdArg*>::iterator iter ;
702 for (iter=cmdList.begin() ; iter!=cmdList.end() ; ++iter) {
703
704 if ((*iter)->opcode()==nullptr) continue ;
705
706 string name = (*iter)->opcode() ;
707
708 if (name=="SplitParam") {
709 splitParameter((*iter)->getString(0),(*iter)->getString(1)) ;
710 } else if (name=="SplitParamConstrained") {
711 splitParameterConstrained((*iter)->getString(0),(*iter)->getString(1),(*iter)->getString(2)) ;
712 }
713 }
714}
715
716
717
718
719////////////////////////////////////////////////////////////////////////////////
720/// Add prototype p.d.f pdfName to build configuration with associated split rules 'sr'
721
723{
724 internalAddPdf(pdfName,"",sr) ;
725}
726
727
728////////////////////////////////////////////////////////////////////////////////
729/// Construct build configuration from single prototype 'pdfName' and list of arguments
730/// that can be passed to RooSimWSTool::build() method. This routine parses SplitParam()
731/// SplitParamConstrained() and Restrict() arguments.
732
733RooSimWSTool::BuildConfig::BuildConfig(const char* pdfName, const RooCmdArg& arg1,const RooCmdArg& arg2,
734 const RooCmdArg& arg3,const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
735{
736 SplitRule sr(pdfName) ;
737 sr.configure(arg1,arg2,arg3,arg4,arg5,arg6) ;
738 internalAddPdf(pdfName,"",sr) ;
739 _conflProtocol = RooFit::RenameConflictNodes(pdfName) ;
740
741 list<const RooCmdArg*> cmdList ;
742 cmdList.push_back(&arg1) ; cmdList.push_back(&arg2) ;
743 cmdList.push_back(&arg3) ; cmdList.push_back(&arg4) ;
744 cmdList.push_back(&arg5) ; cmdList.push_back(&arg6) ;
745
746 list<const RooCmdArg*>::iterator iter ;
747 for (iter=cmdList.begin() ; iter!=cmdList.end() ; ++iter) {
748 if ((*iter)->opcode()==nullptr) continue ;
749 string name = (*iter)->opcode() ;
750 if (name=="Restrict") {
751 restrictBuild((*iter)->getString(0),(*iter)->getString(1)) ;
752 }
753 if (name=="RenameConflictNodes") {
754 _conflProtocol = *(*iter) ;
755 }
756 }
757}
758
759
760////////////////////////////////////////////////////////////////////////////////
761/// Constructor to make BuildConfig from legacy RooSimPdfBuilder configuration
762/// Empty for now
763
765{
766}
767
768
769////////////////////////////////////////////////////////////////////////////////
770/// Internal routine to add prototype pdf 'pdfName' with list of associated master states 'miStateNameList
771/// and split rules 'sr' to configuration
772
773void RooSimWSTool::BuildConfig::internalAddPdf(const char* pdfName, const char* miStateNameList,SplitRule& sr)
774{
775 char buf[4096] ;
776 strlcpy(buf,miStateNameList,4096) ;
777
778 char* tok = strtok(buf,",") ;
779 while(tok) {
780 sr._miStateNameList.push_back(tok) ;
781 tok = strtok(nullptr,",") ;
782 }
783
784 _pdfmap[pdfName] = sr ;
785}
786
787
788////////////////////////////////////////////////////////////////////////////////
789/// Restrict build by only considering state names in stateList for split in category catName
790
791void RooSimWSTool::BuildConfig::restrictBuild(const char* catName, const char* stateList)
792{
793 _restr[catName] = stateList ;
794}
795
796
797
798
799////////////////////////////////////////////////////////////////////////////////
800/// Construct MultiBuildConfig for build configuration with multiple prototype p.d.f.s
801/// masterIndexCat is the name of the master index category that decides which
802/// prototype is used.
803
805{
806 _masterCatName = masterIndexCat ;
807}
808
809
810
811////////////////////////////////////////////////////////////////////////////////
812/// Add protytpe p.d.f 'pdfName' to MultiBuildConfig associated with master index states 'miStateList'. This
813/// method parses the SplitParam() and SplitParamConstrained() arguments
814
815void RooSimWSTool::MultiBuildConfig::addPdf(const char* miStateList, const char* pdfName, const RooCmdArg& arg1,const RooCmdArg& arg2,
816 const RooCmdArg& arg3,const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
817{
818 SplitRule sr(pdfName) ;
819 sr.configure(arg1,arg2,arg3,arg4,arg5,arg6) ;
820 internalAddPdf(pdfName,miStateList,sr) ;
821}
822
823
824
825////////////////////////////////////////////////////////////////////////////////
826/// Add protytpe p.d.f 'pdfName' to MultiBuildConfig associated with master index states 'miStateList'.
827
828void RooSimWSTool::MultiBuildConfig::addPdf(const char* miStateList, const char* pdfName, SplitRule& sr)
829{
830 internalAddPdf(pdfName,miStateList,sr) ;
831}
832
833
834
835
836////////////////////////////////////////////////////////////////////////////////
837/// Destructor
838
842
843
844
845
846////////////////////////////////////////////////////////////////////////////////
847/// Print details of a validated build configuration
848
850{
851 // --- Dump contents of object build config ---
852 map<RooAbsPdf*,ObjSplitRule>::iterator ri ;
853 for (ri = _pdfmap.begin() ; ri != _pdfmap.end() ; ++ri ) {
854 std::cout << "Splitrule for p.d.f " << ri->first->GetName() << " with state list " ;
855 for (std::list<const RooCatType*>::iterator misi= ri->second._miStateList.begin() ; misi!=ri->second._miStateList.end() ; ++misi) {
856 std::cout << (*misi)->GetName() << " " ;
857 }
858 std::cout << std::endl ;
859
860 map<RooAbsArg*,pair<RooArgSet,string> >::iterator csi ;
861 for (csi = ri->second._paramSplitMap.begin() ; csi != ri->second._paramSplitMap.end() ; ++csi ) {
862 if (!csi->second.second.empty()) {
863 std::cout << " parameter " << csi->first->GetName() << " is split with constraint in categories "
864 << csi->second.first << " with remainder in state " << csi->second.second << std::endl;
865 } else {
866 std::cout << " parameter " << csi->first->GetName() << " is split with constraint in categories "
867 << csi->second.first << std::endl;
868 }
869 }
870 }
871
872 map<RooAbsCategory*,list<const RooCatType*> >::iterator riter ;
873 for (riter=_restr.begin() ; riter!=_restr.end() ; ++riter) {
874 std::cout << "Restricting build in category " << riter->first->GetName() << " to states " ;
875 list<const RooCatType*>::iterator i ;
876 for (i=riter->second.begin() ; i!=riter->second.end() ; ++i) {
877 if (i!=riter->second.begin()) std::cout << "," ;
878 std::cout << (*i)->GetName() ;
879 }
880 std::cout << std::endl ;
881 }
882
883}
884
885
886namespace {
887
888////////////////////////////////////////////////////////////////////////////////
889
890std::string SimWSIFace::create(RooFactoryWSTool& ft, const char* typeName, const char* instanceName, std::vector<std::string> args)
891{
892 string tn(typeName) ;
893 if (tn=="SIMCLONE") {
894
895 // Perform syntax check. Warn about any meta parameters other than $SplitParam, $SplitParamConstrained, $Restrict and $Verbose
896 for (unsigned int i=1 ; i<args.size() ; i++) {
897 if (args[i].find("$SplitParam(")!=0 &&
898 args[i].find("$SplitParamConstrained(")!=0 &&
899 args[i].find("$SplitRestrict(")!=0 &&
900 args[i].find("$Verbose(")!=0) {
901 throw string(Form("RooSimWSTool::SimWSIFace::create() ERROR: unknown token %s encountered",args[i].c_str())) ;
902 }
903 }
904
905 // Make SplitRule object from $SplitParam and $SplitParamConstrained arguments
906 RooSimWSTool::SplitRule sr(args[0].c_str()) ;
907 for (unsigned int i=1 ; i<args.size() ; i++) {
908 if (args[i].find("$SplitParam(")==0) {
909 vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
910 if (subargs.size()!=2) {
911 throw string(Form("Incorrect number of arguments in $SplitParam, have %d, expect 2",(Int_t)subargs.size())) ;
912 }
913 sr.splitParameter(subargs[0].c_str(),subargs[1].c_str()) ;
914 } else if (args[i].find("$SplitParamConstrained(")==0) {
915 vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
916 if (subargs.size()!=3) {
917 throw string(Form("Incorrect number of arguments in $SplitParamConstrained, have %d, expect 3",(Int_t)subargs.size())) ;
918 }
919 sr.splitParameterConstrained(subargs[0].c_str(), subargs[1].c_str(), subargs[2].c_str()) ;
920 }
921 }
922
923 // Make BuildConfig object
924 RooSimWSTool::BuildConfig bc(args[0].c_str(),sr) ;
925 for (unsigned int i=1 ; i<args.size() ; i++) {
926 if (args[i].find("$Restrict(")==0) {
927 vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
928 if (subargs.size()!=2) {
929 throw string(Form("Incorrect number of arguments in $Restrict, have %d, expect 2",(Int_t)subargs.size())) ;
930 }
931 bc.restrictBuild(subargs[0].c_str(),subargs[1].c_str()) ;
932 }
933 }
934
935 // Look for verbose flag
936 bool verbose(false) ;
937 for (unsigned int i=1 ; i<args.size() ; i++) {
938 if (args[i].find("$Verbose(")==0) {
939 vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
940 if (!subargs.empty()) {
941 verbose = atoi(subargs[0].c_str()) ;
942 }
943 }
944 }
945
946 // Build pdf clone
947 RooSimWSTool sct(ft.ws()) ;
948 RooAbsPdf* pdf = sct.build(instanceName,bc,verbose) ;
949 if (!pdf) {
950 throw string(Form("RooSimWSTool::SimWSIFace::create() error in RooSimWSTool::build() for %s",instanceName)) ;
951 }
952
953 // Import into workspace
954 ft.ws().import(*pdf,RooFit::Silence()) ;
955
956 } else if (tn=="MSIMCLONE") {
957
958 // First make a multibuild config from the master index cat
959 RooSimWSTool::MultiBuildConfig mbc(args[0].c_str()) ;
960
961 for (unsigned int i=1 ; i<args.size() ; i++) {
962 if (args[i].find("$AddPdf(")==0) {
963 // Process an add-pdf operation
964 vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
965
966 // Make SplitRule object from $SplitParam and $SplitParamConstrained arguments
967 RooSimWSTool::SplitRule sr(subargs[1].c_str()) ;
968 for (unsigned int j=2 ; j<subargs.size() ; j++) {
969 if (subargs[j].find("$SplitParam(")==0) {
970 vector<string> subsubargs = ft.splitFunctionArgs(subargs[j].c_str()) ;
971 if (subsubargs.size()!=2) {
972 throw string(Form("Incorrect number of arguments in $SplitParam, have %d, expect 2",(Int_t)subsubargs.size())) ;
973 }
974 sr.splitParameter(subsubargs[0].c_str(),subsubargs[1].c_str()) ;
975 } else if (subargs[j].find("$SplitParamConstrained(")==0) {
976 vector<string> subsubargs = ft.splitFunctionArgs(subargs[j].c_str()) ;
977 if (subsubargs.size()!=3) {
978 throw string(Form("Incorrect number of arguments in $SplitParamConstrained, have %d, expect 3",(Int_t)subsubargs.size())) ;
979 }
980 sr.splitParameterConstrained(subsubargs[0].c_str(), subsubargs[1].c_str(), subsubargs[2].c_str()) ;
981 }
982 }
983 mbc.addPdf(subargs[0].c_str(),subargs[1].c_str(),sr) ;
984
985 } else if (args[i].find("$Restrict(")==0) {
986
987 // Process a restrict operation
988 vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
989 if (subargs.size()!=2) {
990 throw string(Form("Incorrect number of arguments in $Restrict, have %d, expect 2",(Int_t)subargs.size())) ;
991 }
992 mbc.restrictBuild(subargs[0].c_str(),subargs[1].c_str()) ;
993
994 } else {
995 throw string(Form("RooSimWSTool::SimWSIFace::create() ERROR: unknown token in MSIMCLONE: %s",args[i].c_str())) ;
996 }
997 }
998
999 // Build pdf clone
1000 RooSimWSTool sct(ft.ws()) ;
1001 RooAbsPdf* pdf = sct.build(instanceName,mbc,false) ;
1002 if (!pdf) {
1003 throw string(Form("RooSimWSTool::SimWSIFace::create() error in RooSimWSTool::build() for %s",instanceName)) ;
1004 }
1005
1006 // Import into workspace
1007 ft.ws().import(*pdf,RooFit::Silence()) ;
1008
1009
1010 } else {
1011 throw string(Form("RooSimWSTool::SimWSIFace::create() ERROR: Unknown meta-type %s requested",typeName)) ;
1012 }
1013
1014 return string(instanceName) ;
1015}
1016
1017} // namespace
#define c(i)
Definition RSha256.hxx:101
#define oocoutE(o, a)
#define oocoutI(o, a)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:142
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2571
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Abstract base class for objects that represent a discrete value that can be set from the outside,...
A space to attach TBranches.
const RooCatType * lookupType(value_type index, bool printError=false) const
Find our type corresponding to the specified index, or return nullptr for no match.
const char * GetName() const override
Returns name of object.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
RooAbsArg * first() const
const_iterator begin() const
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:32
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
RooCatType is an auxiliary class for RooAbsCategory and defines a a single category state.
const Text_t * GetName() const override
Returns name of object.
Object to represent discrete states.
Definition RooCategory.h:28
Named container for two doubles, two integers two object points and three string pointers that can be...
Definition RooCmdArg.h:26
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
Implementation detail of the RooWorkspace.
static void registerSpecial(const char *typeName, RooFactoryWSTool::IFace *iface)
Register foreign special objects in factory.
void restrictBuild(const char *catName, const char *stateList)
Restrict build by only considering state names in stateList for split in category catName.
void internalAddPdf(const char *pdfName, const char *miStateList, SplitRule &sr)
Internal routine to add prototype pdf 'pdfName' with list of associated master states 'miStateNameLis...
void addPdf(const char *miStateList, const char *pdfName, SplitRule &sr)
Add protytpe p.d.f 'pdfName' to MultiBuildConfig associated with master index states 'miStateList'.
MultiBuildConfig(const char *masterIndexCat)
Construct MultiBuildConfig for build configuration with multiple prototype p.d.f.s masterIndexCat is ...
void print()
Print details of a validated build configuration.
virtual ~ObjSplitRule()
Destructor.
void splitParameter(const char *paramList, const char *categoryList)
Specify that parameters names listed in paramNameList be split in (product of) category(s) listed in ...
std::list< std::string > _miStateNameList
void splitParameterConstrained(const char *paramNameList, const char *categoryNameList, const char *remainderStateName)
Specify that parameters names listed in paramNameList be split in constrained way in (product of) cat...
std::map< std::string, std::pair< std::list< std::string >, std::string > > _paramSplitMap
void configure(const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={})
Construct the SplitRule object from a list of named arguments past to RooSimWSTool::build This method...
The RooSimWSTool is a tool operating on RooWorkspace objects that can clone PDFs into a series of var...
RooSimultaneous * build(const char *simPdfName, const char *protoPdfName, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={})
Build a RooSimultaneous PDF with name simPdfName from cloning specializations of protytpe PDF protoPd...
RooWorkspace * _ws
std::unique_ptr< ObjBuildConfig > validateConfig(BuildConfig &bc)
Validate build configuration.
RooSimWSTool(RooWorkspace &ws)
Constructor of SimWSTool on given workspace.
RooSimultaneous * executeBuild(const char *simPdfName, ObjBuildConfig &obc, bool verbose=true)
Internal build driver from validation ObjBuildConfig.
std::string makeSplitName(const RooArgSet &splitCatSet)
Construct name of composite split.
~RooSimWSTool()
Destructor.
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
Persistable container for RooFit projects.
RooAbsCategory * catfunc(RooStringView name) const
Retrieve discrete function (RooAbsCategory) with given name. A null pointer is returned if not found.
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooCategory * cat(RooStringView name) const
Retrieve discrete variable (RooCategory) with given name. A null pointer is returned if not found.
RooAbsArg * fundArg(RooStringView name) const
Return fundamental (i.e.
const RooArgSet & components() const
bool import(const RooAbsArg &arg, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
RooCmdArg Silence(bool flag=true)
RooCmdArg RenameConflictNodes(const char *suffix, bool renameOrigNodes=false)