Logo ROOT   6.08/07
Reference Guide
SPlot.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer 21/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 #ifndef RooStats_SPlot
13 #define RooStats_SPlot
14 
15 class RooAbsReal;
16 class RooAbsPdf;
17 class RooFitResult;
18 class RooRealVar;
19 class RooSimultaneous;
20 
21 
22 #ifndef ROO_MSG_SERVICE
23 #include "RooMsgService.h"
24 #endif
25 
26 #include "RooFitResult.h"
27 #include "RooRealVar.h"
28 #include "RooHist.h"
29 #include "RooPlot.h"
30 #include "RooDataSet.h"
31 
32 namespace RooStats{
33 
34 
35 /**
36 
37  \ingroup Roostats
38 
39  This class calculates sWeights used to create an sPlot.
40  The code is based on
41  ``SPlot: A statistical tool to unfold data distributions,''
42  Nucl. Instrum. Meth. A 555, 356 (2005) [arXiv:physics/0402083].
43 
44  An SPlot gives us the distribution of some variable, x in our
45  data sample for a given species (eg. signal or background).
46  The result is similar to a likelihood projection plot, but no cuts are made,
47  so every event contributes to the distribution.
48 
49  To use this class, you first must have a pdf that includes
50  yields for (possibly several) different species.
51  Create an instance of the class by supplying a data set,
52  the pdf, and a list of the yield variables. The SPlot Class
53  will calculate SWeights and include these as columns in the RooDataSet.
54 
55 */
56 
57 
58  class SPlot: public TNamed {
59 
60  public:
61 
62  ~SPlot();
63  SPlot();
64  SPlot(const SPlot &other);
65  SPlot(const char* name, const char* title);
66  SPlot(const char* name, const char* title, const RooDataSet &data);
67  SPlot(const char* name, const char* title,RooDataSet& data, RooAbsPdf* pdf,
68  const RooArgList &yieldsList,const RooArgSet &projDeps=RooArgSet(),
69  bool includeWeights=kTRUE, bool copyDataSet = kFALSE, const char* newName = "");
70 
72 
73  RooDataSet* GetSDataSet() const;
74 
75  RooArgList GetSWeightVars() const;
76 
77  Int_t GetNumSWeightVars() const;
78 
79  void AddSWeight(RooAbsPdf* pdf, const RooArgList &yieldsTmp,
80  const RooArgSet &projDeps=RooArgSet(), bool includeWeights=kTRUE);
81 
82  Double_t GetSumOfEventSWeight(Int_t numEvent) const;
83 
84  Double_t GetYieldFromSWeight(const char* sVariable) const;
85 
86  Double_t GetSWeight(Int_t numEvent, const char* sVariable) const;
87 
88 
89 
90  protected:
91 
92  enum {
93  kOwnData = BIT(20)
94  };
95 
97 
98  // RooListProxy fSWeightVars;
99 
101 
102  ClassDef(SPlot,1) // Class used for making sPlots
103 
104 
105  };
106 
107 }
108 #endif
#define BIT(n)
Definition: Rtypes.h:120
RooDataSet * GetSDataSet() const
Definition: SPlot.cxx:163
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: Rtypes.h:92
Double_t GetYieldFromSWeight(const char *sVariable) const
Definition: SPlot.cxx:250
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Double_t GetSWeight(Int_t numEvent, const char *sVariable) const
Definition: SPlot.cxx:170
void AddSWeight(RooAbsPdf *pdf, const RooArgList &yieldsTmp, const RooArgSet &projDeps=RooArgSet(), bool includeWeights=kTRUE)
Definition: SPlot.cxx:319
RooDataSet * fSData
Definition: SPlot.h:100
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:37
RooArgList GetSWeightVars() const
Definition: SPlot.cxx:294
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
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
Namespace for the RooStats classes.
Definition: Asimov.h:20
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
RooDataSet * SetSData(RooDataSet *data)
Definition: SPlot.cxx:152
SPlot()
Default constructor.
Definition: SPlot.cxx:62
RooArgList fSWeightVars
Definition: SPlot.h:96
const Bool_t kTRUE
Definition: Rtypes.h:91
Double_t GetSumOfEventSWeight(Int_t numEvent) const
Definition: SPlot.cxx:216
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
This class calculates sWeights used to create an sPlot.
Definition: SPlot.h:58
char name[80]
Definition: TGX11.cxx:109