Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TRef.h"
8
9class TFoamVect;
10
11
12class TFoamCell : public TObject {
13 // static, the same for all cells!
14private:
15 Short_t fDim; ///< Dimension of the vector space
16 // MEMBERS
17private:
18 //--- linked tree organization ---
19 Int_t fSerial; ///< Serial number
20 Int_t fStatus; ///< Status (active, inactive)
21
22 // For backwards compatibility. The TFoam v1 and v2 classes use these
23 // members. Getting rid of them and doing a schema evolution rule for
24 // TFoamCell doesn't seem to work, because the TRefs can't be dereferenced
25 // at that point yet.
26 TRef fParent; ///< Pointer to parent cell
27 TRef fDaught0; ///< Pointer to daughter 1
28 TRef fDaught1; ///< Pointer to daughter 2
29
30 Int_t fParentIdx = -1; ///< Serial number of parent cell
31 Int_t fDaught0Idx = -1; ///< Serial number of daughter 1
32 Int_t fDaught1Idx = -1; ///< Serial number of daughter 2
33
34 // Note: the fCells member doesn't take part in IO because it will be filled by the TFoam object.
35 TFoamCell** fCells = nullptr; ///<! Array of ALL cells, owned by the TFoam object
36 //--- M.C. sampling and choice of the best edge ---
37private:
38 Double_t fXdiv; ///< Factor for division
39 Int_t fBest; ///< Best Edge for division
40 //--- Integrals of all kinds ---
41 Double_t fVolume; ///< Cartesian Volume of cell
42 Double_t fIntegral; ///< Integral over cell (estimate from exploration)
43 Double_t fDrive; ///< Driver integral, only for cell build-up
44 Double_t fPrimary; ///< Primary integral, only for MC generation
45
46public:
47 TFoamCell(); // Default Constructor for ROOT streamers
48 TFoamCell(Int_t); // User Constructor
49 TFoamCell(TFoamCell const&) = delete; // Copy Constructor
50 TFoamCell(TFoamCell &&) = delete;
51 ~TFoamCell() override; // Destructor
52 void Fill(Int_t, TFoamCell*, TFoamCell*, TFoamCell*); // Assigns values of attributes
53 TFoamCell& operator=(const TFoamCell&) = delete; // Substitution operator (never used)
55 //--------------- Geometry ----------------------------------
56 Double_t GetXdiv() const { return fXdiv;} // Pointer to Xdiv
57 Int_t GetBest() const { return fBest;} // Pointer to Best
58 void SetBest(Int_t Best){ fBest =Best;} // Set Best edge candidate
59 void SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;} // Set x-division for best edge cand.
60 void GetHcub( TFoamVect&, TFoamVect&) const; // Get position and size vectors (h-cubical subspace)
61 void GetHSize( TFoamVect& ) const; // Get size only of cell vector (h-cubical subspace)
62 //--------------- Integrals/Volumes -------------------------
63 void CalcVolume(); // Calculates volume of cell
64 Double_t GetVolume() const { return fVolume;} // Volume of cell
65 Double_t GetIntg() const { return fIntegral;} // Get Integral
66 Double_t GetDriv() const { return fDrive;} // Get Drive
67 Double_t GetPrim() const { return fPrimary;} // Get Primary
68 void SetIntg(Double_t Intg){ fIntegral=Intg;} // Set true integral
69 void SetDriv(Double_t Driv){ fDrive =Driv;} // Set driver integral
70 void SetPrim(Double_t Prim){ fPrimary =Prim;} // Set primary integral
71 //--------------- linked tree organization ------------------
72 Int_t GetStat() const { return fStatus;} // Get Status
73 void SetStat(Int_t Stat){ fStatus=Stat;} // Set Status
74
75 // For backwards compatibility, fall back to the TRefs if the index is not set.
76 TFoamCell* GetPare() const { return fParentIdx >= 0 ? fCells[fParentIdx] : (TFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell
77 TFoamCell* GetDau0() const { return fDaught0Idx >= 0 ? fCells[fDaught0Idx] : (TFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
78 TFoamCell* GetDau1() const { return fDaught1Idx >= 0 ? fCells[fDaught1Idx] : (TFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
79
80 void SetDau0(TFoamCell* Daug){ fDaught0Idx = Daug ? Daug->fSerial : -1;} // Set pointer to 1-st daughter
81 void SetDau1(TFoamCell* Daug){ fDaught1Idx = Daug ? Daug->fSerial : -1;} // Set pointer to 2-nd daughter
82 void SetSerial(Int_t Serial){ fSerial=Serial;} // Set serial number
83 Int_t GetSerial() const { return fSerial;} // Get serial number
84 void SetCells(TFoamCell** cells) { fCells = cells;} // Set the pointer to the cells array
85 TFoamCell** GetCells() const { return fCells;} // Return the pointer to the cells array
86 //--- other ---
87 void Print(Option_t *option) const override ; // Prints cell content
88
89 ClassDefOverride(TFoamCell,2) //Single cell of FOAM
90};
91#endif
short Short_t
Definition RtypesCore.h:39
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Used by TFoam.
Definition TFoamCell.h:12
Double_t fXdiv
Factor for division.
Definition TFoamCell.h:38
void SetXdiv(Double_t Xdiv)
Definition TFoamCell.h:59
TFoamCell * GetDau1() const
Definition TFoamCell.h:78
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
TFoamCell(TFoamCell &&)=delete
TFoamCell(TFoamCell const &)=delete
TRef fDaught1
Pointer to daughter 2.
Definition TFoamCell.h:28
Double_t GetVolume() const
Definition TFoamCell.h:64
TFoamCell & operator=(const TFoamCell &)=delete
Int_t GetSerial() const
Definition TFoamCell.h:83
Double_t fIntegral
Integral over cell (estimate from exploration)
Definition TFoamCell.h:42
Int_t fStatus
Status (active, inactive)
Definition TFoamCell.h:20
Double_t GetDriv() const
Definition TFoamCell.h:66
Int_t GetStat() const
Definition TFoamCell.h:72
TFoamCell * GetDau0() const
Definition TFoamCell.h:77
Double_t GetXdiv() const
Definition TFoamCell.h:56
void SetStat(Int_t Stat)
Definition TFoamCell.h:73
Double_t fVolume
Cartesian Volume of cell.
Definition TFoamCell.h:41
Int_t fDaught0Idx
Serial number of daughter 1.
Definition TFoamCell.h:31
TRef fParent
Pointer to parent cell.
Definition TFoamCell.h:26
Double_t GetPrim() const
Definition TFoamCell.h:67
TRef fDaught0
Pointer to daughter 1.
Definition TFoamCell.h:27
void Print(Option_t *option) const override
Printout of the cell geometry parameters for the debug purpose.
void SetCells(TFoamCell **cells)
Definition TFoamCell.h:84
Int_t GetBest() const
Definition TFoamCell.h:57
void GetHcub(TFoamVect &, TFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
Definition TFoamCell.cxx:71
TFoamCell * GetPare() const
Definition TFoamCell.h:76
Double_t fDrive
Driver integral, only for cell build-up.
Definition TFoamCell.h:43
Short_t fDim
Dimension of the vector space.
Definition TFoamCell.h:15
Double_t fPrimary
Primary integral, only for MC generation.
Definition TFoamCell.h:44
TFoamCell()
Default constructor for streamer.
Definition TFoamCell.cxx:24
void SetSerial(Int_t Serial)
Definition TFoamCell.h:82
Double_t GetIntg() const
Definition TFoamCell.h:65
TFoamCell & operator=(TFoamCell &&)=delete
Int_t fDaught1Idx
Serial number of daughter 2.
Definition TFoamCell.h:32
TFoamCell ** GetCells() const
Definition TFoamCell.h:85
void Fill(Int_t, TFoamCell *, TFoamCell *, TFoamCell *)
Fills in certain data into newly allocated cell.
Definition TFoamCell.cxx:58
void SetDau1(TFoamCell *Daug)
Definition TFoamCell.h:81
void SetPrim(Double_t Prim)
Definition TFoamCell.h:70
void SetDriv(Double_t Driv)
Definition TFoamCell.h:69
TFoamCell ** fCells
! Array of ALL cells, owned by the TFoam object
Definition TFoamCell.h:35
~TFoamCell() override
Destructor.
Definition TFoamCell.cxx:51
Int_t fBest
Best Edge for division.
Definition TFoamCell.h:39
Int_t fSerial
Serial number.
Definition TFoamCell.h:19
void SetIntg(Double_t Intg)
Definition TFoamCell.h:68
void GetHSize(TFoamVect &) const
Provides size of the cell Size parameters are calculated by analyzing information in all parents cell...
void SetDau0(TFoamCell *Daug)
Definition TFoamCell.h:80
void SetBest(Int_t Best)
Definition TFoamCell.h:58
Int_t fParentIdx
Serial number of parent cell.
Definition TFoamCell.h:30
Auxiliary class TFoamVect of n-dimensional vector, with dynamic allocation used for the cartesian geo...
Definition TFoamVect.h:10
Mother of all ROOT objects.
Definition TObject.h:41
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject.
Definition TRef.h:32
TObject * GetObject() const
Return a pointer to the referenced object.
Definition TRef.cxx:377