Logo ROOT  
Reference Guide
PDEFoamDensityBase.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Tancredi Carli, Dominik Dannheim, Alexander Voigt
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Classes: PDEFoamDensityBase *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Class PDEFoamDensityBase is an Abstract class representing *
12  * n-dimensional real positive integrand function *
13  * The main function is Density() which provides the event density at a *
14  * given point during the foam build-up (sampling). *
15  * *
16  * Authors (alphabetical): *
17  * Tancredi Carli - CERN, Switzerland *
18  * Dominik Dannheim - CERN, Switzerland *
19  * S. Jadach - Institute of Nuclear Physics, Cracow, Poland *
20  * Alexander Voigt - TU Dresden, Germany *
21  * Peter Speckmayer - CERN, Switzerland *
22  * *
23  * Copyright (c) 2008, 2010: *
24  * CERN, Switzerland *
25  * MPI-K Heidelberg, Germany *
26  * *
27  * Redistribution and use in source and binary forms, with or without *
28  * modification, are permitted according to the terms listed in LICENSE *
29  * (http://tmva.sourceforge.net/LICENSE) *
30  **********************************************************************************/
31 
32 #ifndef ROOT_TMVA_PDEFoamDensityBase
33 #define ROOT_TMVA_PDEFoamDensityBase
34 
35 #include "TObject.h"
36 #include <vector>
37 
38 #include "TMVA/BinarySearchTree.h"
39 #include "TMVA/Event.h"
40 #include "TMVA/MsgLogger.h"
41 
42 namespace TMVA
43 {
44 
45  // class definition of underlying density
46  class PDEFoamDensityBase : public ::TObject
47  {
48  private:
49  std::vector<Double_t> fBox; // range-searching box
50  Double_t fBoxVolume; // volume of range searching box
51  Bool_t fBoxHasChanged; // range searching box has changed
52 
53  protected:
54  BinarySearchTree *fBst; // Binary tree to find events within a volume
55  mutable MsgLogger *fLogger; //! message logger
56 
57  MsgLogger& Log() const { return *fLogger; }
58 
59  // calculate volume of fBox
61 
62  public:
64  PDEFoamDensityBase(std::vector<Double_t> box);
66  virtual ~PDEFoamDensityBase();
67 
68  // fill event into binary search tree
69  void FillBinarySearchTree(const Event* ev);
70 
71  // set the range-searching box
72  void SetBox(std::vector<Double_t> box) { fBox = box; fBoxHasChanged = kTRUE; }
73 
74  // get the range-searching box
75  const std::vector<Double_t>& GetBox() const { return fBox; }
76 
77  // main function used by PDEFoam
78  // returns density at a given point by range searching in BST
79  virtual Double_t Density(std::vector<Double_t> &Xarg, Double_t &event_density) = 0;
80 
81  ClassDef(PDEFoamDensityBase, 1) // PDEFoam event density interface
82  }; //end of PDEFoamDensityBase
83 
84 } // namespace TMVA
85 
86 #endif
TMVA::PDEFoamDensityBase::FillBinarySearchTree
void FillBinarySearchTree(const Event *ev)
This method inserts the given event 'ev' it into the binary search tree.
Definition: PDEFoamDensityBase.cxx:144
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TMVA::PDEFoamDensityBase::~PDEFoamDensityBase
virtual ~PDEFoamDensityBase()
destructor
Definition: PDEFoamDensityBase.cxx:118
TMVA::PDEFoamDensityBase::PDEFoamDensityBase
PDEFoamDensityBase()
Definition: PDEFoamDensityBase.cxx:85
box
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
TMVA::PDEFoamDensityBase::fBoxHasChanged
Bool_t fBoxHasChanged
Definition: PDEFoamDensityBase.h:103
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
MsgLogger.h
BinarySearchTree.h
TMVA::PDEFoamDensityBase::GetBoxVolume
Double_t GetBoxVolume()
Returns the volume of range searching box fBox.
Definition: PDEFoamDensityBase.cxx:161
TMVA::PDEFoamDensityBase::fBoxVolume
Double_t fBoxVolume
Definition: PDEFoamDensityBase.h:102
Event.h
TMVA::PDEFoamDensityBase::Log
MsgLogger & Log() const
message logger
Definition: PDEFoamDensityBase.h:109
TMVA::PDEFoamDensityBase::SetBox
void SetBox(std::vector< Double_t > box)
Definition: PDEFoamDensityBase.h:124
TMVA::PDEFoamDensityBase::fBst
BinarySearchTree * fBst
Definition: PDEFoamDensityBase.h:106
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject.h
TMVA::PDEFoamDensityBase::fLogger
MsgLogger * fLogger
Definition: PDEFoamDensityBase.h:107
TObject
Definition: TObject.h:37
TMVA::PDEFoamDensityBase::fBox
std::vector< Double_t > fBox
Definition: PDEFoamDensityBase.h:101
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::PDEFoamDensityBase::GetBox
const std::vector< Double_t > & GetBox() const
Definition: PDEFoamDensityBase.h:127
TMVA::PDEFoamDensityBase::Density
virtual Double_t Density(std::vector< Double_t > &Xarg, Double_t &event_density)=0
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22