// @(#)root/foam:$Id$ // Author: S. Jadach , P.Sawicki #ifndef ROOT_TFoamCell #define ROOT_TFoamCell #include "TRef.h" 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) // For backwards compatibility. The TFoam v1 and v2 classes use these // members. Getting rid of them and doing a schema evolution rule for // TFoamCell doesn't seem to work, because the TRefs can't be dereferenced // at that point yet. TRef fParent; ///< Pointer to parent cell TRef fDaught0; ///< Pointer to daughter 1 TRef fDaught1; ///< Pointer to daughter 2 Int_t fParentIdx = -1; ///< Serial number of parent cell Int_t fDaught0Idx = -1; ///< Serial number of daughter 1 Int_t fDaught1Idx = -1; ///< Serial number of daughter 2 // Note: the fCells member doesn't take part in IO because it will be filled by the TFoam object. TFoamCell** fCells = nullptr; ///= 0 ? fCells[fParentIdx] : (TFoamCell*) fParent.GetObject(); } // Get Pointer to parent cell TFoamCell* GetDau0() const { return fDaught0Idx >= 0 ? fCells[fDaught0Idx] : (TFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex TFoamCell* GetDau1() const { return fDaught1Idx >= 0 ? fCells[fDaught1Idx] : (TFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex void SetDau0(TFoamCell* Daug){ fDaught0Idx = Daug ? Daug->fSerial : -1;} // Set pointer to 1-st daughter void SetDau1(TFoamCell* Daug){ fDaught1Idx = Daug ? Daug->fSerial : -1;} // 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 void SetCells(TFoamCell** cells) { fCells = cells;} // Set the pointer to the cells array TFoamCell** GetCells() const { return fCells;} // Return the pointer to the cells array //--- other --- void Print(Option_t *option) const override ; // Prints cell content ClassDefOverride(TFoamCell,2) //Single cell of FOAM }; #endif