Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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