PDEFoamDistr.h

Go to the documentation of this file.
00001 
00002 /**********************************************************************************
00003  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
00004  * Package: TMVA                                                                  *
00005  * Classes: PDEFoamDistr                                                          *
00006  * Web    : http://tmva.sourceforge.net                                           *
00007  *                                                                                *
00008  * Description:                                                                   *
00009  *      Class PDEFoamDistr is an Abstract class representing                      *
00010  *      n-dimensional real positive integrand function                            *
00011  *      The main function is Density() which provides the event density at a      *
00012  *      given point during the foam build-up (sampling).                          *
00013  *                                                                                *
00014  * Authors (alphabetical):                                                        *
00015  *      Tancredi Carli   - CERN, Switzerland                                      *
00016  *      Dominik Dannheim - CERN, Switzerland                                      *
00017  *      S. Jadach        - Institute of Nuclear Physics, Cracow, Poland           *
00018  *      Alexander Voigt  - CERN, Switzerland                                      *
00019  *      Peter Speckmayer - CERN, Switzerland                                      *
00020  *                                                                                *
00021  * Copyright (c) 2008:                                                            *
00022  *      CERN, Switzerland                                                         *
00023  *      MPI-K Heidelberg, Germany                                                 *
00024  *                                                                                *
00025  * Redistribution and use in source and binary forms, with or without             *
00026  * modification, are permitted according to the terms listed in LICENSE           *
00027  * (http://tmva.sourceforge.net/LICENSE)                                          *
00028  **********************************************************************************/
00029 
00030 #ifndef ROOT_TMVA_PDEFoamDistr
00031 #define ROOT_TMVA_PDEFoamDistr
00032 
00033 #ifndef ROOT_TObject
00034 #include "TObject.h"
00035 #endif
00036 #ifndef ROOT_TH1D
00037 #include "TH1D.h"
00038 #endif
00039 #ifndef ROOT_TH2D
00040 #include "TH2D.h"
00041 #endif
00042 
00043 #ifndef ROOT_TMVA_BinarySearchTree
00044 #include "TMVA/BinarySearchTree.h"
00045 #endif
00046 #ifndef ROOT_TMVA_Event
00047 #include "TMVA/Event.h"
00048 #endif
00049 #ifndef ROOT_TMVA_PDEFoam
00050 #include "TMVA/PDEFoam.h"
00051 #endif
00052 #ifndef ROOT_TMVA_PDEFoamCell
00053 #include "TMVA/PDEFoamCell.h"
00054 #endif
00055 #ifndef ROOT_TMVA_MsgLogger
00056 #include "TMVA/MsgLogger.h"
00057 #endif
00058 
00059 namespace TMVA {
00060    // options for filling density (used in Density() to build up foam)
00061    // kEVENT_DENSITY : use event density for foam buildup
00062    // kDISCRIMINATOR : use N_sig/(N_sig + N_bg) for foam buildup
00063    // kTARGET        : use GetTarget(0) for foam build up
00064    enum TDensityCalc { kEVENT_DENSITY, kDISCRIMINATOR, kTARGET };
00065 }
00066 
00067 namespace TMVA {
00068 
00069    // class definition of underlying density
00070    class PDEFoamDistr : public ::TObject  {
00071 
00072    private:
00073       const PDEFoam *fPDEFoam;  // PDEFoam to refer to
00074       BinarySearchTree *fBst;   // Binary tree to find events within a volume
00075       TDensityCalc fDensityCalc;// method of density calculation
00076 
00077    protected:
00078       mutable MsgLogger* fLogger;                     //! message logger
00079       MsgLogger& Log() const { return *fLogger; }
00080 
00081    public:
00082       PDEFoamDistr();
00083       PDEFoamDistr(const PDEFoamDistr&);
00084       virtual ~PDEFoamDistr();
00085 
00086       // density build-up functions
00087       void Initialize(); // create and initialize binary search tree
00088       void FillBinarySearchTree( const Event* ev, EFoamType ft, Bool_t NoNegWeights=kFALSE );
00089 
00090       // main function used by PDEFoam
00091       // returns density at a given point by range searching in BST
00092       Double_t Density(Double_t *Xarg, Double_t &event_density);
00093 
00094       // Return fDim histograms with signal and bg events
00095       void FillHist(PDEFoamCell* cell, std::vector<TH1F*>&, std::vector<TH1F*>&, 
00096                     std::vector<TH1F*>&, std::vector<TH1F*>&);
00097 
00098       // Getter and setter for the fPDEFoam pointer
00099       void SetPDEFoam(const PDEFoam *foam){ fPDEFoam = foam; }
00100       const PDEFoam* GetPDEFoam() const { return fPDEFoam; };
00101 
00102       // Getters and setters for foam filling method
00103       void SetDensityCalc( TDensityCalc dc ){ fDensityCalc = dc; };
00104       Bool_t FillDiscriminator(){ return fDensityCalc == kDISCRIMINATOR; }
00105       Bool_t FillTarget0()      { return fDensityCalc == kTARGET;        }
00106       Bool_t FillEventDensity() { return fDensityCalc == kEVENT_DENSITY; }
00107 
00108       ClassDef(PDEFoamDistr,3) //Class for Event density
00109    };  //end of PDEFoamDistr
00110 
00111 }  // namespace TMVA
00112 
00113 #endif

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