Logo ROOT   6.08/07
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 relalive *
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 #ifndef ROOT_TObject
35 #include "TObject.h"
36 #endif
37 #ifndef ROOT_TRef
38 #include "TRef.h"
39 #endif
40 
41 #ifndef ROOT_TMVA_PDEFoamVect
42 #include "TMVA/PDEFoamVect.h"
43 #endif
44 
45 namespace TMVA {
46 
47  class PDEFoamCell : public TObject {
48 
49  // static, the same for all cells!
50  private:
51  Short_t fDim; // Dimension of the vector space
52  // MEMBERS
53 
54  private:
55  //--- linked tree organization ---
56  Int_t fSerial; // Serial number
57  Int_t fStatus; // Status (active, inactive)
58  TRef fParent; // Pointer to parent cell
59  TRef fDaught0; // Pointer to daughter 1
60  TRef fDaught1; // Pointer to daughter 2
61  //--- M.C. sampling and choice of the best edge ---
62 
63  private:
64  Double_t fXdiv; // Factor for division
65  Int_t fBest; // Best Edge for division
66  //--- Integrals of all kinds ---
67  Double_t fVolume; // Cartesian Volume of cell
68  Double_t fIntegral; // Integral over cell (estimate from exploration)
69  Double_t fDrive; // Driver integral, only for cell build-up
70  //---------- working space for the user --------------
71  TObject *fElement; // may set by the user to save some data in this cell
72 
73  //////////////////////////////////////////////////////////////////////////////////////
74  // METHODS //
75  //////////////////////////////////////////////////////////////////////////////////////
76  public:
77  PDEFoamCell(); // Default Constructor for ROOT streamers
78  PDEFoamCell(Int_t); // User Constructor
79  PDEFoamCell(const PDEFoamCell&); // Copy constructor
80  virtual ~PDEFoamCell(); // Destructor
81  void Fill(Int_t, PDEFoamCell*, PDEFoamCell*, PDEFoamCell*); // Assigns values of attributes
82  //--------------- Geometry ----------------------------------
83  Double_t GetXdiv() const { return fXdiv;} // Pointer to Xdiv
84  Int_t GetBest() const { return fBest;} // Pointer to Best
85  void SetBest(Int_t Best){ fBest =Best;} // Set Best edge candidate
86  void SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;} // Set x-division for best edge cand.
87  void GetHcub( PDEFoamVect&, PDEFoamVect&) const; // Get position and size vectors (h-cubical subspace)
88  void GetHSize( PDEFoamVect& ) const; // Get size only of cell vector (h-cubical subspace)
89  //--------------- Integrals/Volumes -------------------------
90  void CalcVolume(); // Calculates volume of cell
91  Double_t GetVolume() const { return fVolume;} // Volume of cell
92  Double_t GetIntg() const { return fIntegral;} // Get Integral
93  Double_t GetDriv() const { return fDrive;} // Get Drive
94  void SetIntg(Double_t Intg){ fIntegral=Intg;} // Set true integral
95  void SetDriv(Double_t Driv){ fDrive =Driv;} // Set driver integral
96  //--------------- linked tree organization ------------------
97  Int_t GetStat() const { return fStatus;} // Get Status
98  void SetStat(Int_t Stat){ fStatus=Stat;} // Set Status
99  PDEFoamCell* GetPare() const { return (PDEFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell
100  PDEFoamCell* GetDau0() const { return (PDEFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
101  PDEFoamCell* GetDau1() const { return (PDEFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
102  void SetDau0(PDEFoamCell* Daug){ fDaught0 = Daug;} // Set pointer to 1-st daughter
103  void SetDau1(PDEFoamCell* Daug){ fDaught1 = Daug;} // Set pointer to 2-nd daughter
104  void SetPare(PDEFoamCell* Pare){ fParent = Pare;} // Set pointer to parent
105  void SetSerial(Int_t Serial){ fSerial=Serial;} // Set serial number
106  Int_t GetSerial() const { return fSerial;} // Get serial number
107  UInt_t GetDepth(); // Get depth in binary tree
108  UInt_t GetTreeDepth(UInt_t depth=0); // Get depth of binary tree
109  //--- other ---
110  void Print(Option_t *option) const ; // Prints cell content
111  //--- getter and setter for user variable ---
112  void SetElement(TObject* fobj){ fElement = fobj; } // Set user variable
113  TObject* GetElement() const { return fElement; } // Get pointer to user varibale
114  ////////////////////////////////////////////////////////////////////////////
115  ClassDef(PDEFoamCell,2) //Single cell of FOAM
116  }; // end of PDEFoamCell
117 } // namespace TMVA
118 
119 #endif
PDEFoamCell * GetDau1() const
Definition: PDEFoamCell.h:101
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:112
void Print(Option_t *option) const
Printout of the cell geometry parameters for the debug purpose.
TObject * fElement
Definition: PDEFoamCell.h:71
const char Option_t
Definition: RtypesCore.h:62
Double_t GetVolume() const
Definition: PDEFoamCell.h:91
void Fill(Int_t, PDEFoamCell *, PDEFoamCell *, PDEFoamCell *)
Fills in certain data into newly allocated cell.
void SetPare(PDEFoamCell *Pare)
Definition: PDEFoamCell.h:104
int Int_t
Definition: RtypesCore.h:41
virtual ~PDEFoamCell()
Destructor.
void SetBest(Int_t Best)
Definition: PDEFoamCell.h:85
PDEFoamCell * GetPare() const
Definition: PDEFoamCell.h:99
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject...
Definition: TRef.h:34
Double_t fIntegral
Definition: PDEFoamCell.h:68
#define ClassDef(name, id)
Definition: Rtypes.h:254
void SetDau1(PDEFoamCell *Daug)
Definition: PDEFoamCell.h:103
Int_t GetBest() const
Definition: PDEFoamCell.h:84
void SetXdiv(Double_t Xdiv)
Definition: PDEFoamCell.h:86
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:98
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:95
Double_t fVolume
Definition: PDEFoamCell.h:67
TObject * GetElement() const
Definition: PDEFoamCell.h:113
Int_t GetSerial() const
Definition: PDEFoamCell.h:106
Double_t GetIntg() const
Definition: PDEFoamCell.h:92
PDEFoamCell()
Default constructor for streamer.
Definition: PDEFoamCell.cxx:49
double Double_t
Definition: RtypesCore.h:55
Double_t GetXdiv() const
Definition: PDEFoamCell.h:83
PDEFoamCell * GetDau0() const
Definition: PDEFoamCell.h:100
void SetSerial(Int_t Serial)
Definition: PDEFoamCell.h:105
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:94
Abstract ClassifierFactory template that handles arbitrary types.
Int_t GetStat() const
Definition: PDEFoamCell.h:97
Double_t GetDriv() const
Definition: PDEFoamCell.h:93
void SetDau0(PDEFoamCell *Daug)
Definition: PDEFoamCell.h:102