library: libGeom
#include "TGeoVolume.h"

TGeoVolume


class description - source file - inheritance tree (.pdf)

class TGeoVolume : public TNamed, public TGeoAtt, public TAttLine, public TAttFill, public TAtt3D

Inheritance Chart:
TObject
<-
TNamed
TGeoAtt
TAttLine
TAttFill
TAtt3D
<-
TGeoVolume
<-
TGeoVolumeAssembly
TGeoVolumeMulti

    public:
TGeoVolume() TGeoVolume(const char* name, const TGeoShape* shape, const TGeoMedium* med = 0) TGeoVolume(const TGeoVolume&) virtual ~TGeoVolume() virtual void AddNode(const TGeoVolume* vol, Int_t copy_no, TGeoMatrix* mat = 0, Option_t* option) void AddNodeOffset(const TGeoVolume* vol, Int_t copy_no, Double_t offset = 0, Option_t* option) virtual void AddNodeOverlap(const TGeoVolume* vol, Int_t copy_no, TGeoMatrix* mat = 0, Option_t* option) virtual void Browse(TBrowser* b) virtual void cd(Int_t inode) const void CheckGeometry(Int_t nrays = 1, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0) const void CheckOverlaps(Double_t ovlp = 0.1, Option_t* option) const void CheckShapes() static TClass* Class() void CleanAll() void ClearNodes() void ClearShape() TGeoVolume* CloneVolume() const Bool_t Contains(Double_t* point) const Int_t CountNodes(Int_t nlevels = 1000, Int_t option = 0) virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual TGeoVolume* Divide(const char* divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0, Option_t* option) virtual void Draw(Option_t* option) virtual void DrawOnly(Option_t* option) virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) Bool_t FindMatrixOfDaughterVolume(TGeoVolume* vol) const TGeoNode* FindNode(const char* name) const void FindOverlaps() const virtual Int_t GetByteCount() const TObject* GetField() const TGeoPatternFinder* GetFinder() const TGeoManager* GetGeoManager() const Int_t GetIndex(const TGeoNode* node) const TGeoMaterial* GetMaterial() const TGeoMedium* GetMedium() const Int_t GetNdaughters() const TGeoNode* GetNode(const char* name) const TGeoNode* GetNode(Int_t i) const Int_t GetNodeIndex(const TGeoNode* node, Int_t* check_list, Int_t ncheck) const TObjArray* GetNodes() Int_t GetNtotal() const Int_t GetNumber() const virtual char* GetObjectInfo(Int_t px, Int_t py) const Bool_t GetOptimalVoxels() const virtual Option_t* GetOption() const char* GetPointerName() const TGeoShape* GetShape() const Char_t GetTransparency() const TGeoVoxelFinder* GetVoxels() const void GrabFocus() void Gsord(Int_t) void InspectMaterial() const void InspectShape() const void InvisibleAll(Bool_t flag = kTRUE) virtual TClass* IsA() const Bool_t IsAllInvisible() const virtual Bool_t IsAssembly() const Bool_t IsCylVoxels() const virtual Bool_t IsFolder() const Bool_t IsRaytracing() const Bool_t IsRunTime() const Bool_t IsStyleDefault() const Bool_t IsTopVolume() const Bool_t IsValid() const Bool_t IsVisible() const Bool_t IsVisibleDaughters() const virtual Bool_t IsVolumeMulti() const Bool_t IsXYZVoxels() const TH2F* LegoPlot(Int_t ntheta = 20, Double_t themin = 0., Double_t themax = 180., Int_t nphi = 60, Double_t phimin = 0., Double_t phimax = 360., Double_t rmin = 0., Double_t rmax = 9999999, Option_t* option) void MakeCopyNodes(const TGeoVolume* other) virtual TGeoVolume* MakeCopyVolume(TGeoShape* newshape) TGeoVolume& operator=(const TGeoVolume&) Bool_t OptimizeVoxels() virtual void Paint(Option_t* option) void PrintNodes() const void PrintVoxels() const void RandomPoints(Int_t npoints = 1000000, Option_t* option) void RandomRays(Int_t nrays = 10000, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0) void Raytrace(Bool_t flag = kTRUE) void SaveAs(const char* filename) virtual void SavePrimitive(ofstream& out, Option_t* option) void SetAsTopVolume() void SetCurrentPoint(Double_t x, Double_t y, Double_t z) void SetCylVoxels(Bool_t flag = kTRUE) void SetField(const TObject* field) void SetFinder(const TGeoPatternFinder* finder) void SetInvisible() virtual void SetLineColor(Color_t lcolor) virtual void SetLineStyle(Style_t lstyle) virtual void SetLineWidth(Width_t lwidth) virtual void SetMedium(const TGeoMedium* medium) void SetNodes(TObjArray* nodes) void SetNtotal(Int_t ntotal) void SetNumber(Int_t number) void SetOption(const char* option) void SetShape(const TGeoShape* shape) void SetTransparency(Char_t transparency = 0) virtual void SetVisibility(Bool_t vis = kTRUE) void SetVoxelFinder(const TGeoVoxelFinder* finder) virtual void ShowMembers(TMemberInspector& insp, char* parent) void SortNodes() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void UnmarkSaved() Bool_t Valid() const void VisibleDaughters(Bool_t vis = kTRUE) void Voxelize(Option_t* option) Double_t Weight(Double_t precision = 0.01, Option_t* option = "v")

