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