ROOT logo
// @(#)root/foam:$Id: TFoamCell.h 22726 2008-03-19 09:53:41Z pcanal $
// Author: S. Jadach <mailto:Stanislaw.jadach@ifj.edu.pl>, P.Sawicki <mailto:Pawel.Sawicki@ifj.edu.pl>

#ifndef ROOT_TFoamCell
#define ROOT_TFoamCell

////////////////////////////////////////////////////////////////////////////////////
// Class TFoamCell  used in TFoam                                                 //
//                                                                                //
// Objects of this class are hyperrectangular cells organized in the binary tree. //
// Special algoritm for encoding relalive positioning of the cells                //
// saves total memory allocation needed for the system of cells.                  //
////////////////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TRef
#include "TRef.h"
#endif

class TFoamVect;


class TFoamCell : public TObject {
   //   static, the same for all cells!
private:
   Short_t  fDim;                   // Dimension of the vector space
   //   MEMBERS
private:
   //--- linked tree organization ---
   Int_t    fSerial;                // Serial number
   Int_t    fStatus;                // Status (active, inactive)
   TRef     fParent;                // Pointer to parent cell
   TRef     fDaught0;               // Pointer to daughter 1
   TRef     fDaught1;               // Pointer to daughter 2
   //--- M.C. sampling and choice of the best edge ---
private:
   Double_t fXdiv;                  // Factor for division
   Int_t    fBest;                  // Best Edge for division
   //--- Integrals of all kinds ---
   Double_t fVolume;                // Cartesian Volume of cell
   Double_t fIntegral;              // Integral over cell (estimate from exploration)
   Double_t fDrive;                 // Driver  integral, only for cell build-up
   Double_t fPrimary;               // Primary integral, only for MC generation
   //////////////////////////////////////////////////////////////////////////////////////
   //                           METHODS                                                //
   //////////////////////////////////////////////////////////////////////////////////////
public:
   TFoamCell();                          // Default Constructor for ROOT streamers
   TFoamCell(Int_t);                     // User Constructor
   TFoamCell(TFoamCell &);               // Copy Constructor
   virtual ~TFoamCell();                 // Destructor
   void  Fill(Int_t, TFoamCell*, TFoamCell*, TFoamCell*);    // Assigns values of attributes
   TFoamCell&  operator=(const TFoamCell&);       // Substitution operator (never used)
   //--------------- Geometry ----------------------------------
   Double_t  GetXdiv() const { return fXdiv;}          // Pointer to Xdiv
   Int_t     GetBest() const { return fBest;}          // Pointer to Best
   void      SetBest(Int_t    Best){ fBest =Best;}     // Set Best edge candidate
   void      SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;}     // Set x-division for best edge cand.
   void      GetHcub(  TFoamVect&, TFoamVect&) const;  // Get position and size vectors (h-cubical subspace)
   void      GetHSize( TFoamVect& ) const;             // Get size only of cell vector  (h-cubical subspace)
   //--------------- Integrals/Volumes -------------------------
   void      CalcVolume();                             // Calculates volume of cell
   Double_t  GetVolume() const { return fVolume;}      // Volume of cell
   Double_t  GetIntg() const { return fIntegral;}      // Get Integral
   Double_t  GetDriv() const { return fDrive;}         // Get Drive
   Double_t  GetPrim() const { return fPrimary;}       // Get Primary
   void      SetIntg(Double_t Intg){ fIntegral=Intg;}  // Set true integral
   void      SetDriv(Double_t Driv){ fDrive   =Driv;}  // Set driver integral
   void      SetPrim(Double_t Prim){ fPrimary =Prim;}  // Set primary integral
   //--------------- linked tree organization ------------------
   Int_t     GetStat() const { return fStatus;}        // Get Status
   void      SetStat(Int_t Stat){ fStatus=Stat;}       // Set Status
   TFoamCell* GetPare() const { return (TFoamCell*) fParent.GetObject(); }  // Get Pointer to parent cell
   TFoamCell* GetDau0() const { return (TFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
   TFoamCell* GetDau1() const { return (TFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
   void      SetDau0(TFoamCell* Daug){ fDaught0 = Daug;}  // Set pointer to 1-st daughter
   void      SetDau1(TFoamCell* Daug){ fDaught1 = Daug;}  // Set pointer to 2-nd daughter
   void      SetSerial(Int_t Serial){ fSerial=Serial;}    // Set serial number
   Int_t     GetSerial() const { return fSerial;}         // Get serial number
   //--- other ---
   void Print(Option_t *option) const ;                   // Prints cell content
   ////////////////////////////////////////////////////////////////////////////
   ClassDef(TFoamCell,1)  //Single cell of FOAM
};
/////////////////////////////////////////////////////////////////////////////
#endif
 TFoamCell.h:1
 TFoamCell.h:2
 TFoamCell.h:3
 TFoamCell.h:4
 TFoamCell.h:5
 TFoamCell.h:6
 TFoamCell.h:7
 TFoamCell.h:8
 TFoamCell.h:9
 TFoamCell.h:10
 TFoamCell.h:11
 TFoamCell.h:12
 TFoamCell.h:13
 TFoamCell.h:14
 TFoamCell.h:15
 TFoamCell.h:16
 TFoamCell.h:17
 TFoamCell.h:18
 TFoamCell.h:19
 TFoamCell.h:20
 TFoamCell.h:21
 TFoamCell.h:22
 TFoamCell.h:23
 TFoamCell.h:24
 TFoamCell.h:25
 TFoamCell.h:26
 TFoamCell.h:27
 TFoamCell.h:28
 TFoamCell.h:29
 TFoamCell.h:30
 TFoamCell.h:31
 TFoamCell.h:32
 TFoamCell.h:33
 TFoamCell.h:34
 TFoamCell.h:35
 TFoamCell.h:36
 TFoamCell.h:37
 TFoamCell.h:38
 TFoamCell.h:39
 TFoamCell.h:40
 TFoamCell.h:41
 TFoamCell.h:42
 TFoamCell.h:43
 TFoamCell.h:44
 TFoamCell.h:45
 TFoamCell.h:46
 TFoamCell.h:47
 TFoamCell.h:48
 TFoamCell.h:49
 TFoamCell.h:50
 TFoamCell.h:51
 TFoamCell.h:52
 TFoamCell.h:53
 TFoamCell.h:54
 TFoamCell.h:55
 TFoamCell.h:56
 TFoamCell.h:57
 TFoamCell.h:58
 TFoamCell.h:59
 TFoamCell.h:60
 TFoamCell.h:61
 TFoamCell.h:62
 TFoamCell.h:63
 TFoamCell.h:64
 TFoamCell.h:65
 TFoamCell.h:66
 TFoamCell.h:67
 TFoamCell.h:68
 TFoamCell.h:69
 TFoamCell.h:70
 TFoamCell.h:71
 TFoamCell.h:72
 TFoamCell.h:73
 TFoamCell.h:74
 TFoamCell.h:75
 TFoamCell.h:76
 TFoamCell.h:77
 TFoamCell.h:78
 TFoamCell.h:79
 TFoamCell.h:80
 TFoamCell.h:81
 TFoamCell.h:82
 TFoamCell.h:83
 TFoamCell.h:84
 TFoamCell.h:85