|
||||
File indexing completed on 2025-01-30 10:22:56
0001 // @(#)root/tmva $Id$ 0002 // Author: S. Jadach, Tancredi Carli, Dominik Dannheim, Alexander Voigt 0003 0004 /********************************************************************************** 0005 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 0006 * Package: TMVA * 0007 * Classes: PDEFoamCell * 0008 * * 0009 * * 0010 * Description: * 0011 * Objects of this class are hyperrectangular cells organized in * 0012 * the binary tree. Special algoritm for encoding relative * 0013 * positioning of the cells saves total memory allocation needed * 0014 * for the system of cells. * 0015 * * 0016 * Authors (alphabetical): * 0017 * S. Jadach - Institute of Nuclear Physics, Cracow, Poland * 0018 * Tancredi Carli - CERN, Switzerland * 0019 * Dominik Dannheim - CERN, Switzerland * 0020 * Alexander Voigt - TU Dresden, Germany * 0021 * * 0022 * Copyright (c) 2008: * 0023 * CERN, Switzerland * 0024 * MPI-K Heidelberg, Germany * 0025 * * 0026 * Redistribution and use in source and binary forms, with or without * 0027 * modification, are permitted according to the terms listed in LICENSE * 0028 * (see tmva/doc/LICENSE) * 0029 **********************************************************************************/ 0030 0031 #ifndef ROOT_TMVA_PDEFoamCell 0032 #define ROOT_TMVA_PDEFoamCell 0033 0034 #include "TObject.h" 0035 #include "TRef.h" 0036 0037 #include "TMVA/PDEFoamVect.h" 0038 0039 namespace TMVA { 0040 0041 class PDEFoamCell : public TObject { 0042 0043 // static, the same for all cells! 0044 private: 0045 Short_t fDim; // Dimension of the vector space 0046 // MEMBERS 0047 0048 private: 0049 //--- linked tree organization --- 0050 Int_t fSerial; ///< Serial number 0051 Int_t fStatus; ///< Status (active, inactive) 0052 TRef fParent; ///< Pointer to parent cell 0053 TRef fDaught0; ///< Pointer to daughter 1 0054 TRef fDaught1; ///< Pointer to daughter 2 0055 //--- M.C. sampling and choice of the best edge --- 0056 0057 private: 0058 Double_t fXdiv; ///< Factor for division 0059 Int_t fBest; ///< Best Edge for division 0060 //--- Integrals of all kinds --- 0061 Double_t fVolume; ///< Cartesian Volume of cell 0062 Double_t fIntegral; ///< Integral over cell (estimate from exploration) 0063 Double_t fDrive; ///< Driver integral, only for cell build-up 0064 //---------- working space for the user -------------- 0065 TObject *fElement; ///< may set by the user to save some data in this cell 0066 0067 ////////////////////////////////////////////////////////////////////////////////////// 0068 // METHODS // 0069 ////////////////////////////////////////////////////////////////////////////////////// 0070 public: 0071 PDEFoamCell(); // Default Constructor for ROOT streamers 0072 PDEFoamCell(Int_t); // User Constructor 0073 PDEFoamCell(const PDEFoamCell&); // Copy constructor 0074 virtual ~PDEFoamCell(); // Destructor 0075 void Fill(Int_t, PDEFoamCell*, PDEFoamCell*, PDEFoamCell*); // Assigns values of attributes 0076 //--------------- Geometry ---------------------------------- 0077 Double_t GetXdiv() const { return fXdiv;} // Pointer to Xdiv 0078 Int_t GetBest() const { return fBest;} // Pointer to Best 0079 void SetBest(Int_t Best){ fBest =Best;} // Set Best edge candidate 0080 void SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;} // Set x-division for best edge cand. 0081 void GetHcub( PDEFoamVect&, PDEFoamVect&) const; // Get position and size vectors (h-cubical subspace) 0082 void GetHSize( PDEFoamVect& ) const; // Get size only of cell vector (h-cubical subspace) 0083 //--------------- Integrals/Volumes ------------------------- 0084 void CalcVolume(); // Calculates volume of cell 0085 Double_t GetVolume() const { return fVolume;} // Volume of cell 0086 Double_t GetIntg() const { return fIntegral;} // Get Integral 0087 Double_t GetDriv() const { return fDrive;} // Get Drive 0088 void SetIntg(Double_t Intg){ fIntegral=Intg;} // Set true integral 0089 void SetDriv(Double_t Driv){ fDrive =Driv;} // Set driver integral 0090 //--------------- linked tree organization ------------------ 0091 Int_t GetStat() const { return fStatus;} // Get Status 0092 void SetStat(Int_t Stat){ fStatus=Stat;} // Set Status 0093 PDEFoamCell* GetPare() const { return (PDEFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell 0094 PDEFoamCell* GetDau0() const { return (PDEFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex 0095 PDEFoamCell* GetDau1() const { return (PDEFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex 0096 void SetDau0(PDEFoamCell* Daug){ fDaught0 = Daug;} // Set pointer to 1-st daughter 0097 void SetDau1(PDEFoamCell* Daug){ fDaught1 = Daug;} // Set pointer to 2-nd daughter 0098 void SetPare(PDEFoamCell* Pare){ fParent = Pare;} // Set pointer to parent 0099 void SetSerial(Int_t Serial){ fSerial=Serial;} // Set serial number 0100 Int_t GetSerial() const { return fSerial;} // Get serial number 0101 UInt_t GetDepth(); // Get depth in binary tree 0102 UInt_t GetTreeDepth(UInt_t depth=0); // Get depth of binary tree 0103 //--- other --- 0104 void Print(Option_t *option) const ; // Prints cell content 0105 //--- getter and setter for user variable --- 0106 void SetElement(TObject* fobj){ fElement = fobj; } // Set user variable 0107 TObject* GetElement() const { return fElement; } // Get pointer to user variable 0108 //////////////////////////////////////////////////////////////////////////// 0109 ClassDef(PDEFoamCell,2) //Single cell of FOAM 0110 }; // end of PDEFoamCell 0111 } // namespace TMVA 0112 0113 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |