/** ****************************************************************** * * Module Name : VFGrid.hh * * Author/Date : C.B. Lirakis / 13-Feb-06 * * Description : * * Restrictions/Limitations : * * Change Descriptions : * * Classification : Unclassified * * References : * * * RCS header info. * ---------------- * $RCSfile$ * $Author$ * $Date$ * $Locker$ * $Name$ * $Revision$ * * $Log: $ * * ******************************************************************* */ #ifndef __VFGRID_hh_ #define __VFGRID_hh_ # include # include # include # include # include class VFGrid : public TH3 { private: // In adherence to root C++ coding conventions, private data members first. // Private Static members, there are currently none. // Private Methods void PaintSlice( const Int_t view); void PaintArrow(Int_t cell, const TVector3 &); inline Int_t IJK2Index(Int_t i, Int_t j, Int_t k) { Int_t bin = (i + (fXaxis.GetNbins()+2)*(j + (fYaxis.GetNbins()+2)*k)); if (bin>fNumber_of_cells) { printf("bin>\n"); bin = 0; } return bin; }; inline Int_t XYZ2Index(Double_t x, Double_t y, Double_t z) { Int_t binx, biny, binz; binx = fXaxis.FindBin(x); biny = fYaxis.FindBin(y); binz = fZaxis.FindBin(z); return IJK2Index( binx, biny, binz); }; // Private static methods, there are currently none. protected: Int_t fNumber_of_cells; //Total number of cells equivalent to nbins TVector3 *fCells; //[fNumber_of_cells] Vector field data Int_t *fNumber_Per_Cell; //[fNumber_of_cells] Number of entries per cell /* * Histpainter knock offs. */ Double_t *fXbuf; //!X buffer coordinates Double_t *fYbuf; //!Y buffer coordinates Double_t fDx, fDy, fDz; //!cell sizes TVector3 fMax; //Maximum vector as we know it. public: VFGrid(); VFGrid (const char *name,const char *title, Int_t nbinsx,Double_t xlow,Double_t xup, Int_t nbinsy,Double_t ylow,Double_t yup, Int_t nbinsz,Double_t zlow,Double_t zup); virtual ~VFGrid(); Int_t Fill(Double_t x, Double_t y, Double_t z, Double_t Vx, Double_t Vy, Double_t Vz); Int_t Fill( Double_t x, Double_t y, Double_t z, const TVector3 &V) { return Fill( x, y, z, V.X(), V.Y(), V.Z());}; virtual Double_t GetBinContent(Int_t bin) const; virtual void Paint(Option_t *option=""); virtual void PaintVectorField(Option_t *option=""); virtual void Draw(Option_t *option=""); virtual void Print(Option_t *option="") const; /* * Need the following methods. * Copy * Reset * SavePrimitive * SavePrimitiveHelp * UseCurrentStyle */ ClassDef(VFGrid, 0); }; #endif