Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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:
23  TMatrixD fXvar; //!
24  TMatrixD fYvar; //!
25  TMatrixD fYpdf; //!
26  TMatrixD fPdfTot; //!
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 
63  Int_t GetNevents() {return fNevents;}
64  Int_t GetNspecies() {return fNSpecies;}
65 
66  TObjArray* GetSWeightsHists();
67  TH1D* GetSWeightsHist(Int_t ixvar, Int_t ispecies,Int_t iyexcl=-1);
68  TObjArray* GetXvarHists();
69  TH1D* GetXvarHist(Int_t ixvar);
70  TObjArray* GetYvarHists();
71  TH1D* GetYvarHist(Int_t iyvar);
72  TObjArray* GetYpdfHists();
73  TH1D* GetYpdfHist(Int_t iyvar, Int_t ispecies);
74  void GetSWeights(TMatrixD &weights);
75  void GetSWeights(Double_t *weights);
76  TString* GetTreeName(){return fTreename;}
77  TString* GetTreeSelection() {return fSelection;}
78  TString* GetTreeExpression() {return fVarexp;}
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;}
84  void SetNSpecies(Int_t ns){fNSpecies=ns;}
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