Data Members


    protected:
TObjArray* fNodes array of nodes inside this volume TGeoShape* fShape shape TGeoMedium* fMedium tracking medium TGeoPatternFinder* fFinder finder object for divisions TGeoVoxelFinder* fVoxels finder object for bounding boxes TGeoManager* fGeoManager ! pointer to TGeoManager owning this volume TObject* fField ! just a hook for now TString fOption ! option - if any Int_t fNumber volume serial number in the list of volumes Int_t fNtotal total number of physical nodes public:
static const TGeoVolume::EGeoVolumeTypes kVolumeDiv static const TGeoVolume::EGeoVolumeTypes kVolumeOverlap static const TGeoVolume::EGeoVolumeTypes kVolumeImportNodes static const TGeoVolume::EGeoVolumeTypes kVolumeMulti static const TGeoVolume::EGeoVolumeTypes kVoxelsXYZ static const TGeoVolume::EGeoVolumeTypes kVoxelsCyl static const TGeoVolume::EGeoVolumeTypes kVolumeClone

Class Description


TGeoVolume()
 dummy constructor

TGeoVolume(const char *name, const TGeoShape *shape, const TGeoMedium *med) :TNamed(name, "")
 default constructor

~TGeoVolume()
 Destructor

void Browse(TBrowser *b)
 How to browse a volume

void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const
 Shoot nrays with random directions from starting point (startx, starty, startz)
 in the reference frame of this volume. Track each ray until exiting geometry, then
 shoot backwards from exiting point and compare boundary crossing points.

void CheckOverlaps(Double_t ovlp, Option_t *option) const
 Overlap checking tool. Check for illegal overlaps within a limit OVLP.

void CleanAll()

void ClearShape()

void CheckShapes()
 check for negative parameters in shapes.
 THIS METHOD LEAVES SOME GARBAGE NODES -> memory leak, to be fixed
   printf("---Checking daughters of volume %s\n", GetName());

Int_t CountNodes(Int_t nlevels, Int_t option)
 Count total number of subnodes starting from this volume, nlevels down
 option = 0 (default) - count only once per volume
 option = 1           - count every time
 option = 2           - count volumes on visible branches

Bool_t IsFolder() const
 Return TRUE if volume contains nodes

Bool_t IsStyleDefault() const
 check if the visibility and attributes are the default ones

Bool_t IsTopVolume() const
 True if this is the top volume of the geometry

Bool_t IsRaytracing() const

void InspectMaterial() const

void cd(Int_t inode) const
 Actualize matrix of node indexed <inode>

void AddNode(const TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t * /*option*/)
 Add a TGeoNode to the list of nodes. This is the usual method for adding
 daughters inside the container volume.

void AddNodeOffset(const TGeoVolume *vol, Int_t copy_no, Double_t offset, Option_t * /*option*/)
 Add a division node to the list of nodes. The method is called by
 TGeoVolume::Divide() for creating the division nodes.

void AddNodeOverlap(const TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t * /*option*/)
 Add a TGeoNode to the list of nodes. This is the usual method for adding
 daughters inside the container volume.

TGeoVolume* Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed, Option_t *option)
 Division a la G3. The volume will be divided along IAXIS (see shape classes), in NDIV
 slices, from START with given STEP. The division volumes will have medium number NUMED.
 If NUMED=0 they will get the medium number of the divided volume (this). If NDIV<=0,
 all range of IAXIS will be divided and the resulting number of divisions will be centered on
 IAXIS. If STEP<=0, the real STEP will be computed as the full range of IAXIS divided by NDIV.
 Options (case insensitive):
  N  - divide all range in NDIV cells (same effect as STEP<=0) (GSDVN in G3)
  NX - divide range starting with START in NDIV cells          (GSDVN2 in G3)
  S  - divide all range with given STEP. NDIV is computed and divisions will be centered
         in full range (same effect as NDIV<=0)                (GSDVS, GSDVT in G3)
  SX - same as DVS, but from START position.                   (GSDVS2, GSDVT2 in G3)

Int_t DistancetoPrimitive(Int_t px, Int_t py)
 compute the closest distance of approach from point px,py to this volume

void Draw(Option_t *option)
 draw top volume according to option

void DrawOnly(Option_t *option)
 draw only this volume

Bool_t OptimizeVoxels()
 Perform an exensive sampling to find which type of voxelization is
 most efficient.

void Paint(Option_t *option)
 paint volume

void PrintVoxels() const

void PrintNodes() const
 print nodes

TH2F* LegoPlot(Int_t ntheta, Double_t themin, Double_t themax, Int_t nphi, Double_t phimin, Double_t phimax, Double_t rmin, Double_t rmax, Option_t *option)
 Generate a lego plot fot the top volume, according to option.

