Logo ROOT   6.07/09
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 #ifndef ROOT_TObject
36 #include "TObject.h"
37 #endif
38 
39 #ifndef ROOT_TMVA_BinarySearchTree
40 #include "TMVA/BinarySearchTree.h"
41 #endif
42 #ifndef ROOT_TMVA_Event
43 #include "TMVA/Event.h"
44 #endif
45 #ifndef ROOT_TMVA_MsgLogger
46 #include "TMVA/MsgLogger.h"
47 #endif
48 
49 namespace TMVA
50 {
51 
52  // class definition of underlying density
54  {
55  private:
56  std::vector<Double_t> fBox; // range-searching box
57  Double_t fBoxVolume; // volume of range searching box
58  Bool_t fBoxHasChanged; // range searching box has changed
59 
60  protected:
61  BinarySearchTree *fBst; // Binary tree to find events within a volume
62  mutable MsgLogger *fLogger; //! message logger
63 
64  MsgLogger& Log() const { return *fLogger; }
65 
66  // calculate volume of fBox
68 
69  public:
71  PDEFoamDensityBase(std::vector<Double_t> box);
73  virtual ~PDEFoamDensityBase();
74 
75  // fill event into binary search tree
76  void FillBinarySearchTree(const Event* ev);
77 
78  // set the range-searching box
79  void SetBox(std::vector<Double_t> box) { fBox = box; fBoxHasChanged = kTRUE; }
80 
81  // get the range-searching box
82  const std::vector<Double_t>& GetBox() const { return fBox; }
83 
84  // main function used by PDEFoam
85  // returns density at a given point by range searching in BST
86  virtual Double_t Density(std::vector<Double_t> &Xarg, Double_t &event_density) = 0;
87 
88  ClassDef(PDEFoamDensityBase, 1) // PDEFoam event density interface
89  }; //end of PDEFoamDensityBase
90 
91 } // namespace TMVA
92 
93 #endif
const std::vector< Double_t > & GetBox() const
bool Bool_t
Definition: RtypesCore.h:59
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
virtual Double_t Density(std::vector< Double_t > &Xarg, Double_t &event_density)=0
#define ClassDef(name, id)
Definition: Rtypes.h:254
void SetBox(std::vector< Double_t > box)
virtual ~PDEFoamDensityBase()
destructor
void FillBinarySearchTree(const Event *ev)
This method inserts the given event &#39;ev&#39; it into the binary search tree.
std::vector< Double_t > fBox
double Double_t
Definition: RtypesCore.h:55
Double_t GetBoxVolume()
Returns the volume of range searching box fBox.
Mother of all ROOT objects.
Definition: TObject.h:44
MsgLogger & Log() const
message logger
Abstract ClassifierFactory template that handles arbitrary types.
const Bool_t kTRUE
Definition: Rtypes.h:91