00001 00002 /********************************************************************************** 00003 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00004 * Package: TMVA * 00005 * Classes: PDEFoamCell * 00006 * Web : http://tmva.sourceforge.net * 00007 * * 00008 * Description: * 00009 * Objects of this class are hyperrectangular cells organized in * 00010 * the binary tree. Special algoritm for encoding relalive * 00011 * positioning of the cells saves total memory allocation needed * 00012 * for the system of cells. * 00013 * * 00014 * Authors (alphabetical): * 00015 * S. Jadach - Institute of Nuclear Physics, Cracow, Poland * 00016 * Tancredi Carli - CERN, Switzerland * 00017 * Dominik Dannheim - CERN, Switzerland * 00018 * Alexander Voigt - CERN, Switzerland * 00019 * * 00020 * Copyright (c) 2008: * 00021 * CERN, Switzerland * 00022 * MPI-K Heidelberg, Germany * 00023 * * 00024 * Redistribution and use in source and binary forms, with or without * 00025 * modification, are permitted according to the terms listed in LICENSE * 00026 * (http://tmva.sourceforge.net/LICENSE) * 00027 **********************************************************************************/ 00028 00029 #ifndef ROOT_TMVA_PDEFoamCell 00030 #define ROOT_TMVA_PDEFoamCell 00031 00032 #ifndef ROOT_TObject 00033 #include "TObject.h" 00034 #endif 00035 #ifndef ROOT_TRef 00036 #include "TRef.h" 00037 #endif 00038 00039 #ifndef ROOT_TMVA_PDEFoamVect 00040 #include "TMVA/PDEFoamVect.h" 00041 #endif 00042 00043 namespace TMVA { 00044 00045 class PDEFoamCell : public TObject { 00046 00047 // static, the same for all cells! 00048 private: 00049 Short_t fDim; // Dimension of the vector space 00050 // MEMBERS 00051 00052 private: 00053 //--- linked tree organization --- 00054 Int_t fSerial; // Serial number 00055 Int_t fStatus; // Status (active, inactive) 00056 TRef fParent; // Pointer to parent cell 00057 TRef fDaught0; // Pointer to daughter 1 00058 TRef fDaught1; // Pointer to daughter 2 00059 //--- M.C. sampling and choice of the best edge --- 00060 00061 private: 00062 Double_t fXdiv; // Factor for division 00063 Int_t fBest; // Best Edge for division 00064 //--- Integrals of all kinds --- 00065 Double_t fVolume; // Cartesian Volume of cell 00066 Double_t fIntegral; // Integral over cell (estimate from exploration) 00067 Double_t fDrive; // Driver integral, only for cell build-up 00068 //---------- working space for the user -------------- 00069 TObject *fElement; // may set by the user to save some data in this cell 00070 00071 ////////////////////////////////////////////////////////////////////////////////////// 00072 // METHODS // 00073 ////////////////////////////////////////////////////////////////////////////////////// 00074 public: 00075 PDEFoamCell(); // Default Constructor for ROOT streamers 00076 PDEFoamCell(Int_t); // User Constructor 00077 PDEFoamCell(const PDEFoamCell&); // Copy constructor 00078 virtual ~PDEFoamCell(); // Destructor 00079 void Fill(Int_t, PDEFoamCell*, PDEFoamCell*, PDEFoamCell*); // Assigns values of attributes 00080 //--------------- Geometry ---------------------------------- 00081 Double_t GetXdiv() const { return fXdiv;} // Pointer to Xdiv 00082 Int_t GetBest() const { return fBest;} // Pointer to Best 00083 void SetBest(Int_t Best){ fBest =Best;} // Set Best edge candidate 00084 void SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;} // Set x-division for best edge cand. 00085 void GetHcub( PDEFoamVect&, PDEFoamVect&) const; // Get position and size vectors (h-cubical subspace) 00086 void GetHSize( PDEFoamVect& ) const; // Get size only of cell vector (h-cubical subspace) 00087 //--------------- Integrals/Volumes ------------------------- 00088 void CalcVolume(); // Calculates volume of cell 00089 Double_t GetVolume() const { return fVolume;} // Volume of cell 00090 Double_t GetIntg() const { return fIntegral;} // Get Integral 00091 Double_t GetDriv() const { return fDrive;} // Get Drive 00092 void SetIntg(Double_t Intg){ fIntegral=Intg;} // Set true integral 00093 void SetDriv(Double_t Driv){ fDrive =Driv;} // Set driver integral 00094 //--------------- linked tree organization ------------------ 00095 Int_t GetStat() const { return fStatus;} // Get Status 00096 void SetStat(Int_t Stat){ fStatus=Stat;} // Set Status 00097 PDEFoamCell* GetPare() const { return (PDEFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell 00098 PDEFoamCell* GetDau0() const { return (PDEFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex 00099 PDEFoamCell* GetDau1() const { return (PDEFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex 00100 void SetDau0(PDEFoamCell* Daug){ fDaught0 = Daug;} // Set pointer to 1-st daughter 00101 void SetDau1(PDEFoamCell* Daug){ fDaught1 = Daug;} // Set pointer to 2-nd daughter 00102 void SetPare(PDEFoamCell* Pare){ fParent = Pare;} // Set pointer to parent 00103 void SetSerial(Int_t Serial){ fSerial=Serial;} // Set serial number 00104 Int_t GetSerial() const { return fSerial;} // Get serial number 00105 UInt_t GetDepth(); // Get depth in binary tree 00106 //--- other --- 00107 void Print(Option_t *option) const ; // Prints cell content 00108 //--- getter and setter for user variable --- 00109 void SetElement(TObject* fobj){ fElement = fobj; } // Set user variable 00110 TObject* GetElement() const { return fElement; } // Get pointer to user varibale 00111 //////////////////////////////////////////////////////////////////////////// 00112 ClassDef(PDEFoamCell,1) //Single cell of FOAM 00113 }; // end of PDEFoamCell 00114 } // namespace TMVA 00115 00116 #endif