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
18class TH1D;
19class TTree;
20
21class TSPlot: public TObject {
22protected:
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
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
50public:
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;}
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
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:43
double Double_t
Definition: RtypesCore.h:57
long long Long64_t
Definition: RtypesCore.h:71
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
int type
Definition: TGX11.cxx:120
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:614
An array of TObjects.
Definition: TObjArray.h:37
Mother of all ROOT objects.
Definition: TObject.h:37
A common method used in High Energy Physics to perform measurements is the maximum Likelihood method,...
Definition: TSPlot.h:21
void FillYvarHists(Int_t nbins=100)
Fill the histograms of y variables.
Definition: TSPlot.cxx:584
TObjArray fXvarHists
Definition: TSPlot.h:30
TObjArray fSWeightsHists
Definition: TSPlot.h:33
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:766
TString * GetTreeSelection()
Definition: TSPlot.h:77
TMatrixD fSWeights
Definition: TSPlot.h:28
Int_t fNevents
Definition: TSPlot.h:44
Int_t fNy
Definition: TSPlot.h:42
TString * GetTreeName()
Definition: TSPlot.h:76
void Browse(TBrowser *b)
To browse the histograms.
Definition: TSPlot.cxx:353
Int_t fNSpecies
Definition: TSPlot.h:43
TString * fTreename
Definition: TSPlot.h:36
void SPlots(Double_t *covmat, Int_t i_excl)
Computes the sWeights from the covariance matrix.
Definition: TSPlot.cxx:483
void SetNSpecies(Int_t ns)
Definition: TSPlot.h:84
void SetNEvents(Int_t ne)
Definition: TSPlot.h:85
void GetSWeights(TMatrixD &weights)
Returns the matrix of sweights.
Definition: TSPlot.cxx:504
virtual ~TSPlot()
Destructor.
Definition: TSPlot.cxx:338
TMatrixD fMinmax
Definition: TSPlot.h:27
void FillSWeightsHists(Int_t nbins=50)
The order of histograms in the array:
Definition: TSPlot.cxx:697
Int_t fNx
Definition: TSPlot.h:41
TString * fSelection
Definition: TSPlot.h:38
TH1D * GetSWeightsHist(Int_t ixvar, Int_t ispecies, Int_t iyexcl=-1)
Returns the histogram of a variable, weighted with sWeights.
Definition: TSPlot.cxx:831
TMatrixD fPdfTot
Definition: TSPlot.h:26
void MakeSPlot(Option_t *option="v")
Calculates the sWeights.
Definition: TSPlot.cxx:403
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:680
TObjArray * GetSWeightsHists()
Returns an array of all histograms of variables, weighted with sWeights.
Definition: TSPlot.cxx:745
TTree * fTree
Definition: TSPlot.h:35
TObjArray * GetYpdfHists()
Returns the array of histograms of pdf's of y variables with binning nbins.
Definition: TSPlot.cxx:666
void FillXvarHists(Int_t nbins=100)
Fills the histograms of x variables (not weighted) with nbins.
Definition: TSPlot.cxx:527
TObjArray * GetXvarHists()
Returns the array of histograms of x variables (not weighted).
Definition: TSPlot.cxx:555
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TSPlot.h:56
TObjArray fYvarHists
Definition: TSPlot.h:31
Int_t GetNspecies()
Definition: TSPlot.h:64
TString * fVarexp
Definition: TSPlot.h:37
void SetTree(TTree *tree)
Set the input Tree.
Definition: TSPlot.cxx:849
TObjArray * GetYvarHists()
Returns the array of histograms of y variables.
Definition: TSPlot.cxx:610
void SetNX(Int_t nx)
Definition: TSPlot.h:82
Int_t GetNevents()
Definition: TSPlot.h:63
TString * GetTreeExpression()
Definition: TSPlot.h:78
void FillYpdfHists(Int_t nbins=100)
Fills the histograms of pdf-s of y variables with binning nbins.
Definition: TSPlot.cxx:637
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:867
TMatrixD fXvar
Definition: TSPlot.h:23
TSPlot()
default constructor (used by I/O only)
Definition: TSPlot.cxx:295
void SetNY(Int_t ny)
Definition: TSPlot.h:83
TH1D * GetYvarHist(Int_t iyvar)
Returns the histogram of variable iyvar.If histograms have not already been filled,...
Definition: TSPlot.cxx:624
void SetInitialNumbersOfSpecies(Int_t *numbers)
Set the initial number of events of each species - used as initial estimates in minuit.
Definition: TSPlot.cxx:387
TObjArray fYpdfHists
Definition: TSPlot.h:32
Double_t * fNumbersOfEvents
Definition: TSPlot.h:46
TMatrixD fYpdf
Definition: TSPlot.h:25
TH1D * GetXvarHist(Int_t ixvar)
Returns the histogram of variable ixvar.
Definition: TSPlot.cxx:570
TMatrixD fYvar
Definition: TSPlot.h:24
Basic string class.
Definition: TString.h:131
A TTree represents a columnar dataset.
Definition: TTree.h:78
static constexpr double ns
Definition: tree.py:1