Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooSimWSTool.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $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#ifndef ROO_SIM_WS_TOOL_HH
18#define ROO_SIM_WS_TOOL_HH
19
20#include "Rtypes.h"
21#include "RooWorkspace.h"
22#include "RooCmdArg.h"
23
24#include <list>
25#include <map>
26#include <string>
27#include <vector>
28
30class RooAbsCategory;
31class RooAbsArg;
32class RooAbsPdf;
33class RooCatType;
34class RooSimultaneous;
35
36
37// Workspace oriented tool for customized cloning of p.d.f. into a simultaneous p.d.f
39
40public:
41
42 // Constructors, assignment etc
45
46 class BuildConfig ;
47 class MultiBuildConfig ;
48 class SplitRule ;
49
50 class ObjBuildConfig ;
51 class ObjSplitRule ;
52
53 RooSimultaneous* build(const char* simPdfName, const char* protoPdfName,
54 const RooCmdArg& arg1={},const RooCmdArg& arg2={},
55 const RooCmdArg& arg3={},const RooCmdArg& arg4={},
56 const RooCmdArg& arg5={},const RooCmdArg& arg6={}) ;
57
58 RooSimultaneous* build(const char* simPdfName,BuildConfig& bc, bool verbose=true) ;
59
60
61protected:
62
64
65 std::unique_ptr<ObjBuildConfig> validateConfig(BuildConfig& bc) ;
66 RooSimultaneous* executeBuild(const char* simPdfName,ObjBuildConfig& obc, bool verbose=true) ;
67 std::string makeSplitName(const RooArgSet& splitCatSet) ;
68
70
71} ;
72
73
74// Split rule specification for prototype p.d.f
76public:
77 SplitRule(const char* pdfName="") : TNamed(pdfName,pdfName) {} ;
78 void splitParameter(const char* paramList, const char* categoryList) ;
79 void splitParameterConstrained(const char* paramNameList, const char* categoryNameList, const char* remainderStateName) ;
80
81protected:
82
83 friend class RooSimWSTool ;
84 friend class BuildConfig ;
85 friend class MultiBuildConfig ;
86 void configure(const RooCmdArg& arg1={},const RooCmdArg& arg2={},
87 const RooCmdArg& arg3={},const RooCmdArg& arg4={},
88 const RooCmdArg& arg5={},const RooCmdArg& arg6={}) ;
89
90 std::list<std::string> _miStateNameList ;
91 std::map<std::string, std::pair<std::list<std::string>,std::string> > _paramSplitMap ; //<paramName,<std::list<splitCatSet>,remainderStateName>>
92} ;
93
94
95// Build configuration object for RooSimWSTool
97{
98 public:
99 BuildConfig(const char* pdfName, SplitRule& sr) ;
100 BuildConfig(const char* pdfName, const RooCmdArg& arg1={},const RooCmdArg& arg2={},
101 const RooCmdArg& arg3={},const RooCmdArg& arg4={},
102 const RooCmdArg& arg5={},const RooCmdArg& arg6={}) ;
103
104 BuildConfig(const RooArgSet& legacyBuildConfig) ;
105
106 virtual ~BuildConfig() {} ;
107 void restrictBuild(const char* catName, const char* stateList) ;
108
109 protected:
111 friend class RooSimWSTool ;
112 std::string _masterCatName ;
113 std::map<std::string,SplitRule> _pdfmap ;
114 std::map<std::string,std::string> _restr ;
116
117 void internalAddPdf(const char* pdfName, const char* miStateList, SplitRule& sr) ;
118
119 } ;
120
121
122// Build configuration object for RooSimWSTool with multiple prototype p.d.f.
124{
125 public:
126 MultiBuildConfig(const char* masterIndexCat) ;
127 void addPdf(const char* miStateList, const char* pdfName, SplitRule& sr) ;
128 void addPdf(const char* miStateList, const char* pdfName,
129 const RooCmdArg& arg1={},const RooCmdArg& arg2={},
130 const RooCmdArg& arg3={},const RooCmdArg& arg4={},
131 const RooCmdArg& arg5={},const RooCmdArg& arg6={}) ;
132
133 protected:
134 friend class RooSimWSTool ;
135
136 } ;
137
138
139// Validated RooSimWSTool split rule
141public:
143 virtual ~ObjSplitRule() ;
144
145protected:
146 friend class RooSimWSTool ;
148 std::list<const RooCatType*> _miStateList ;
149 std::map<RooAbsArg*, std::pair<RooArgSet,std::string> > _paramSplitMap ; //<paramName,<std::list<splitCatSet>,remainderStateName>>
150 } ;
151
152
153// Validated RooSimWSTool build configuration
155{
156 public:
158 virtual ~ObjBuildConfig() {}
159 void print() ;
160
161 protected:
162 friend class RooSimWSTool ;
163 std::map<RooAbsPdf*,ObjSplitRule> _pdfmap ;
164 std::map<RooAbsCategory*,std::list<const RooCatType*> > _restr ;
168
169 } ;
170
171#endif
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:79
Abstract base class for objects that represent a discrete value that can be set from the outside,...
A space to attach TBranches.
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
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.
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
void restrictBuild(const char *catName, const char *stateList)
Restrict build by only considering state names in stateList for split in category catName.
std::map< std::string, SplitRule > _pdfmap
std::map< std::string, std::string > _restr
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'.
std::map< RooAbsPdf *, ObjSplitRule > _pdfmap
void print()
Print details of a validated build configuration.
std::map< RooAbsCategory *, std::list< const RooCatType * > > _restr
virtual ~ObjSplitRule()
Destructor.
std::map< RooAbsArg *, std::pair< RooArgSet, std::string > > _paramSplitMap
std::list< const RooCatType * > _miStateList
void splitParameter(const char *paramList, const char *categoryList)
Specify that parameters names listed in paramNameList be split in (product of) category(s) listed in ...
SplitRule(const char *pdfName="")
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...
RooWorkspace * _ws
std::unique_ptr< ObjBuildConfig > validateConfig(BuildConfig &bc)
Validate build configuration.
RooSimultaneous * executeBuild(const char *simPdfName, ObjBuildConfig &obc, bool verbose=true)
Internal build driver from validation ObjBuildConfig.
RooSimWSTool(const RooSimWSTool &)
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...
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.
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29