80 _plotCoefNormSet(
"!plotCoefNormSet",
"plotCoefNormSet",this,
kFALSE,
kFALSE),
81 _plotCoefNormRange(0),
83 _indexCat(
"indexCat",
"Index category",this,inIndexCat),
104 _indexCat(
"indexCat",
"Index category",this,inIndexCat),
109 <<
" ERROR: Number PDF list entries must match number of index category states, no PDFs added" << endl ;
113 map<string,RooAbsPdf*> pdfMap ;
121 pdfMap[string(type->
GetName())] = pdf ;
138 _indexCat(
"indexCat",
"Index category",this,inIndexCat),
162 for (map<string,RooAbsPdf*>::iterator iter=pdfMap.begin() ; iter!=pdfMap.end() ; ++iter) {
163 if (dynamic_cast<RooSimultaneous*>(iter->second)) {
171 for (map<string,RooAbsPdf*>::iterator iter=pdfMap.begin() ; iter!=pdfMap.end() ; ++iter) {
172 addPdf(*iter->second,iter->first.c_str()) ;
178 coutI(
InputArguments) <<
"RooSimultaneous::initialize(" <<
GetName() <<
") INFO: one or more input component of simultaneous p.d.f.s are" 179 <<
" simultaneous p.d.f.s themselves, rewriting composite expressions as one-level simultaneous p.d.f. in terms of" 180 <<
" final constituents and extended index category" << endl ;
184 map<string,RooSimultaneousAux::CompInfo> compMap ;
185 for (map<string,RooAbsPdf*>::iterator iter=pdfMap.begin() ; iter!=pdfMap.end() ; ++iter) {
186 RooSimultaneousAux::CompInfo ci ;
187 ci.pdf = iter->second ;
190 ci.simPdf = simComp ;
191 ci.subIndex = &simComp->
indexCat() ;
193 allAuxCats.
add(*(ci.subIndexComps),
kTRUE) ;
197 ci.subIndexComps = 0 ;
199 compMap[iter->first] = ci ;
204 allCats.
add(allAuxCats) ;
209 for (map<string,RooSimultaneousAux::CompInfo>::iterator citer = compMap.begin() ; citer != compMap.end() ; ++citer) {
212 if (citer->second.subIndexComps) {
213 repliCats.
remove(*citer->second.subIndexComps) ;
214 delete citer->second.subIndexComps ;
216 inIndexCat.
setLabel(citer->first.c_str()) ;
219 if (!citer->second.simPdf) {
231 string superLabel = superIndex->
getLabel() ;
232 addPdf(*citer->second.pdf,superLabel.c_str()) ;
234 <<
") assigning pdf " << citer->second.pdf->GetName() <<
" to super label " << superLabel << endl ;
244 TIterator* titer = citer->second.subIndex->typeIterator() ;
248 string superLabel = superIndex->
getLabel() ;
251 addPdf(*compPdf,superLabel.c_str()) ;
253 <<
") assigning pdf " << compPdf->
GetName() <<
"(member of " << citer->second.pdf->GetName()
254 <<
") to super label " << superLabel << endl ;
257 << type->
GetName() <<
" for component RooSimultaneous p.d.f " << citer->second.pdf->GetName()
258 <<
"which is associated with master index label " << citer->first << endl ;
271 TIterator* tsiter = citer->second.subIndex->typeIterator() ;
278 string superLabel = superIndex->
getLabel() ;
281 addPdf(*compPdf,superLabel.c_str()) ;
283 <<
") assigning pdf " << compPdf->
GetName() <<
"(member of " << citer->second.pdf->GetName()
284 <<
") to super label " << superLabel << endl ;
287 << stype->
GetName() <<
" for component RooSimultaneous p.d.f " << citer->second.pdf->GetName()
288 <<
"which is associated with master index label " << citer->first << endl ;
374 << catLabel <<
" has already an associated PDF" << endl ;
382 <<
") ERROR: you cannot add a RooSimultaneous component to a RooSimultaneous using addPdf()." 383 <<
" Use the constructor with RooArgList if input p.d.f.s or the map<string,RooAbsPdf&> instead." << endl ;
448 if (proxy==0)
return 0 ;
462 catFrac=nEvtCat/nEvtTot ;
498 if (proxy==0)
return 0 ;
513 const RooArgSet* normSet,
const char* rangeName)
const 516 analVars.
add(allVars) ;
609 const char* sliceCatState = pc.
getString(
"sliceCatState",0,
kTRUE) ;
620 strlcpy(buf,sliceCatState,1024) ;
621 const char* slabel = strtok(buf,
",") ;
633 slabel = strtok(0,
",") ;
640 coutE(
InputArguments) <<
"RooSimultaneous::plotOn(" <<
GetName() <<
") ERROR: must have a projection dataset for index category" << endl ;
654 while((sliceArg=(
RooAbsArg*)iter->Next())) {
657 projectedVars.
remove(*arg) ;
660 << sliceArg->
GetName() <<
" was not projected anyway" << endl ;
664 }
else if (projSet) {
678 coutE(
Plotting) <<
"RooSimultaneous::plotOn(" <<
GetName() <<
") ERROR: Projection over index category " 679 <<
"requested, but projection data set doesn't contain index category" << endl ;
698 projIdxServers.
add(*server) ;
718 <<
") ERROR: Projection dataset doesn't contain complete set of index category dependents" << endl ;
734 <<
" represents a slice in the index category (" <<
_indexCat.
arg().
GetName() <<
")" << endl ;
751 cutString.Append(
"&&") ;
764 delete indexCatComps ;
779 if (!cmdList.
find(
"Asymmetry")) {
780 cmdList2.
Add(&tmp1) ;
782 cmdList2.
Add(&tmp2) ;
822 idxCompSliceIter->
Reset() ;
839 pdfCompList.
add(proxy->
arg()) ;
842 TString plotVarName(
GetName()) ;
843 RooAddPdf *plotVar =
new RooAddPdf(plotVarName,
"weighted sum of RS components",pdfCompList,wgtCompList) ;
856 if (idxCompSliceSet->
getSize()>0) {
857 idxCompSliceIter->
Reset() ;
862 cutString.Append(
"&&") ;
876 if (idxCompSliceSet->
getSize()>0) {
885 projSetTmp.
add(*projSet) ;
890 delete idxCatServers ;
896 <<
" represents a slice in index category components " << *idxCompSliceSet << endl ;
900 if (idxCompProjSet->
getSize()>0) {
902 <<
" averages with data index category components " << *idxCompProjSet << endl ;
904 delete idxCompProjSet ;
917 if (!cmdList.
find(
"Asymmetry")) {
918 cmdList2.
Add(&tmp1) ;
920 cmdList2.
Add(&tmp2) ;
926 cmdList2.
Add(&tmp3) ;
927 frame2 = plotVar->
plotOn(frame,cmdList2) ;
930 frame2 = plotVar->
plotOn(frame,cmdList2) ;
938 delete idxCompSliceIter ;
939 delete idxCompSliceSet ;
942 if (projDataTmp)
delete projDataTmp ;
1006 if (vars.
find(idxCatName) && prototype==0 && (auxProto==0 || auxProto->
getSize()==0) && (autoBinned || (binnedTag && strlen(binnedTag)))) {
1014 return genContext(vars,prototype,auxProto,verbose) ;
1027 const RooArgSet* protoVars = prototype ? prototype->
get() : 0 ;
1029 if (vars.
find(idxCatName) || (protoVars && protoVars->
find(idxCatName))) {
1058 }
else if (!allServers && anyServer) {
1060 coutE(
Plotting) <<
"RooSimultaneous::genContext: ERROR: prototype must include either all " 1061 <<
" components of the RooSimultaneous index category or none " << endl ;
1071 <<
") ERROR: no PDF associated with current state (" 1086 Bool_t correctForBinVolume,
1087 Bool_t showProgress)
const 1090 correctForBinVolume, showProgress) == 0)
1124 for (
Int_t i=0 ; i<nEvents ; i++) {
1137 *globClone = *tmp->
get(0) ;
1143 data->
add(*globClone) ;
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
virtual const char * GetName() const
Returns name of object.
const char * label() const
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual void selectNormalizationRange(const char *rangeName=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of range for interpretation of fraction c...
RooSetProxy _plotCoefNormSet
static long int sum(long int i)
virtual void selectNormalization(const RooArgSet *depSet=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of observables for interpretation of frac...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
RooCmdArg DrawOption(const char *opt)
RooCategoryProxy _indexCat
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
virtual const RooArgSet * get() const
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
virtual const RooArgSet * get() const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
Double_t getVal(const RooArgSet *set=0) const
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Return specialized generator contenxt for simultaneous p.d.f.s.
TObject * find(const char *name) const
Return pointer to object with given name in collection.
void set(Double_t weight, Double_t wgtErr=-1)
Increment the weight of the bin enclosing the coordinates given by 'row' by the specified amount...
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)=0
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Return analytical integration defined by given code.
T * getObjByIndex(Int_t index) const
const TNamed * _plotCoefNormRange
RooCmdArg Project(const RooArgSet &projSet)
RooAbsData * reduce(const RooCmdArg &arg1, 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())
Create a reduced copy of this dataset.
virtual ExtendMode extendMode() const
WVE NEEDS FIX.
RooCmdArg ProjWData(const RooAbsData &projData, Bool_t binData=kFALSE)
virtual Double_t evaluate() const
Return the current value: the value of the PDF associated with the current index category state...
void allowUndefined(Bool_t flag=kTRUE)
virtual Int_t getIndex() const
Return index number of current state.
virtual RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, Double_t scaleFactor, Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
virtual RooPlot * plotOn(RooPlot *frame, 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(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none(), const RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Plot (project) PDF on specified frame.
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
Iterator abstract base class.
Bool_t mustBeExtended() const
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set value by specifying the name of the desired state If printError is set, a message will be printed...
RooObjCacheManager _partIntMgr
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, Double_t scaleFactor, Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const
Fill a RooDataHist with values sampled from this function at the bin centers.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
RooDataSet is a container class to hold N-dimensional binned data.
Int_t numTypes(const char *=0) const
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Bool_t addPdf(const RooAbsPdf &pdf, const char *catLabel)
Associate given PDF with index category state label 'catLabel'.
void initialize(RooAbsCategoryLValue &inIndexCat, std::map< std::string, RooAbsPdf *> pdfMap)
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Forward determination of analytical integration capabilities to component p.d.f.s A unique code is as...
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
const RooAbsCategory & arg() const
virtual Double_t weight() const
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
virtual RooAbsGenContext * autoGenContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE, Bool_t autoBinned=kTRUE, const char *binnedTag="") const
const RooArgSet * getNormVars() const
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return the number of expected events: If the index is in nset, then return the sum of the expected ev...
RooRealVar represents a fundamental (non-derived) real valued object.
virtual Bool_t isFundamental() const
virtual Bool_t setArg(RooAbsCategory &newRef)
Change object held in proxy into newRef.
virtual const char * name() const
virtual void Add(TObject *arg)
void makeProjectionSet(const RooAbsArg *plotVar, const RooArgSet *allVars, RooArgSet &projectedVars, Bool_t silent) const
Utility function for plotOn() that constructs the set of observables to project when plotting ourselv...
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, 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(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables listed in ...
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
friend class RooSimSplitGenContext
TIterator * typeIterator() const
Return iterator over all defined states.
RooAbsArg * at(Int_t idx) const
virtual const Text_t * GetName() const
Returns name of object.
const RooAbsCategoryLValue & indexCat() const
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
char * Form(const char *fmt,...)
RooAbsArg * absArg() const
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const char * getLabel() const
Return label string of current state.
RooDataSet is a container class to hold unbinned data.
RooCategory represents a fundamental (non-derived) discrete value object.
Bool_t canBeExtended() const
TIterator * serverIterator() const
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set...
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements...
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual Int_t numEntries() const
Return the number of bins.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
RooCmdArg Normalization(Double_t scaleFactor)
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
Mother of all ROOT objects.
virtual RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of 'global observables' – for RooStats tools...
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
virtual ~RooSimultaneous()
Destructor.
friend class RooRealProxy
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual Bool_t isDerived() const
virtual void Add(TObject *obj)
RooAbsRealLValue * getPlotVar() const
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
virtual TObject * Next()=0
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1, 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 RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
static constexpr double pc
RooSuperCategory consolidates several RooAbsCategoryLValue objects into a single category.
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
RooArgSet * _normSet
Normalization integral (owned by _normMgr)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Bool_t contains(const RooAbsArg &var) const
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), Bool_t force=kTRUE)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
const RooAbsReal & arg() const
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set the value of the super category by specifying the state name by setting the state names of the co...
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
Double_t getFrac(const char *label, Bool_t silent=kFALSE) const
Return the fraction of entries in the table contained in the slot named 'label'.
friend class RooSimGenContext
Bool_t plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
Roo1DTable implements a one-dimensional table.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
virtual Roo1DTable * table(const RooArgSet &catSet, const char *cuts="", const char *opts="") const
Construct table for product of categories in catSet.