Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:25

0001 // @(#)root/splot:$Id$
0002 // Author: Muriel Pivk, Anna Kreshuk    10/2005
0003 
0004 /**********************************************************************
0005  *                                                                    *
0006  * Copyright (c) 2005 ROOT Foundation,  CERN/PH-SFT                   *
0007  *                                                                    *
0008  **********************************************************************/
0009 
0010 #ifndef ROOT_TSPlot
0011 #define ROOT_TSPlot
0012 
0013 #include "TObjArray.h"
0014 #include "TString.h"
0015 #include "TMatrixT.h"
0016 #include "TMatrixDfwd.h"
0017 
0018 class TH1D;
0019 class TTree;
0020 
0021 class TSPlot: public TObject {
0022 protected:
0023    TMatrixD fXvar;           //!
0024    TMatrixD fYvar;           //!
0025    TMatrixD fYpdf;           //!
0026    TMatrixD fPdfTot;         //!
0027    TMatrixD fMinmax;         //mins and maxs of variables for histogramming
0028    TMatrixD fSWeights;       //computed sWeights
0029 
0030    TObjArray fXvarHists;     //histograms of control variables
0031    TObjArray fYvarHists;     //histograms of discriminating variables
0032    TObjArray fYpdfHists;     //histograms of pdfs
0033    TObjArray fSWeightsHists; //histograms of weighted variables
0034 
0035    TTree    *fTree;          //!
0036    TString* fTreename;       //The name of the data tree
0037    TString* fVarexp;         //Variables used for splot
0038    TString* fSelection;      //Selection on the tree
0039 
0040 
0041    Int_t    fNx;             //Number of control variables
0042    Int_t    fNy;             //Number of discriminating variables
0043    Int_t    fNSpecies;       //Number of species
0044    Int_t    fNevents;        //Total number of events
0045 
0046    Double_t *fNumbersOfEvents; //[fNSpecies] estimates of numbers of events in each species
0047 
0048    void SPlots(Double_t *covmat, Int_t i_excl);
0049 
0050 public:
0051    TSPlot();
0052    TSPlot(Int_t nx, Int_t ny, Int_t ne, Int_t ns, TTree* tree);
0053    ~TSPlot() override;
0054 
0055    void       Browse(TBrowser *b) override;
0056    Bool_t     IsFolder() const override { return kTRUE;}
0057 
0058    void       FillXvarHists(Int_t nbins = 100);
0059    void       FillYvarHists(Int_t nbins = 100);
0060    void       FillYpdfHists(Int_t nbins = 100);
0061    void       FillSWeightsHists(Int_t nbins = 50);
0062 
0063    Int_t      GetNevents()  {return fNevents;}
0064    Int_t      GetNspecies() {return fNSpecies;}
0065 
0066    TObjArray* GetSWeightsHists();
0067    TH1D*      GetSWeightsHist(Int_t ixvar, Int_t ispecies,Int_t iyexcl=-1);
0068    TObjArray* GetXvarHists();
0069    TH1D*      GetXvarHist(Int_t ixvar);
0070    TObjArray* GetYvarHists();
0071    TH1D*      GetYvarHist(Int_t iyvar);
0072    TObjArray* GetYpdfHists();
0073    TH1D*      GetYpdfHist(Int_t iyvar, Int_t ispecies);
0074    void       GetSWeights(TMatrixD &weights);
0075    void       GetSWeights(Double_t *weights);
0076    TString*   GetTreeName(){return fTreename;}
0077    TString*   GetTreeSelection() {return fSelection;}
0078    TString*   GetTreeExpression() {return fVarexp;}
0079    void       MakeSPlot(Option_t* option="v");
0080 
0081    void       RefillHist(Int_t type, Int_t var, Int_t nbins, Double_t min, Double_t max, Int_t nspecies=-1);
0082    void       SetNX(Int_t nx){fNx=nx;}
0083    void       SetNY(Int_t ny){fNy=ny;}
0084    void       SetNSpecies(Int_t ns){fNSpecies=ns;}
0085    void       SetNEvents(Int_t ne){fNevents=ne;}
0086    void       SetInitialNumbersOfSpecies(Int_t *numbers);
0087    void       SetTree(TTree *tree);
0088    void       SetTreeSelection(const char* varexp="", const char *selection="", Long64_t firstentry=0);
0089 
0090    ClassDefOverride(TSPlot, 1)  //class to disentangle signal from background
0091 };
0092 
0093 #endif