Logo ROOT   6.10/09
Reference Guide
TFoamCell.h
Go to the documentation of this file.
1 // @(#)root/foam:$Id$
2 // Author: S. Jadach <mailto:Stanislaw.jadach@ifj.edu.pl>, P.Sawicki <mailto:Pawel.Sawicki@ifj.edu.pl>
3 
4 #ifndef ROOT_TFoamCell
5 #define ROOT_TFoamCell
6 
7 ////////////////////////////////////////////////////////////////////////////////////
8 // Class TFoamCell used in TFoam //
9 // //
10 // Objects of this class are hyperrectangular cells organized in the binary tree. //
11 // Special algoritm for encoding relalive positioning of the cells //
12 // saves total memory allocation needed for the system of cells. //
13 ////////////////////////////////////////////////////////////////////////////////////
14 
15 #include "TRef.h"
16 
17 class TFoamVect;
18 
19 
20 class TFoamCell : public TObject {
21  // static, the same for all cells!
22 private:
23  Short_t fDim; // Dimension of the vector space
24  // MEMBERS
25 private:
26  //--- linked tree organization ---
27  Int_t fSerial; // Serial number
28  Int_t fStatus; // Status (active, inactive)
29  TRef fParent; // Pointer to parent cell
30  TRef fDaught0; // Pointer to daughter 1
31  TRef fDaught1; // Pointer to daughter 2
32  //--- M.C. sampling and choice of the best edge ---
33 private:
34  Double_t fXdiv; // Factor for division
35  Int_t fBest; // Best Edge for division
36  //--- Integrals of all kinds ---
37  Double_t fVolume; // Cartesian Volume of cell
38  Double_t fIntegral; // Integral over cell (estimate from exploration)
39  Double_t fDrive; // Driver integral, only for cell build-up
40  Double_t fPrimary; // Primary integral, only for MC generation
41  //////////////////////////////////////////////////////////////////////////////////////
42  // METHODS //
43  //////////////////////////////////////////////////////////////////////////////////////
44 public:
45  TFoamCell(); // Default Constructor for ROOT streamers
46  TFoamCell(Int_t); // User Constructor
47  TFoamCell(TFoamCell &); // Copy Constructor
48  virtual ~TFoamCell(); // Destructor
49  void Fill(Int_t, TFoamCell*, TFoamCell*, TFoamCell*); // Assigns values of attributes
50  TFoamCell& operator=(const TFoamCell&); // Substitution operator (never used)
51  //--------------- Geometry ----------------------------------
52  Double_t GetXdiv() const { return fXdiv;} // Pointer to Xdiv
53  Int_t GetBest() const { return fBest;} // Pointer to Best
54  void SetBest(Int_t Best){ fBest =Best;} // Set Best edge candidate
55  void SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;} // Set x-division for best edge cand.
56  void GetHcub( TFoamVect&, TFoamVect&) const; // Get position and size vectors (h-cubical subspace)
57  void GetHSize( TFoamVect& ) const; // Get size only of cell vector (h-cubical subspace)
58  //--------------- Integrals/Volumes -------------------------
59  void CalcVolume(); // Calculates volume of cell
60  Double_t GetVolume() const { return fVolume;} // Volume of cell
61  Double_t GetIntg() const { return fIntegral;} // Get Integral
62  Double_t GetDriv() const { return fDrive;} // Get Drive
63  Double_t GetPrim() const { return fPrimary;} // Get Primary
64  void SetIntg(Double_t Intg){ fIntegral=Intg;} // Set true integral
65  void SetDriv(Double_t Driv){ fDrive =Driv;} // Set driver integral
66  void SetPrim(Double_t Prim){ fPrimary =Prim;} // Set primary integral
67  //--------------- linked tree organization ------------------
68  Int_t GetStat() const { return fStatus;} // Get Status
69  void SetStat(Int_t Stat){ fStatus=Stat;} // Set Status
70  TFoamCell* GetPare() const { return (TFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell
71  TFoamCell* GetDau0() const { return (TFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
72  TFoamCell* GetDau1() const { return (TFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
73  void SetDau0(TFoamCell* Daug){ fDaught0 = Daug;} // Set pointer to 1-st daughter
74  void SetDau1(TFoamCell* Daug){ fDaught1 = Daug;} // Set pointer to 2-nd daughter
75  void SetSerial(Int_t Serial){ fSerial=Serial;} // Set serial number
76  Int_t GetSerial() const { return fSerial;} // Get serial number
77  //--- other ---
78  void Print(Option_t *option) const ; // Prints cell content
79  ////////////////////////////////////////////////////////////////////////////
80  ClassDef(TFoamCell,1) //Single cell of FOAM
81 };
82 /////////////////////////////////////////////////////////////////////////////
83 #endif
virtual ~TFoamCell()
Destructor.
Definition: TFoamCell.cxx:75
Double_t fDrive
Definition: TFoamCell.h:39
Int_t GetStat() const
Definition: TFoamCell.h:68
Double_t fIntegral
Definition: TFoamCell.h:38
Int_t fSerial
Definition: TFoamCell.h:27
const char Option_t
Definition: RtypesCore.h:62
Double_t fXdiv
Definition: TFoamCell.h:34
void SetDau1(TFoamCell *Daug)
Definition: TFoamCell.h:74
Double_t GetXdiv() const
Definition: TFoamCell.h:52
void Print(Option_t *option) const
Printout of the cell geometry parameters for the debug purpose.
Definition: TFoamCell.cxx:189
int Int_t
Definition: RtypesCore.h:41
TFoamCell * GetDau1() const
Definition: TFoamCell.h:72
Int_t fBest
Definition: TFoamCell.h:35
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject...
Definition: TRef.h:32
#define ClassDef(name, id)
Definition: Rtypes.h:297
Double_t fVolume
Definition: TFoamCell.h:37
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
Definition: TFoamCell.cxx:174
TFoamCell * GetDau0() const
Definition: TFoamCell.h:71
Double_t GetPrim() const
Definition: TFoamCell.h:63
Int_t GetSerial() const
Definition: TFoamCell.h:76
TFoamCell & operator=(const TFoamCell &)
Substitution operator = (never used)
Definition: TFoamCell.cxx:82
void SetXdiv(Double_t Xdiv)
Definition: TFoamCell.h:55
void SetDriv(Double_t Driv)
Definition: TFoamCell.h:65
TObject * GetObject() const
Return a pointer to the referenced object.
Definition: TRef.cxx:377
void SetIntg(Double_t Intg)
Definition: TFoamCell.h:64
Double_t GetIntg() const
Definition: TFoamCell.h:61
TRef fDaught1
Definition: TFoamCell.h:31
Double_t GetVolume() const
Definition: TFoamCell.h:60
Double_t GetDriv() const
Definition: TFoamCell.h:62
short Short_t
Definition: RtypesCore.h:35
void GetHSize(TFoamVect &) const
Provides size of the cell Size parameters are calculated by analyzing information in all parents cell...
Definition: TFoamCell.cxx:149
TFoamCell * GetPare() const
Definition: TFoamCell.h:70
TRef fDaught0
Definition: TFoamCell.h:30
void SetStat(Int_t Stat)
Definition: TFoamCell.h:69
void Fill(Int_t, TFoamCell *, TFoamCell *, TFoamCell *)
Fills in certain data into newly allocated cell.
Definition: TFoamCell.cxx:103
Int_t GetBest() const
Definition: TFoamCell.h:53
double Double_t
Definition: RtypesCore.h:55
void GetHcub(TFoamVect &, TFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
Definition: TFoamCell.cxx:120
TFoamCell()
Default constructor for streamer.
Definition: TFoamCell.cxx:24
void SetSerial(Int_t Serial)
Definition: TFoamCell.h:75
Mother of all ROOT objects.
Definition: TObject.h:37
TRef fParent
Definition: TFoamCell.h:29
void SetBest(Int_t Best)
Definition: TFoamCell.h:54
void SetPrim(Double_t Prim)
Definition: TFoamCell.h:66
Double_t fPrimary
Definition: TFoamCell.h:40
Short_t fDim
Definition: TFoamCell.h:23
void SetDau0(TFoamCell *Daug)
Definition: TFoamCell.h:73
Int_t fStatus
Definition: TFoamCell.h:28