TSPlot.h

Go to the documentation of this file.
00001 // @(#)root/splot:$Id: TSPlot.h 21958 2008-02-02 10:39:18Z rdm $
00002 // Author: Muriel Pivk, Anna Kreshuk    10/2005
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 ROOT Foundation,  CERN/PH-SFT                   *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #ifndef ROOT_TSPlot
00011 #define ROOT_TSPlot
00012 
00013 #include "TObjArray.h"
00014 #include "TString.h"
00015 #include "TMatrixT.h"
00016 #include "TMatrixDfwd.h"
00017 
00018 class TH1D;
00019 class TTree;
00020 
00021 class TSPlot: public TObject {
00022 protected:
00023    TMatrixD fXvar;           //!
00024    TMatrixD fYvar;           //!
00025    TMatrixD fYpdf;           //!
00026    TMatrixD fPdfTot;         //!
00027    TMatrixD fMinmax;         //mins and maxs of variables for histogramming
00028    TMatrixD fSWeights;       //computed sWeights
00029 
00030    TObjArray fXvarHists;     //histograms of control variables
00031    TObjArray fYvarHists;     //histograms of discriminating variables
00032    TObjArray fYpdfHists;     //histograms of pdfs
00033    TObjArray fSWeightsHists; //histograms of weighted variables
00034 
00035    TTree    *fTree;          //!
00036    TString* fTreename;       //The name of the data tree
00037    TString* fVarexp;         //Variables used for splot
00038    TString* fSelection;      //Selection on the tree
00039 
00040 
00041    Int_t    fNx;             //Number of control variables
00042    Int_t    fNy;             //Number of discriminating variables
00043    Int_t    fNSpecies;       //Number of species
00044    Int_t    fNevents;        //Total number of events
00045 
00046    Double_t *fNumbersOfEvents; //[fNSpecies] estimates of numbers of events in each species
00047 
00048    void SPlots(Double_t *covmat, Int_t i_excl);
00049 
00050 public:
00051    TSPlot();
00052    TSPlot(Int_t nx, Int_t ny, Int_t ne, Int_t ns, TTree* tree);
00053    virtual ~TSPlot();
00054 
00055    void       Browse(TBrowser *b);
00056    Bool_t     IsFolder() const { return kTRUE;}
00057 
00058    void       FillXvarHists(Int_t nbins = 100);
00059    void       FillYvarHists(Int_t nbins = 100);
00060    void       FillYpdfHists(Int_t nbins = 100);
00061    void       FillSWeightsHists(Int_t nbins = 50);
00062 
00063    Int_t      GetNevents()  {return fNevents;}
00064    Int_t      GetNspecies() {return fNSpecies;}
00065 
00066    TObjArray* GetSWeightsHists();
00067    TH1D*      GetSWeightsHist(Int_t ixvar, Int_t ispecies,Int_t iyexcl=-1);
00068    TObjArray* GetXvarHists();
00069    TH1D*      GetXvarHist(Int_t ixvar);
00070    TObjArray* GetYvarHists();
00071    TH1D*      GetYvarHist(Int_t iyvar);
00072    TObjArray* GetYpdfHists();
00073    TH1D*      GetYpdfHist(Int_t iyvar, Int_t ispecies);
00074    void       GetSWeights(TMatrixD &weights);
00075    void       GetSWeights(Double_t *weights);
00076    TString*   GetTreeName(){return fTreename;}
00077    TString*   GetTreeSelection() {return fSelection;}
00078    TString*   GetTreeExpression() {return fVarexp;}
00079    void       MakeSPlot(Option_t* option="v");
00080 
00081    void       RefillHist(Int_t type, Int_t var, Int_t nbins, Double_t min, Double_t max, Int_t nspecies=-1);
00082    void       SetNX(Int_t nx){fNx=nx;}
00083    void       SetNY(Int_t ny){fNy=ny;}
00084    void       SetNSpecies(Int_t ns){fNSpecies=ns;}
00085    void       SetNEvents(Int_t ne){fNevents=ne;}
00086    void       SetInitialNumbersOfSpecies(Int_t *numbers);
00087    void       SetTree(TTree *tree);
00088    void       SetTreeSelection(const char* varexp="", const char *selection="", Long64_t firstentry=0);
00089 
00090    ClassDef(TSPlot, 1)  //class to disentangle signal from background
00091 };
00092 
00093 #endif

Generated on Tue Jul 5 14:28:12 2011 for ROOT_528-00b_version by  doxygen 1.5.1