Logo ROOT  
Reference Guide
TSPlot.h
Go to the documentation of this file.
1 // @(#)root/splot:$Id$
2 // Author: Muriel Pivk, Anna Kreshuk 10/2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 ROOT Foundation, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #ifndef ROOT_TSPlot
11 #define ROOT_TSPlot
12 
13 #include "TObjArray.h"
14 #include "TString.h"
15 #include "TMatrixT.h"
16 #include "TMatrixDfwd.h"
17 
18 class TH1D;
19 class TTree;
20 
21 class TSPlot: public TObject {
22 protected:
27  TMatrixD fMinmax; //mins and maxs of variables for histogramming
28  TMatrixD fSWeights; //computed sWeights
29 
30  TObjArray fXvarHists; //histograms of control variables
31  TObjArray fYvarHists; //histograms of discriminating variables
32  TObjArray fYpdfHists; //histograms of pdfs
33  TObjArray fSWeightsHists; //histograms of weighted variables
34 
35  TTree *fTree; //!
36  TString* fTreename; //The name of the data tree
37  TString* fVarexp; //Variables used for splot
38  TString* fSelection; //Selection on the tree
39 
40 
41  Int_t fNx; //Number of control variables
42  Int_t fNy; //Number of discriminating variables
43  Int_t fNSpecies; //Number of species
44  Int_t fNevents; //Total number of events
45 
46  Double_t *fNumbersOfEvents; //[fNSpecies] estimates of numbers of events in each species
47 
48  void SPlots(Double_t *covmat, Int_t i_excl);
49 
50 public:
51  TSPlot();
52  TSPlot(Int_t nx, Int_t ny, Int_t ne, Int_t ns, TTree* tree);
53  virtual ~TSPlot();
54 
55  void Browse(TBrowser *b);
56  Bool_t IsFolder() const { return kTRUE;}
57 
58  void FillXvarHists(Int_t nbins = 100);
59  void FillYvarHists(Int_t nbins = 100);
60  void FillYpdfHists(Int_t nbins = 100);
61  void FillSWeightsHists(Int_t nbins = 50);
62 
65 
67  TH1D* GetSWeightsHist(Int_t ixvar, Int_t ispecies,Int_t iyexcl=-1);
69  TH1D* GetXvarHist(Int_t ixvar);
71  TH1D* GetYvarHist(Int_t iyvar);
73  TH1D* GetYpdfHist(Int_t iyvar, Int_t ispecies);
74  void GetSWeights(TMatrixD &weights);
75  void GetSWeights(Double_t *weights);
79  void MakeSPlot(Option_t* option="v");
80 
81  void RefillHist(Int_t type, Int_t var, Int_t nbins, Double_t min, Double_t max, Int_t nspecies=-1);
82  void SetNX(Int_t nx){fNx=nx;}
83  void SetNY(Int_t ny){fNy=ny;}
85  void SetNEvents(Int_t ne){fNevents=ne;}
86  void SetInitialNumbersOfSpecies(Int_t *numbers);
87  void SetTree(TTree *tree);
88  void SetTreeSelection(const char* varexp="", const char *selection="", Long64_t firstentry=0);
89 
90  ClassDef(TSPlot, 1) //class to disentangle signal from background
91 };
92 
93 #endif
TMatrixDfwd.h
TSPlot::fXvarHists
TObjArray fXvarHists
Definition: TSPlot.h:30
TSPlot::fNSpecies
Int_t fNSpecies
Definition: TSPlot.h:43
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TSPlot::MakeSPlot
void MakeSPlot(Option_t *option="v")
Calculates the sWeights.
Definition: TSPlot.cxx:404
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TSPlot::IsFolder
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TSPlot.h:56
TSPlot::fXvar
TMatrixD fXvar
Definition: TSPlot.h:23
TSPlot::GetYvarHists
TObjArray * GetYvarHists()
Returns the array of histograms of y variables.
Definition: TSPlot.cxx:611
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
Option_t
const char Option_t
Definition: RtypesCore.h:66
TSPlot::GetNevents
Int_t GetNevents()
Definition: TSPlot.h:63
TSPlot::GetSWeightsHist
TH1D * GetSWeightsHist(Int_t ixvar, Int_t ispecies, Int_t iyexcl=-1)
Returns the histogram of a variable, weighted with sWeights.
Definition: TSPlot.cxx:832
TSPlot::GetYvarHist
TH1D * GetYvarHist(Int_t iyvar)
Returns the histogram of variable iyvar.If histograms have not already been filled,...
Definition: TSPlot.cxx:625
TSPlot::fNevents
Int_t fNevents
Definition: TSPlot.h:44
TSPlot::SetTree
void SetTree(TTree *tree)
Set the input Tree.
Definition: TSPlot.cxx:850
TSPlot::TSPlot
TSPlot()
default constructor (used by I/O only)
Definition: TSPlot.cxx:296
TSPlot::fSWeights
TMatrixD fSWeights
Definition: TSPlot.h:28
TSPlot::GetYpdfHist
TH1D * GetYpdfHist(Int_t iyvar, Int_t ispecies)
Returns the histogram of the pdf of variable iyvar for species #ispecies, binning nbins.
Definition: TSPlot.cxx:681
tree
Definition: tree.py:1
Long64_t
long long Long64_t
Definition: RtypesCore.h:80
TTree
A TTree represents a columnar dataset.
Definition: TTree.h:79
TH1D
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:618
Int_t
int Int_t
Definition: RtypesCore.h:45
TSPlot::fMinmax
TMatrixD fMinmax
Definition: TSPlot.h:27
TSPlot::Browse
void Browse(TBrowser *b)
To browse the histograms.
Definition: TSPlot.cxx:354
TMatrixT.h
TString
Basic string class.
Definition: TString.h:136
TMatrixT< Double_t >
b
#define b(i)
Definition: RSha256.hxx:100
TString.h
TSPlot::GetTreeSelection
TString * GetTreeSelection()
Definition: TSPlot.h:77
bool
TSPlot::fSWeightsHists
TObjArray fSWeightsHists
Definition: TSPlot.h:33
TSPlot::fNx
Int_t fNx
Definition: TSPlot.h:41
TSPlot::fNy
Int_t fNy
Definition: TSPlot.h:42
TSPlot::fTreename
TString * fTreename
Definition: TSPlot.h:36
TSPlot::RefillHist
void RefillHist(Int_t type, Int_t var, Int_t nbins, Double_t min, Double_t max, Int_t nspecies=-1)
The Fill...Hist() methods fill the histograms with the real limits on the variables This method allow...
Definition: TSPlot.cxx:767
TSPlot::GetXvarHists
TObjArray * GetXvarHists()
Returns the array of histograms of x variables (not weighted).
Definition: TSPlot.cxx:556
TSPlot::GetNspecies
Int_t GetNspecies()
Definition: TSPlot.h:64
TSPlot::fYvarHists
TObjArray fYvarHists
Definition: TSPlot.h:31
TSPlot::SPlots
void SPlots(Double_t *covmat, Int_t i_excl)
Computes the sWeights from the covariance matrix.
Definition: TSPlot.cxx:484
TSPlot::GetSWeightsHists
TObjArray * GetSWeightsHists()
Returns an array of all histograms of variables, weighted with sWeights.
Definition: TSPlot.cxx:746
TSPlot::GetXvarHist
TH1D * GetXvarHist(Int_t ixvar)
Returns the histogram of variable ixvar.
Definition: TSPlot.cxx:571
TSPlot::FillSWeightsHists
void FillSWeightsHists(Int_t nbins=50)
The order of histograms in the array:
Definition: TSPlot.cxx:698
TGeant4Unit::ns
static constexpr double ns
Definition: TGeant4SystemOfUnits.h:161
TSPlot::SetNEvents
void SetNEvents(Int_t ne)
Definition: TSPlot.h:85
TSPlot::GetTreeName
TString * GetTreeName()
Definition: TSPlot.h:76
TSPlot::fYvar
TMatrixD fYvar
Definition: TSPlot.h:24
TSPlot
A common method used in High Energy Physics to perform measurements is the maximum Likelihood method,...
Definition: TSPlot.h:21
TSPlot::SetNSpecies
void SetNSpecies(Int_t ns)
Definition: TSPlot.h:84
TSPlot::GetSWeights
void GetSWeights(TMatrixD &weights)
Returns the matrix of sweights.
Definition: TSPlot.cxx:505
TSPlot::fSelection
TString * fSelection
Definition: TSPlot.h:38
TSPlot::SetNY
void SetNY(Int_t ny)
Definition: TSPlot.h:83
TSPlot::SetInitialNumbersOfSpecies
void SetInitialNumbersOfSpecies(Int_t *numbers)
Set the initial number of events of each species - used as initial estimates in minuit.
Definition: TSPlot.cxx:388
TSPlot::fYpdfHists
TObjArray fYpdfHists
Definition: TSPlot.h:32
TSPlot::fPdfTot
TMatrixD fPdfTot
Definition: TSPlot.h:26
TSPlot::fYpdf
TMatrixD fYpdf
Definition: TSPlot.h:25
Double_t
double Double_t
Definition: RtypesCore.h:59
TObjArray.h
TSPlot::SetNX
void SetNX(Int_t nx)
Definition: TSPlot.h:82
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TSPlot::fVarexp
TString * fVarexp
Definition: TSPlot.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TSPlot::fTree
TTree * fTree
Definition: TSPlot.h:35
TSPlot::SetTreeSelection
void SetTreeSelection(const char *varexp="", const char *selection="", Long64_t firstentry=0)
Specifies the variables from the tree to be used for splot.
Definition: TSPlot.cxx:868
TSPlot::fNumbersOfEvents
Double_t * fNumbersOfEvents
Definition: TSPlot.h:46
type
int type
Definition: TGX11.cxx:121
TSPlot::GetYpdfHists
TObjArray * GetYpdfHists()
Returns the array of histograms of pdf's of y variables with binning nbins.
Definition: TSPlot.cxx:667
TSPlot::GetTreeExpression
TString * GetTreeExpression()
Definition: TSPlot.h:78
TSPlot::FillXvarHists
void FillXvarHists(Int_t nbins=100)
Fills the histograms of x variables (not weighted) with nbins.
Definition: TSPlot.cxx:528
TSPlot::~TSPlot
virtual ~TSPlot()
Destructor.
Definition: TSPlot.cxx:339
TSPlot::FillYvarHists
void FillYvarHists(Int_t nbins=100)
Fill the histograms of y variables.
Definition: TSPlot.cxx:585
int
TSPlot::FillYpdfHists
void FillYpdfHists(Int_t nbins=100)
Fills the histograms of pdf-s of y variables with binning nbins.
Definition: TSPlot.cxx:638