TFoamCell.h

Go to the documentation of this file.
00001 // @(#)root/foam:$Id: TFoamCell.h 22726 2008-03-19 09:53:41Z pcanal $
00002 // Author: S. Jadach <mailto:Stanislaw.jadach@ifj.edu.pl>, P.Sawicki <mailto:Pawel.Sawicki@ifj.edu.pl>
00003 
00004 #ifndef ROOT_TFoamCell
00005 #define ROOT_TFoamCell
00006 
00007 ////////////////////////////////////////////////////////////////////////////////////
00008 // Class TFoamCell  used in TFoam                                                 //
00009 //                                                                                //
00010 // Objects of this class are hyperrectangular cells organized in the binary tree. //
00011 // Special algoritm for encoding relalive positioning of the cells                //
00012 // saves total memory allocation needed for the system of cells.                  //
00013 ////////////////////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef ROOT_TRef
00016 #include "TRef.h"
00017 #endif
00018 
00019 class TFoamVect;
00020 
00021 
00022 class TFoamCell : public TObject {
00023    //   static, the same for all cells!
00024 private:
00025    Short_t  fDim;                   // Dimension of the vector space
00026    //   MEMBERS
00027 private:
00028    //--- linked tree organization ---
00029    Int_t    fSerial;                // Serial number
00030    Int_t    fStatus;                // Status (active, inactive)
00031    TRef     fParent;                // Pointer to parent cell
00032    TRef     fDaught0;               // Pointer to daughter 1
00033    TRef     fDaught1;               // Pointer to daughter 2
00034    //--- M.C. sampling and choice of the best edge ---
00035 private:
00036    Double_t fXdiv;                  // Factor for division
00037    Int_t    fBest;                  // Best Edge for division
00038    //--- Integrals of all kinds ---
00039    Double_t fVolume;                // Cartesian Volume of cell
00040    Double_t fIntegral;              // Integral over cell (estimate from exploration)
00041    Double_t fDrive;                 // Driver  integral, only for cell build-up
00042    Double_t fPrimary;               // Primary integral, only for MC generation
00043    //////////////////////////////////////////////////////////////////////////////////////
00044    //                           METHODS                                                //
00045    //////////////////////////////////////////////////////////////////////////////////////
00046 public:
00047    TFoamCell();                          // Default Constructor for ROOT streamers
00048    TFoamCell(Int_t);                     // User Constructor
00049    TFoamCell(TFoamCell &);               // Copy Constructor
00050    virtual ~TFoamCell();                 // Destructor
00051    void  Fill(Int_t, TFoamCell*, TFoamCell*, TFoamCell*);    // Assigns values of attributes
00052    TFoamCell&  operator=(const TFoamCell&);       // Substitution operator (never used)
00053    //--------------- Geometry ----------------------------------
00054    Double_t  GetXdiv() const { return fXdiv;}          // Pointer to Xdiv
00055    Int_t     GetBest() const { return fBest;}          // Pointer to Best
00056    void      SetBest(Int_t    Best){ fBest =Best;}     // Set Best edge candidate
00057    void      SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;}     // Set x-division for best edge cand.
00058    void      GetHcub(  TFoamVect&, TFoamVect&) const;  // Get position and size vectors (h-cubical subspace)
00059    void      GetHSize( TFoamVect& ) const;             // Get size only of cell vector  (h-cubical subspace)
00060    //--------------- Integrals/Volumes -------------------------
00061    void      CalcVolume();                             // Calculates volume of cell
00062    Double_t  GetVolume() const { return fVolume;}      // Volume of cell
00063    Double_t  GetIntg() const { return fIntegral;}      // Get Integral
00064    Double_t  GetDriv() const { return fDrive;}         // Get Drive
00065    Double_t  GetPrim() const { return fPrimary;}       // Get Primary
00066    void      SetIntg(Double_t Intg){ fIntegral=Intg;}  // Set true integral
00067    void      SetDriv(Double_t Driv){ fDrive   =Driv;}  // Set driver integral
00068    void      SetPrim(Double_t Prim){ fPrimary =Prim;}  // Set primary integral
00069    //--------------- linked tree organization ------------------
00070    Int_t     GetStat() const { return fStatus;}        // Get Status
00071    void      SetStat(Int_t Stat){ fStatus=Stat;}       // Set Status
00072    TFoamCell* GetPare() const { return (TFoamCell*) fParent.GetObject(); }  // Get Pointer to parent cell
00073    TFoamCell* GetDau0() const { return (TFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
00074    TFoamCell* GetDau1() const { return (TFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
00075    void      SetDau0(TFoamCell* Daug){ fDaught0 = Daug;}  // Set pointer to 1-st daughter
00076    void      SetDau1(TFoamCell* Daug){ fDaught1 = Daug;}  // Set pointer to 2-nd daughter
00077    void      SetSerial(Int_t Serial){ fSerial=Serial;}    // Set serial number
00078    Int_t     GetSerial() const { return fSerial;}         // Get serial number
00079    //--- other ---
00080    void Print(Option_t *option) const ;                   // Prints cell content
00081    ////////////////////////////////////////////////////////////////////////////
00082    ClassDef(TFoamCell,1)  //Single cell of FOAM
00083 };
00084 /////////////////////////////////////////////////////////////////////////////
00085 #endif

Generated on Tue Jul 5 14:26:54 2011 for ROOT_528-00b_version by  doxygen 1.5.1