Logo ROOT   6.14/05
Reference Guide
PDEFoamCell.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: S. Jadach, Tancredi Carli, Dominik Dannheim, Alexander Voigt
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Classes: PDEFoamCell *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Objects of this class are hyperrectangular cells organized in *
12  * the binary tree. Special algoritm for encoding relative *
13  * positioning of the cells saves total memory allocation needed *
14  * for the system of cells. *
15  * *
16  * Authors (alphabetical): *
17  * S. Jadach - Institute of Nuclear Physics, Cracow, Poland *
18  * Tancredi Carli - CERN, Switzerland *
19  * Dominik Dannheim - CERN, Switzerland *
20  * Alexander Voigt - TU Dresden, Germany *
21  * *
22  * Copyright (c) 2008: *
23  * CERN, Switzerland *
24  * MPI-K Heidelberg, Germany *
25  * *
26  * Redistribution and use in source and binary forms, with or without *
27  * modification, are permitted according to the terms listed in LICENSE *
28  * (http://tmva.sourceforge.net/LICENSE) *
29  **********************************************************************************/
30 
31 #ifndef ROOT_TMVA_PDEFoamCell
32 #define ROOT_TMVA_PDEFoamCell
33 
34 #include "TObject.h"
35 #include "TRef.h"
36 
37 #include "TMVA/PDEFoamVect.h"
38 
39 namespace TMVA {
40 
41  class PDEFoamCell : public TObject {
42 
43  // static, the same for all cells!
44  private:
45  Short_t fDim; // Dimension of the vector space
46  // MEMBERS
47 
48  private:
49  //--- linked tree organization ---
50  Int_t fSerial; // Serial number
51  Int_t fStatus; // Status (active, inactive)
52  TRef fParent; // Pointer to parent cell
53  TRef fDaught0; // Pointer to daughter 1
54  TRef fDaught1; // Pointer to daughter 2
55  //--- M.C. sampling and choice of the best edge ---
56 
57  private:
58  Double_t fXdiv; // Factor for division
59  Int_t fBest; // Best Edge for division
60  //--- Integrals of all kinds ---
61  Double_t fVolume; // Cartesian Volume of cell
62  Double_t fIntegral; // Integral over cell (estimate from exploration)
63  Double_t fDrive; // Driver integral, only for cell build-up
64  //---------- working space for the user --------------
65  TObject *fElement; // may set by the user to save some data in this cell
66 
67  //////////////////////////////////////////////////////////////////////////////////////
68  // METHODS //
69  //////////////////////////////////////////////////////////////////////////////////////
70  public:
71  PDEFoamCell(); // Default Constructor for ROOT streamers
72  PDEFoamCell(Int_t); // User Constructor
73  PDEFoamCell(const PDEFoamCell&); // Copy constructor
74  virtual ~PDEFoamCell(); // Destructor
75  void Fill(Int_t, PDEFoamCell*, PDEFoamCell*, PDEFoamCell*); // Assigns values of attributes
76  //--------------- Geometry ----------------------------------
77  Double_t GetXdiv() const { return fXdiv;} // Pointer to Xdiv
78  Int_t GetBest() const { return fBest;} // Pointer to Best
79  void SetBest(Int_t Best){ fBest =Best;} // Set Best edge candidate
80  void SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;} // Set x-division for best edge cand.
81  void GetHcub( PDEFoamVect&, PDEFoamVect&) const; // Get position and size vectors (h-cubical subspace)
82  void GetHSize( PDEFoamVect& ) const; // Get size only of cell vector (h-cubical subspace)
83  //--------------- Integrals/Volumes -------------------------
84  void CalcVolume(); // Calculates volume of cell
85  Double_t GetVolume() const { return fVolume;} // Volume of cell
86  Double_t GetIntg() const { return fIntegral;} // Get Integral
87  Double_t GetDriv() const { return fDrive;} // Get Drive
88  void SetIntg(Double_t Intg){ fIntegral=Intg;} // Set true integral
89  void SetDriv(Double_t Driv){ fDrive =Driv;} // Set driver integral
90  //--------------- linked tree organization ------------------
91  Int_t GetStat() const { return fStatus;} // Get Status
92  void SetStat(Int_t Stat){ fStatus=Stat;} // Set Status
93  PDEFoamCell* GetPare() const { return (PDEFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell
94  PDEFoamCell* GetDau0() const { return (PDEFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
95  PDEFoamCell* GetDau1() const { return (PDEFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
96  void SetDau0(PDEFoamCell* Daug){ fDaught0 = Daug;} // Set pointer to 1-st daughter
97  void SetDau1(PDEFoamCell* Daug){ fDaught1 = Daug;} // Set pointer to 2-nd daughter
98  void SetPare(PDEFoamCell* Pare){ fParent = Pare;} // Set pointer to parent
99  void SetSerial(Int_t Serial){ fSerial=Serial;} // Set serial number
100  Int_t GetSerial() const { return fSerial;} // Get serial number
101  UInt_t GetDepth(); // Get depth in binary tree
102  UInt_t GetTreeDepth(UInt_t depth=0); // Get depth of binary tree
103  //--- other ---
104  void Print(Option_t *option) const ; // Prints cell content
105  //--- getter and setter for user variable ---
106  void SetElement(TObject* fobj){ fElement = fobj; } // Set user variable
107  TObject* GetElement() const { return fElement; } // Get pointer to user variable
108  ////////////////////////////////////////////////////////////////////////////
109  ClassDef(PDEFoamCell,2) //Single cell of FOAM
110  }; // end of PDEFoamCell
111 } // namespace TMVA
112 
113 #endif
PDEFoamCell * GetDau1() const
Definition: PDEFoamCell.h:95
void GetHSize(PDEFoamVect &) const
Provides size of the cell Size parameters are calculated by analyzing information in all parents cell...
void SetElement(TObject *fobj)
Definition: PDEFoamCell.h:106
void Print(Option_t *option) const
Printout of the cell geometry parameters for the debug purpose.
TObject * fElement
Definition: PDEFoamCell.h:65
const char Option_t
Definition: RtypesCore.h:62
Double_t GetVolume() const
Definition: PDEFoamCell.h:85
void Fill(Int_t, PDEFoamCell *, PDEFoamCell *, PDEFoamCell *)
Fills in certain data into newly allocated cell.
void SetPare(PDEFoamCell *Pare)
Definition: PDEFoamCell.h:98
int Int_t
Definition: RtypesCore.h:41
virtual ~PDEFoamCell()
Destructor.
void SetBest(Int_t Best)
Definition: PDEFoamCell.h:79
PDEFoamCell * GetPare() const
Definition: PDEFoamCell.h:93
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject...
Definition: TRef.h:32
Double_t fIntegral
Definition: PDEFoamCell.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:320
void SetDau1(PDEFoamCell *Daug)
Definition: PDEFoamCell.h:97
Int_t GetBest() const
Definition: PDEFoamCell.h:78
void SetXdiv(Double_t Xdiv)
Definition: PDEFoamCell.h:80
UInt_t GetTreeDepth(UInt_t depth=0)
Get depth of cell tree, starting at this cell.
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
TObject * GetObject() const
Return a pointer to the referenced object.
Definition: TRef.cxx:377
void SetStat(Int_t Stat)
Definition: PDEFoamCell.h:92
unsigned int UInt_t
Definition: RtypesCore.h:42
UInt_t GetDepth()
Get depth of cell in binary tree, where the root cell has depth 1.
short Short_t
Definition: RtypesCore.h:35
void SetDriv(Double_t Driv)
Definition: PDEFoamCell.h:89
Double_t fVolume
Definition: PDEFoamCell.h:61
TObject * GetElement() const
Definition: PDEFoamCell.h:107
Int_t GetSerial() const
Definition: PDEFoamCell.h:100
Double_t GetIntg() const
Definition: PDEFoamCell.h:86
PDEFoamCell()
Default constructor for streamer.
Definition: PDEFoamCell.cxx:53
double Double_t
Definition: RtypesCore.h:55
Double_t GetXdiv() const
Definition: PDEFoamCell.h:77
PDEFoamCell * GetDau0() const
Definition: PDEFoamCell.h:94
void SetSerial(Int_t Serial)
Definition: PDEFoamCell.h:99
Mother of all ROOT objects.
Definition: TObject.h:37
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
void SetIntg(Double_t Intg)
Definition: PDEFoamCell.h:88
Abstract ClassifierFactory template that handles arbitrary types.
Int_t GetStat() const
Definition: PDEFoamCell.h:91
Double_t GetDriv() const
Definition: PDEFoamCell.h:87
void SetDau0(PDEFoamCell *Daug)
Definition: PDEFoamCell.h:96