void RandomPoints(Int_t npoints, Option_t *option)
 Draw random points in the bounding box of this volume.

void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz)
 Random raytracing method.

void Raytrace(Bool_t flag)
 Draw this volume with current settings and perform raytracing in the pad.

void SaveAs(const char *filename)
  Save geometry having this as top volume as a C++ macro.

void SavePrimitive(ofstream &out, Option_t *option)
 Save a primitive as a C++ statement(s) on output stream "out".

void UnmarkSaved()
 Reset SavePrimitive bits.

void ExecuteEvent(Int_t event, Int_t px, Int_t py)
 Execute mouse actions on this volume.

TGeoNode* FindNode(const char *name) const
 search a daughter inside the list of nodes

Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const

Int_t GetIndex(const TGeoNode *node) const
 get index number for a given daughter

char* GetObjectInfo(Int_t px, Int_t py) const

Bool_t GetOptimalVoxels() const
--- Returns true if cylindrical voxelization is optimal.

char* GetPointerName() const
 Provide a pointer name containing uid.

void GrabFocus()
 Move perspective view focus to this volume

TGeoVolume* CloneVolume() const

void MakeCopyNodes(const TGeoVolume *other)
 make a new list of nodes and copy all nodes of other volume inside

TGeoVolume* MakeCopyVolume(TGeoShape *newshape)
 make a copy of this volume
    printf("   Making a copy of %s\n", GetName());

void SetAsTopVolume()

void SetCurrentPoint(Double_t x, Double_t y, Double_t z)

void SetShape(const TGeoShape *shape)
 set the shape associated with this volume

void SortNodes()
 sort nodes by decreasing volume of the bounding box. ONLY nodes comes first,
 then overlapping nodes and finally division nodes.

void Streamer(TBuffer &R__b)
 Stream an object of class TGeoVolume.

void SetOption(const char * /*option*/)
 set the current options

void SetLineColor(Color_t lcolor)

void SetLineStyle(Style_t lstyle)

void SetLineWidth(Style_t lwidth)

TGeoNode* GetNode(const char *name) const
 get the pointer to a daughter node

Int_t GetByteCount() const
 get the total size in bytes for this volume

void FindOverlaps() const
 loop all nodes marked as overlaps and find overlaping brothers

void SetVisibility(Bool_t vis)
 set visibility of this volume

Bool_t Valid() const

Bool_t FindMatrixOfDaughterVolume(TGeoVolume *vol) const
 Find a daughter node having VOL as volume and fill TGeoManager::fHMatrix
 with its global matrix.

void VisibleDaughters(Bool_t vis)
 set visibility for daughters

void Voxelize(Option_t *option)
 build the voxels for this volume

Double_t Weight(Double_t precision, Option_t *option)
 Estimate the weight of a volume with SIGMA(M)/M better than PRECISION.
 Option can be : v - verbose (default)



Inline Functions


                      void ClearNodes()
                    Bool_t Contains(Double_t* point) const
                    Bool_t IsAssembly() const
                    Bool_t IsRunTime() const
                    Bool_t IsVolumeMulti() const
                    Bool_t IsCylVoxels() const
                    Bool_t IsXYZVoxels() const
                    Bool_t IsValid() const
                    Bool_t IsVisible() const
                    Bool_t IsVisibleDaughters() const
                    Bool_t IsAllInvisible() const
                TObjArray* GetNodes()
                     Int_t GetNdaughters() const
                     Int_t GetNtotal() const
              TGeoManager* GetGeoManager() const
             TGeoMaterial* GetMaterial() const
               TGeoMedium* GetMedium() const
                  TObject* GetField() const
        TGeoPatternFinder* GetFinder() const
          TGeoVoxelFinder* GetVoxels() const
                 TGeoNode* GetNode(Int_t i) const
                     Int_t GetNumber() const
                 Option_t* GetOption() const
                    Char_t GetTransparency() const
                TGeoShape* GetShape() const
                      void Gsord(Int_t)
                      void InspectShape() const
                      void SetCylVoxels(Bool_t flag = kTRUE)
                      void SetNodes(TObjArray* nodes)
                      void SetTransparency(Char_t transparency = 0)
                      void SetField(const TObject* field)
                      void SetInvisible()
                      void SetMedium(const TGeoMedium* medium)
                      void SetVoxelFinder(const TGeoVoxelFinder* finder)
                      void SetFinder(const TGeoPatternFinder* finder)
                      void SetNumber(Int_t number)
                      void SetNtotal(Int_t ntotal)
                      void InvisibleAll(Bool_t flag = kTRUE)
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void StreamerNVirtual(TBuffer& b)
                TGeoVolume TGeoVolume(const TGeoVolume&)
               TGeoVolume& operator=(const TGeoVolume&)


Author: Andrei Gheata 30/05/02
Last update: root/geom:$Name: $:$Id: TGeoVolume.cxx,v 1.58 2005/04/25 10:05:54 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.