Logo ROOT  
Reference Guide
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 #include "RooFactoryWSTool.h"
24 #include <list>
25 #include <map>
26 #include <string>
27 #include <vector>
28 
30 class RooAbsCategory;
31 class RooAbsArg;
32 class RooAbsPdf;
33 class RooCatType;
34 class RooSimultaneous;
35 
36 
37 class RooSimWSTool : public TNamed, public RooPrintable {
38 
39 public:
40 
41  // Constructors, assignment etc
43  virtual ~RooSimWSTool() ;
44 
45  class BuildConfig ;
46  class MultiBuildConfig ;
47  class SplitRule ;
48 
49  class ObjBuildConfig ;
50  class ObjSplitRule ;
51 
52  RooSimultaneous* build(const char* simPdfName, const char* protoPdfName,
53  const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& arg2=RooCmdArg::none(),
54  const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=RooCmdArg::none(),
55  const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none()) ;
56 
57  RooSimultaneous* build(const char* simPdfName,BuildConfig& bc, Bool_t verbose=kTRUE) ;
58 
60  public:
61  virtual ~SimWSIFace() {} ;
62  std::string create(RooFactoryWSTool& ft, const char* typeName, const char* instanceName, std::vector<std::string> args) ;
63  } ;
64 
65 
66 protected:
67 
69 
71  RooSimultaneous* executeBuild(const char* simPdfName,ObjBuildConfig& obc, Bool_t verbose=kTRUE) ;
72  std::string makeSplitName(const RooArgSet& splitCatSet) ;
73 
75 
76  ClassDef(RooSimWSTool,0) // Workspace oriented tool for customized cloning of p.d.f. into a simultaneous p.d.f
77 } ;
78 
79 
81 public:
82  SplitRule(const char* pdfName="") : TNamed(pdfName,pdfName) {} ;
83  virtual ~SplitRule() {} ;
84  void splitParameter(const char* paramList, const char* categoryList) ;
85  void splitParameterConstrained(const char* paramNameList, const char* categoryNameList, const char* remainderStateName) ;
86 
87 protected:
88 
89  friend class RooSimWSTool ;
90  friend class BuildConfig ;
91  friend class MultiBuildConfig ;
92  void configure(const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& arg2=RooCmdArg::none(),
93  const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=RooCmdArg::none(),
94  const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none()) ;
95 
96  std::list<std::string> _miStateNameList ;
97  std::map<std::string, std::pair<std::list<std::string>,std::string> > _paramSplitMap ; //<paramName,<std::list<splitCatSet>,remainderStateName>>
98  ClassDef(SplitRule,0) // Split rule specification for prototype p.d.f
99 } ;
100 
101 
103 {
104  public:
105  BuildConfig(const char* pdfName, SplitRule& sr) ;
106  BuildConfig(const char* pdfName, const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& arg2=RooCmdArg::none(),
107  const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=RooCmdArg::none(),
108  const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none()) ;
109 
110  BuildConfig(const RooArgSet& legacyBuildConfig) ;
111 
112  virtual ~BuildConfig() {} ;
113  void restrictBuild(const char* catName, const char* stateList) ;
114 
115  protected:
116  BuildConfig() {} ;
117  friend class RooSimWSTool ;
118  std::string _masterCatName ;
119  std::map<std::string,SplitRule> _pdfmap ;
120  std::map<std::string,std::string> _restr ;
122 
123  void internalAddPdf(const char* pdfName, const char* miStateList, SplitRule& sr) ;
124 
125  ClassDef(BuildConfig,0) // Build configuration object for RooSimWSTool
126  } ;
127 
128 
130 {
131  public:
132  MultiBuildConfig(const char* masterIndexCat) ;
133  virtual ~MultiBuildConfig() {} ;
134  void addPdf(const char* miStateList, const char* pdfName, SplitRule& sr) ;
135  void addPdf(const char* miStateList, const char* pdfName,
136  const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& arg2=RooCmdArg::none(),
137  const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=RooCmdArg::none(),
138  const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none()) ;
139 
140  protected:
141  friend class RooSimWSTool ;
142 
143  ClassDef(MultiBuildConfig,0) // Build configuration object for RooSimWSTool with multiple prototype p.d.f.
144  } ;
145 
146 
147 
148 
149 
150 
152 public:
153  ObjSplitRule() {} ;
154  virtual ~ObjSplitRule() ;
155 
156 protected:
157  friend class RooSimWSTool ;
159  std::list<const RooCatType*> _miStateList ;
160  std::map<RooAbsArg*, std::pair<RooArgSet,std::string> > _paramSplitMap ; //<paramName,<std::list<splitCatSet>,remainderStateName>>
161  ClassDef(ObjSplitRule,0) // Validated RooSimWSTool split rule
162  } ;
163 
164 
166 {
167  public:
169  virtual ~ObjBuildConfig() {} ;
170  void print() ;
171 
172  protected:
173  friend class RooSimWSTool ;
174  std::map<RooAbsPdf*,ObjSplitRule> _pdfmap ;
175  std::map<RooAbsCategory*,std::list<const RooCatType*> > _restr ;
179 
180  ClassDef(ObjBuildConfig,0) // Validated RooSimWSTool build configuration
181  } ;
182 
183 #endif
RooSimWSTool::BuildConfig::_restr
std::map< std::string, std::string > _restr
Definition: RooSimWSTool.h:120
RooWorkspace.h
RooCmdArg
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:27
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooSimWSTool::SplitRule::configure
void configure(const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none())
Construct the SplitRule object from a list of named arguments past to RooSimWSTool::build This method...
Definition: RooSimWSTool.cxx:719
RooSimWSTool::SimWSIFace::create
std::string create(RooFactoryWSTool &ft, const char *typeName, const char *instanceName, std::vector< std::string > args)
Definition: RooSimWSTool.cxx:915
RooSimWSTool::SplitRule::splitParameterConstrained
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...
Definition: RooSimWSTool.cxx:691
RooSimWSTool::ObjBuildConfig::_usedSplitCats
RooArgSet _usedSplitCats
Definition: RooSimWSTool.h:177
RooSimWSTool::~RooSimWSTool
virtual ~RooSimWSTool()
Destructor.
Definition: RooSimWSTool.cxx:159
RooSimWSTool::RooSimWSTool
RooSimWSTool(RooWorkspace &ws)
Constructor of SimWSTool on given workspace.
Definition: RooSimWSTool.cxx:150
RooSimWSTool::ObjBuildConfig::_pdfmap
std::map< RooAbsPdf *, ObjSplitRule > _pdfmap
Definition: RooSimWSTool.h:174
RooSimWSTool::ObjBuildConfig::_masterCat
RooCategory * _masterCat
Definition: RooSimWSTool.h:176
RooSimWSTool::ObjBuildConfig::~ObjBuildConfig
virtual ~ObjBuildConfig()
Definition: RooSimWSTool.h:169
RooSimWSTool::BuildConfig::~BuildConfig
virtual ~BuildConfig()
Definition: RooSimWSTool.h:112
RooSimWSTool::ObjBuildConfig::print
void print()
Print details of a validated build configuration.
Definition: RooSimWSTool.cxx:875
RooSimWSTool::ObjBuildConfig::_restr
std::map< RooAbsCategory *, std::list< const RooCatType * > > _restr
Definition: RooSimWSTool.h:175
RooSimWSTool::SplitRule::SplitRule
SplitRule(const char *pdfName="")
Definition: RooSimWSTool.h:82
RooSimWSTool::RooSimWSTool
RooSimWSTool(const RooSimWSTool &)
RooPrintable
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
RooCmdArg::none
static const RooCmdArg & none()
Return reference to null argument.
Definition: RooCmdArg.cxx:52
RooSimWSTool::_ws
RooWorkspace * _ws
Definition: RooSimWSTool.h:74
bool
RooSimWSTool::build
RooSimultaneous * build(const char *simPdfName, const char *protoPdfName, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none())
Build a RooSimultaneous PDF with name simPdfName from cloning specializations of protytpe PDF protoPd...
Definition: RooSimWSTool.cxx:177
RooSimWSTool::BuildConfig::restrictBuild
void restrictBuild(const char *catName, const char *stateList)
Restrict build by only considering state names in stateList for split in category catName.
Definition: RooSimWSTool.cxx:817
RooSimWSTool::ObjBuildConfig::ObjBuildConfig
ObjBuildConfig()
Definition: RooSimWSTool.h:168
RooAbsCategory
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
Definition: RooAbsCategory.h:38
RooSimWSTool::SplitRule::~SplitRule
virtual ~SplitRule()
Definition: RooSimWSTool.h:83
RooSimWSTool::BuildConfig
Definition: RooSimWSTool.h:103
RooFactoryWSTool
RooFactoryWSTool is a class similar to TTree::MakeClass() that generates skeleton code for RooAbsPdf ...
Definition: RooFactoryWSTool.h:47
ws
void ws()
Definition: ws.C:66
RooFactoryWSTool.h
RooSimWSTool::ObjSplitRule::_miStateList
std::list< const RooCatType * > _miStateList
Definition: RooSimWSTool.h:159
RooSimWSTool::ObjBuildConfig
Definition: RooSimWSTool.h:166
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
RooSimWSTool::SplitRule::_miStateNameList
std::list< std::string > _miStateNameList
Definition: RooSimWSTool.h:96
TGeant4Unit::sr
static constexpr double sr
Definition: TGeant4SystemOfUnits.h:144
RooSimWSTool::BuildConfig::_masterCatName
std::string _masterCatName
Definition: RooSimWSTool.h:118
RooSimWSTool::validateConfig
ObjBuildConfig * validateConfig(BuildConfig &bc)
Validate build configuration.
Definition: RooSimWSTool.cxx:211
RooSimWSTool::MultiBuildConfig
Definition: RooSimWSTool.h:130
RooCmdArg.h
RooFactoryWSTool::IFace
Definition: RooFactoryWSTool.h:139
RooSimWSTool::ObjSplitRule
Definition: RooSimWSTool.h:151
RooSimWSTool::ObjSplitRule::ObjSplitRule
ObjSplitRule()
Definition: RooSimWSTool.h:153
RooWorkspace
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
RooSimWSTool::SimWSIFace::~SimWSIFace
virtual ~SimWSIFace()
Definition: RooSimWSTool.h:61
RooSimWSTool::ObjSplitRule::_paramSplitMap
std::map< RooAbsArg *, std::pair< RooArgSet, std::string > > _paramSplitMap
Definition: RooSimWSTool.h:160
RooSimWSTool::MultiBuildConfig::addPdf
void addPdf(const char *miStateList, const char *pdfName, SplitRule &sr)
Add protytpe p.d.f 'pdfName' to MultiBuildConfig associated with master indes states 'miStateList'.
Definition: RooSimWSTool.cxx:854
RooSimWSTool::BuildConfig::internalAddPdf
void internalAddPdf(const char *pdfName, const char *miStateList, SplitRule &sr)
Internal routine to add prototype pdf 'pdfName' with list of associated master states 'miStateNameLis...
Definition: RooSimWSTool.cxx:799
RooCategory
RooCategory is an object to represent discrete states.
Definition: RooCategory.h:27
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooSimWSTool::SplitRule
Definition: RooSimWSTool.h:80
RooSimWSTool::SplitRule::splitParameter
void splitParameter(const char *paramList, const char *categoryList)
Specify that parameters names listed in paramNameList be split in (product of) category(s) listed in ...
Definition: RooSimWSTool.cxx:663
RooCatType
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
Definition: RooCatTypeLegacy.h:23
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooSimWSTool::MultiBuildConfig::MultiBuildConfig
MultiBuildConfig(const char *masterIndexCat)
Construct MultiBuildConfig for build configuration with multiple prototype p.d.f.s masterIndexCat is ...
Definition: RooSimWSTool.cxx:830
RooSimWSTool::MultiBuildConfig::~MultiBuildConfig
virtual ~MultiBuildConfig()
Definition: RooSimWSTool.h:133
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooSimWSTool
The RooSimWSTool is a tool operating on RooWorkspace objects that can clone PDFs into a series of var...
Definition: RooSimWSTool.h:37
RooSimWSTool::BuildConfig::_conflProtocol
RooCmdArg _conflProtocol
Definition: RooSimWSTool.h:121
RooAbsPdf
Definition: RooAbsPdf.h:43
RooSimWSTool::BuildConfig::BuildConfig
BuildConfig()
Definition: RooSimWSTool.h:116
RooSimultaneous
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
Definition: RooSimultaneous.h:37
RooSimWSTool::SimWSIFace
Definition: RooSimWSTool.h:59
RooAbsCategoryLValue
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
Definition: RooAbsCategoryLValue.h:25
RooSimWSTool::executeBuild
RooSimultaneous * executeBuild(const char *simPdfName, ObjBuildConfig &obc, Bool_t verbose=kTRUE)
Internal build driver from validation ObjBuildConfig.
Definition: RooSimWSTool.cxx:398
Rtypes.h
RooSimWSTool::BuildConfig::_pdfmap
std::map< std::string, SplitRule > _pdfmap
Definition: RooSimWSTool.h:119
RooSimWSTool::ObjBuildConfig::_conflProtocol
RooCmdArg _conflProtocol
Definition: RooSimWSTool.h:178
RooSimWSTool::makeSplitName
std::string makeSplitName(const RooArgSet &splitCatSet)
Construct name of composite split.
Definition: RooSimWSTool.cxx:636
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
RooSimWSTool::ObjSplitRule::~ObjSplitRule
virtual ~ObjSplitRule()
Destructor.
Definition: RooSimWSTool.cxx:865
RooSimWSTool::SplitRule::_paramSplitMap
std::map< std::string, std::pair< std::list< std::string >, std::string > > _paramSplitMap
Definition: RooSimWSTool.h:97