ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SPlot.cxx
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer 28/07/2008
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /*****************************************************************************
13  * Project: RooStats
14  * Package: RooFit/RooStats
15  *
16  * Authors:
17  * Original code from M. Pivk as part of MLFit package from BaBar.
18  * Modifications:
19  * Giacinto Piacquadio, Maurizio Pierini: modifications for new RooFit version
20  * George H. Lewis, Kyle Cranmer: generalized for weighted events
21  *
22  * Porting to RooStats (with permission) by Kyle Cranmer, July 2008
23  *
24  *****************************************************************************/
25 
26 
27 
28 #include <vector>
29 #include <map>
30 
31 #include "RooStats/SPlot.h"
32 #include "RooAbsPdf.h"
33 #include "RooDataSet.h"
34 #include "RooRealVar.h"
35 #include "RooGlobalFunc.h"
36 #include "TTree.h"
37 #include "RooStats/RooStatsUtils.h"
38 
39 
40 #include "TMatrixD.h"
41 
42 
44 
45 using namespace RooStats;
46 using namespace std;
47 
48 
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 
53 {
54  if(TestBit(kOwnData) && fSData)
55  delete fSData;
56 
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// Default constructor
61 
63  TNamed()
64 {
65  RooArgList Args;
66 
67  fSWeightVars = Args;
68 
69  fSData = NULL;
70 
71 }
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 
75 SPlot::SPlot(const char* name, const char* title):
76  TNamed(name, title)
77 {
78  RooArgList Args;
79 
80  fSWeightVars = Args;
81 
82  fSData = NULL;
83 
84 }
85 
86 ////////////////////////////////////////////////////////////////////////////////
87 ///Constructor from a RooDataSet
88 ///No sWeighted variables are present
89 
90 SPlot::SPlot(const char* name, const char* title, const RooDataSet &data):
91  TNamed(name, title)
92 {
93  RooArgList Args;
94 
95  fSWeightVars = Args;
96 
97  fSData = (RooDataSet*) &data;
98 }
99 
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// Copy Constructor from another SPlot
103 
104 SPlot::SPlot(const SPlot &other):
105  TNamed(other)
106 {
107  RooArgList Args = (RooArgList) other.GetSWeightVars();
108 
109  fSWeightVars.addClone(Args);
110 
111  fSData = (RooDataSet*) other.GetSDataSet();
112 
113 }
114 
115 
116 ////////////////////////////////////////////////////////////////////////////////
117 
118 SPlot::SPlot(const char* name, const char* title, RooDataSet& data, RooAbsPdf* pdf,
119  const RooArgList &yieldsList, const RooArgSet &projDeps,
120  bool includeWeights, bool cloneData, const char* newName):
121  TNamed(name, title)
122 {
123  if(cloneData == 1) {
124  fSData = (RooDataSet*) data.Clone(newName);
125  SetBit(kOwnData);
126  }
127  else
128  fSData = (RooDataSet*) &data;
129 
130  // Add check that yieldsList contains all RooRealVars
131  TIterator* iter = yieldsList.createIterator() ;
132  RooAbsArg* arg ;
133  while((arg=(RooAbsArg*)iter->Next())) {
134  if (!dynamic_cast<RooRealVar*>(arg)) {
135  coutE(InputArguments) << "SPlot::SPlot(" << GetName() << ") input argument "
136  << arg->GetName() << " is not of type RooRealVar " << endl ;
137  throw string(Form("SPlot::SPlot(%s) input argument %s is not of type RooRealVar",GetName(),arg->GetName())) ;
138  }
139  }
140  delete iter ;
141 
142  //Construct a new SPlot class,
143  //calculate sWeights, and include them
144  //in the RooDataSet of this class.
145 
146  this->AddSWeight(pdf, yieldsList, projDeps, includeWeights);
147 }
148 
149 
150 ////////////////////////////////////////////////////////////////////////////////
151 
153 {
154  if(data) {
155  fSData = (RooDataSet*) data;
156  return fSData;
157  } else
158  return NULL;
159 }
160 
161 ////////////////////////////////////////////////////////////////////////////////
162 
164 {
165  return fSData;
166 }
167 
168 ////////////////////////////////////////////////////////////////////////////////
169 
170 Double_t SPlot::GetSWeight(Int_t numEvent, const char* sVariable) const
171 {
172  if(numEvent > fSData->numEntries() )
173  {
174  coutE(InputArguments) << "Invalid Entry Number" << endl;
175  return -1;
176  }
177 
178  if(numEvent < 0)
179  {
180  coutE(InputArguments) << "Invalid Entry Number" << endl;
181  return -1;
182  }
183 
184  Double_t totalYield = 0;
185 
186  std::string varname(sVariable);
187  varname += "_sw";
188 
189 
190  if(fSWeightVars.find(sVariable) )
191  {
192  RooArgSet Row(*fSData->get(numEvent));
193  totalYield += Row.getRealValue(sVariable);
194 
195  return totalYield;
196  }
197 
198  if( fSWeightVars.find(varname.c_str()) )
199  {
200 
201  RooArgSet Row(*fSData->get(numEvent));
202  totalYield += Row.getRealValue(varname.c_str() );
203 
204  return totalYield;
205  }
206 
207  else
208  coutE(InputArguments) << "InputVariable not in list of sWeighted variables" << endl;
209 
210  return -1;
211 }
212 
213 
214 ////////////////////////////////////////////////////////////////////////////////
215 
217 {
218  //Sum the SWeights for a particular event.
219  //This sum should equal the total weight of that event.
220  //This method is intended to be used as a check.
221 
222 
223  if(numEvent > fSData->numEntries() )
224  {
225  coutE(InputArguments) << "Invalid Entry Number" << endl;
226  return -1;
227  }
228 
229  if(numEvent < 0)
230  {
231  coutE(InputArguments) << "Invalid Entry Number" << endl;
232  return -1;
233  }
234 
235  Int_t numSWeightVars = this->GetNumSWeightVars();
236 
237  Double_t eventSWeight = 0;
238 
239  RooArgSet Row(*fSData->get(numEvent));
240 
241  for (Int_t i = 0; i < numSWeightVars; i++)
242  eventSWeight += Row.getRealValue(fSWeightVars.at(i)->GetName() );
243 
244  return eventSWeight;
245 }
246 
247 
248 ////////////////////////////////////////////////////////////////////////////////
249 
250 Double_t SPlot::GetYieldFromSWeight(const char* sVariable) const
251 {
252 
253  //Sum the SWeights for a particular specie over all events
254  //This should equal the total (weighted) yield of that specie
255  //This method is intended as a check.
256 
257  Double_t totalYield = 0;
258 
259  std::string varname(sVariable);
260  varname += "_sw";
261 
262 
263  if(fSWeightVars.find(sVariable) )
264  {
265  for(Int_t i=0; i < fSData->numEntries(); i++)
266  {
267  RooArgSet Row(*fSData->get(i));
268  totalYield += Row.getRealValue(sVariable);
269  }
270 
271  return totalYield;
272  }
273 
274  if( fSWeightVars.find(varname.c_str()) )
275  {
276  for(Int_t i=0; i < fSData->numEntries(); i++)
277  {
278  RooArgSet Row(*fSData->get(i));
279  totalYield += Row.getRealValue(varname.c_str() );
280  }
281 
282  return totalYield;
283  }
284 
285  else
286  coutE(InputArguments) << "InputVariable not in list of sWeighted variables" << endl;
287 
288  return -1;
289 }
290 
291 
292 ////////////////////////////////////////////////////////////////////////////////
293 
295 {
296  //Return a RooArgList containing the SWeights
297 
298  RooArgList Args = fSWeightVars;
299 
300  return Args;
301 
302 }
303 
304 ////////////////////////////////////////////////////////////////////////////////
305 ///Return the number of SWeights
306 ///In other words, return the number of
307 ///species that we are trying to extract.
308 
310 {
311  RooArgList Args = fSWeightVars;
312 
313  return Args.getSize();
314 }
315 
316 
317 ////////////////////////////////////////////////////////////////////////////////
318 
319 void SPlot::AddSWeight( RooAbsPdf* pdf, const RooArgList &yieldsTmp,
320  const RooArgSet &projDeps, bool includeWeights)
321 {
322  //
323  // Method which adds the sWeights to the dataset.
324  // Input is the PDF, a RooArgList of the yields (floating)
325  // and a RooArgSet of the projDeps.
326  //
327  // The projDeps will not be normalized over when calculating the SWeights
328  // and will be considered parameters, not observables.
329  //
330  // The SPlot will contain two new variables for each specie of name "varname":
331  //
332  // L_varname is the value of the pdf for the variable "varname" at values of this event
333  // varname_sw is the value of the sWeight for the variable "varname" for this event
334 
335  // Find Parameters in the PDF to be considered fixed when calculating the SWeights
336  // and be sure to NOT include the yields in that list
337  //
338 
339 
341 
342  RooArgList* constParameters = (RooArgList*)pdf->getParameters(fSData) ;
343  constParameters->remove(yieldsTmp, kTRUE, kTRUE);
344 
345 
346  // Set these parameters constant and store them so they can later
347  // be set to not constant
348  std::vector<RooRealVar*> constVarHolder;
349 
350  for(Int_t i = 0; i < constParameters->getSize(); i++)
351  {
352  RooRealVar* varTemp = ( dynamic_cast<RooRealVar*>( constParameters->at(i) ) );
353  if(varTemp && varTemp->isConstant() == 0 )
354  {
355  varTemp->setConstant();
356  constVarHolder.push_back(varTemp);
357  }
358  }
359 
360  // Fit yields to the data with all other variables held constant
361  // This is necessary because SPlot assumes the yields minimixe -Log(likelihood)
362 
364 
365  // Hold the value of the fitted yields
366  std::vector<double> yieldsHolder;
367 
368  for(Int_t i = 0; i < yieldsTmp.getSize(); i++)
369  yieldsHolder.push_back( ((RooRealVar*) yieldsTmp.at(i))->getVal());
370 
371  Int_t nspec = yieldsTmp.getSize();
372  RooArgList yields = *(RooArgList*)yieldsTmp.snapshot(kFALSE);
373 
374  if(currentLevel <= RooFit::DEBUG)
375  {
376  coutI(InputArguments) << "Printing Yields" << endl;
377  yields.Print();
378  }
379 
380  // The list of variables to normalize over when calculating PDF values.
381 
382  RooArgSet vars(*fSData->get() );
383  vars.remove(projDeps, kTRUE, kTRUE);
384 
385  // Attach data set
386 
387  // const_cast<RooAbsPdf*>(pdf)->attachDataSet(*fSData);
388 
389  pdf->attachDataSet(*fSData);
390 
391  // first calculate the pdf values for all species and all events
392  std::vector<RooRealVar*> yieldvars ;
393  RooArgSet* parameters = pdf->getParameters(fSData) ;
394 
395  std::vector<Double_t> yieldvalues ;
396  for (Int_t k = 0; k < nspec; ++k)
397  {
398  RooRealVar* thisyield = dynamic_cast<RooRealVar*>(yields.at(k)) ;
399  if (thisyield) {
400  RooRealVar* yieldinpdf = dynamic_cast<RooRealVar*>(parameters->find(thisyield->GetName() )) ;
401 
402  if (yieldinpdf) {
403  coutI(InputArguments)<< "yield in pdf: " << yieldinpdf->GetName() << " " << thisyield->getVal() << endl;
404 
405  yieldvars.push_back(yieldinpdf) ;
406  yieldvalues.push_back(thisyield->getVal()) ;
407  }
408  }
409  }
410 
411  Int_t numevents = fSData->numEntries() ;
412 
413  std::vector<std::vector<Double_t> > pdfvalues(numevents,std::vector<Double_t>(nspec,0)) ;
414 
415 
416  // set all yield to zero
417  for(Int_t m=0; m<nspec; ++m) yieldvars[m]->setVal(0) ;
418 
419 
420  // For every event and for every specie,
421  // calculate the value of the component pdf for that specie
422  // by setting the yield of that specie to 1
423  // and all others to 0. Evaluate the pdf for each event
424  // and store the values.
425 
426  RooArgSet * pdfvars = pdf->getVariables();
427 
428  for (Int_t ievt = 0; ievt <numevents; ievt++)
429  {
430  // if (ievt % 100 == 0)
431  // coutP(Eval) << ".";
432 
433 
434  //FIX THIS PART, EVALUATION PROGRESS!!
435 
436  RooStats::SetParameters(fSData->get(ievt), pdfvars);
437 
438  // RooArgSet row(*fSData->get(ievt));
439 
440  for(Int_t k = 0; k < nspec; ++k)
441  {
442  //Check that range of yields is at least (0,1), and fix otherwise
443  if(yieldvars[k]->getMin() > 0)
444  {
445  coutW(InputArguments) << "Minimum Range for " << yieldvars[k]->GetName() << " must be 0. ";
446  coutW(InputArguments) << "Setting min range to 0" << std::endl;
447  yieldvars[k]->setMin(0);
448  }
449 
450  if(yieldvars[k]->getMax() < 1)
451  {
452  coutW(InputArguments) << "Maximum Range for " << yieldvars[k]->GetName() << " must be 1. ";
453  coutW(InputArguments) << "Setting max range to 1" << std::endl;
454  yieldvars[k]->setMax(1);
455  }
456 
457  // set this yield to 1
458  yieldvars[k]->setVal( 1 ) ;
459  // evaluate the pdf
460  Double_t f_k = pdf->getVal(&vars) ;
461  pdfvalues[ievt][k] = f_k ;
462  if( !(f_k>1 || f_k<1) )
463  coutW(InputArguments) << "Strange pdf value: " << ievt << " " << k << " " << f_k << std::endl ;
464  yieldvars[k]->setVal( 0 ) ;
465  }
466  }
467  delete pdfvars;
468 
469  // check that the likelihood normalization is fine
470  std::vector<Double_t> norm(nspec,0) ;
471  for (Int_t ievt = 0; ievt <numevents ; ievt++)
472  {
473  Double_t dnorm(0) ;
474  for(Int_t k=0; k<nspec; ++k) dnorm += yieldvalues[k] * pdfvalues[ievt][k] ;
475  for(Int_t j=0; j<nspec; ++j) norm[j] += pdfvalues[ievt][j]/dnorm ;
476  }
477 
478  coutI(Contents) << "likelihood norms: " ;
479 
480  for(Int_t k=0; k<nspec; ++k) coutI(Contents) << norm[k] << " " ;
481  coutI(Contents) << std::endl ;
482 
483  // Make a TMatrixD to hold the covariance matrix.
484  TMatrixD covInv(nspec, nspec);
485  for (Int_t i = 0; i < nspec; i++) for (Int_t j = 0; j < nspec; j++) covInv(i,j) = 0;
486 
487  coutI(Contents) << "Calculating covariance matrix";
488 
489 
490  // Calculate the inverse covariance matrix, using weights
491  for (Int_t ievt = 0; ievt < numevents; ++ievt)
492  {
493 
494  fSData->get(ievt) ;
495 
496  // Calculate contribution to the inverse of the covariance
497  // matrix. See BAD 509 V2 eqn. 15
498 
499  // Sum for the denominator
500  Double_t dsum(0);
501  for(Int_t k = 0; k < nspec; ++k)
502  dsum += pdfvalues[ievt][k] * yieldvalues[k] ;
503 
504  for(Int_t n=0; n<nspec; ++n)
505  for(Int_t j=0; j<nspec; ++j)
506  {
507  if(includeWeights == kTRUE)
508  covInv(n,j) += fSData->weight()*pdfvalues[ievt][n]*pdfvalues[ievt][j]/(dsum*dsum) ;
509  else
510  covInv(n,j) += pdfvalues[ievt][n]*pdfvalues[ievt][j]/(dsum*dsum) ;
511  }
512 
513  //ADDED WEIGHT ABOVE
514 
515  }
516 
517  // Covariance inverse should now be computed!
518 
519  // Invert to get the covariance matrix
520  if (covInv.Determinant() <=0)
521  {
522  coutE(Eval) << "SPlot Error: covariance matrix is singular; I can't invert it!" << std::endl;
523  covInv.Print();
524  return;
525  }
526 
527  TMatrixD covMatrix(TMatrixD::kInverted,covInv);
528 
529  //check cov normalization
530  if(currentLevel <= RooFit::DEBUG)
531  {
532  coutI(Eval) << "Checking Likelihood normalization: " << std::endl;
533  coutI(Eval) << "Yield of specie Sum of Row in Matrix Norm" << std::endl;
534  for(Int_t k=0; k<nspec; ++k)
535  {
536  Double_t covnorm(0) ;
537  for(Int_t m=0; m<nspec; ++m) covnorm += covInv[k][m]*yieldvalues[m] ;
538  Double_t sumrow(0) ;
539  for(Int_t m = 0; m < nspec; ++m) sumrow += covMatrix[k][m] ;
540  coutI(Eval) << yieldvalues[k] << " " << sumrow << " " << covnorm << endl ;
541  }
542  }
543 
544  // calculate for each event the sWeight (BAD 509 V2 eq. 21)
545  coutI(Eval) << "Calculating sWeight" << std::endl;
546  std::vector<RooRealVar*> sweightvec ;
547  std::vector<RooRealVar*> pdfvec ;
548  RooArgSet sweightset ;
549 
550  // Create and label the variables
551  // used to store the SWeights
552 
554 
555  for(Int_t k=0; k<nspec; ++k)
556  {
557  std::string wname = std::string(yieldvars[k]->GetName()) + "_sw";
558  RooRealVar* var = new RooRealVar(wname.c_str(),wname.c_str(),0) ;
559  sweightvec.push_back( var) ;
560  sweightset.add(*var) ;
561  fSWeightVars.add(*var);
562 
563  wname = "L_" + std::string(yieldvars[k]->GetName());
564  var = new RooRealVar(wname.c_str(),wname.c_str(),0) ;
565  pdfvec.push_back( var) ;
566  sweightset.add(*var) ;
567  }
568 
569  // Create and fill a RooDataSet
570  // with the SWeights
571 
572  RooDataSet* sWeightData = new RooDataSet("dataset", "dataset with sWeights", sweightset);
573 
574  for(Int_t ievt = 0; ievt < numevents; ++ievt)
575  {
576 
577  fSData->get(ievt) ;
578 
579  // sum for denominator
580  Double_t dsum(0);
581  for(Int_t k = 0; k < nspec; ++k) dsum += pdfvalues[ievt][k] * yieldvalues[k] ;
582  // covariance weighted pdf for each specief
583  for(Int_t n=0; n<nspec; ++n)
584  {
585  Double_t nsum(0) ;
586  for(Int_t j=0; j<nspec; ++j) nsum += covMatrix(n,j) * pdfvalues[ievt][j] ;
587 
588 
589  //Add the sWeights here!!
590  //Include weights,
591  //ie events weights are absorbed into sWeight
592 
593 
594  if(includeWeights == kTRUE) sweightvec[n]->setVal(fSData->weight() * nsum/dsum) ;
595  else sweightvec[n]->setVal( nsum/dsum) ;
596 
597  pdfvec[n]->setVal( pdfvalues[ievt][n] ) ;
598 
599  if( !(fabs(nsum/dsum)>=0 ) )
600  {
601  coutE(Contents) << "error: " << nsum/dsum << endl ;
602  return;
603  }
604  }
605 
606  sWeightData->add(sweightset) ;
607  }
608 
609 
610  // Add the SWeights to the original data set
611 
612  fSData->merge(sWeightData);
613 
614  delete sWeightData;
615 
616  //Restore yield values
617 
618  for(Int_t i = 0; i < yieldsTmp.getSize(); i++)
619  ((RooRealVar*) yieldsTmp.at(i))->setVal(yieldsHolder.at(i));
620 
621  //Make any variables that were forced to constant no longer constant
622 
623  for(Int_t i=0; i < (Int_t) constVarHolder.size(); i++)
624  constVarHolder.at(i)->setConstant(kFALSE);
625 
626  return;
627 
628 }
virtual void Clear(Option_t *="")
Definition: TObject.h:110
#define coutE(a)
Definition: RooMsgService.h:35
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
Int_t GetNumSWeightVars() const
Return the number of SWeights In other words, return the number of species that we are trying to extr...
Definition: SPlot.cxx:309
#define coutI(a)
Definition: RooMsgService.h:32
RooCmdArg PrintLevel(Int_t code)
Double_t GetSumOfEventSWeight(Int_t numEvent) const
Definition: SPlot.cxx:216
void SetParameters(const RooArgSet *desiredVals, RooArgSet *paramsToChange)
Definition: RooStatsUtils.h:69
RooCmdArg PrintEvalErrors(Int_t numErrors)
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: Rtypes.h:92
static RooMsgService & instance()
Return reference to singleton instance.
#define coutW(a)
Definition: RooMsgService.h:34
RooCmdArg Extended(Bool_t flag=kTRUE)
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables...
Definition: RooAbsArg.cxx:1497
Iterator abstract base class.
Definition: TIterator.h:32
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
Double_t GetYieldFromSWeight(const char *sVariable) const
Definition: SPlot.cxx:250
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:2082
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
TIterator * createIterator(Bool_t dir=kIterForward) const
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
void AddSWeight(RooAbsPdf *pdf, const RooArgList &yieldsTmp, const RooArgSet &projDeps=RooArgSet(), bool includeWeights=kTRUE)
Definition: SPlot.cxx:319
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Definition: RooAbsArg.cxx:560
RooDataSet * fSData
Definition: SPlot.h:100
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:37
RooFit::MsgLevel globalKillBelow() const
void Print(Option_t *name="") const
Print the matrix as a table of elements.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
RooAbsArg * find(const char *name) const
Find object with given name in list.
ClassImp(RooStats::SPlot)
virtual Double_t weight() const
Return event weight of current event.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void setConstant(Bool_t value=kTRUE)
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual Int_t numEntries() const
Definition: RooAbsData.cxx:293
TMarker * m
Definition: textangle.C:8
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
Double_t GetSWeight(Int_t numEvent, const char *sVariable) const
Definition: SPlot.cxx:170
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...
Bool_t isConstant() const
Definition: RooAbsArg.h:266
RooCmdArg SumW2Error(Bool_t flag)
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
double Double_t
Definition: RtypesCore.h:55
RooDataSet * GetSDataSet() const
Definition: SPlot.cxx:163
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
Bool_t merge(RooDataSet *data1, RooDataSet *data2=0, RooDataSet *data3=0, RooDataSet *data4=0, RooDataSet *data5=0, RooDataSet *data6=0)
RooDataSet * SetSData(RooDataSet *data)
Definition: SPlot.cxx:152
virtual TObject * Next()=0
#define NULL
Definition: Rtypes.h:82
virtual Double_t Determinant() const
Return the matrix determinant.
Definition: TMatrixT.cxx:1353
SPlot()
Default constructor.
Definition: SPlot.cxx:62
virtual RooFitResult * fitTo(RooAbsData &data, 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())
Fit PDF to given dataset.
Definition: RooAbsPdf.cxx:1056
Int_t getSize() const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
RooArgList GetSWeightVars() const
Definition: SPlot.cxx:294
RooArgList fSWeightVars
Definition: SPlot.h:96
const Bool_t kTRUE
Definition: Rtypes.h:91
double norm(double *x, double *p)
Definition: unuranDistr.cxx:40
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Definition: RooDataSet.h:64
This class calculates sWeights used to create an sPlot.
Definition: SPlot.h:58
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
const Int_t n
Definition: legend1.C:16
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
Definition: RooArgSet.cxx:448
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.
Definition: RooArgSet.cxx:527