TGeoVolume
class description - source file - inheritance tree
public:
TGeoVolume TGeoVolume()
TGeoVolume TGeoVolume(const char* name, TGeoShape* shape = 0, TGeoMaterial* mat = 0)
TGeoVolume TGeoVolume(const TGeoVolume&)
virtual void ~TGeoVolume()
virtual void AddNode(TGeoVolume* vol, Int_t copy_no, TGeoMatrix* mat, Option_t* option)
void AddNodeOffset(TGeoVolume* vol, Int_t copy_no, Double_t offset, Option_t* option)
virtual void AddNodeOverlap(TGeoVolume* vol, Int_t copy_no, TGeoMatrix* mat, Option_t* option)
virtual void Browse(TBrowser* b)
virtual void cd(Int_t inode) const
void CheckShapes()
static TClass* Class()
void CleanAll()
void ClearNodes()
void ClearShape()
Bool_t Contains(Double_t* point) const
Int_t CountNodes(Int_t nlevels = 1000) const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual TGeoVolume* Divide(const char* divname, Int_t ndiv, Option_t* option)
virtual TGeoVolume* Divide(const char* divname, Int_t ndiv, Double_t start, Double_t step, Option_t* option)
virtual TGeoVolume* Divide(const char* divname, Double_t start, Double_t end, Double_t step, Option_t* option)
virtual TGeoVolume* Divide(const char* divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
virtual TGeoVolume* Divide(const char* divname, Int_t iaxis, Double_t step)
virtual TGeoVolume* Divide(const char* divname, TObject* userdiv, Double_t* params, 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)
TGeoNode* FindNode(const char* name) const
void FindOverlaps() const
virtual Int_t GetByteCount() const
TObject* GetField() const
TGeoPatternFinder* GetFinder() const
Int_t GetIndex(TGeoNode* node) const
TGeoMaterial* GetMaterial() const
Int_t GetMedia() const
Int_t GetNdaughters() const
TGeoNode* GetNode(const char* name) const
TGeoNode* GetNode(Int_t i) const
Int_t GetNodeIndex(TGeoNode* node, Int_t* check_list, Int_t ncheck) const
TObjArray* GetNodes()
virtual char* GetObjectInfo(Int_t px, Int_t py) const
virtual Option_t* GetOption() const
TGeoShape* GetShape() const
Double_t GetUsageCount(Int_t i) const
TGeoVoxelFinder* GetVoxels() const
void Gsord(Int_t iaxis)
void InspectMaterial() const
void InspectShape() const
virtual TClass* IsA() const
virtual Bool_t IsFolder() const
Bool_t IsRunTime() const
Bool_t IsStyleDefault() const
Bool_t IsValid() const
virtual Bool_t IsVisible() const
void MakeCopyNodes(TGeoVolume* other)
TGeoVolume* MakeCopyVolume()
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 RenameCopy(Int_t copy_no)
void SetAsTopVolume()
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
void SetField(TObject* field)
void SetFinder(TGeoPatternFinder* finder)
void SetInvisible()
virtual void SetLineColor(Color_t lcolor)
virtual void SetLineStyle(Style_t lstyle)
virtual void SetLineWidth(Width_t lwidth)
void SetMaterial(TGeoMaterial* material)
void SetNodes(TObjArray* nodes)
void SetOption(const char* option)
void SetShape(TGeoShape* shape)
virtual void SetVisibility(Bool_t vis = kTRUE)
void SetVoxelFinder(TGeoVoxelFinder* finder)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Sizeof3D() const
void SortNodes()
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Bool_t Valid() const
void VisibleDaughters(Bool_t vis = kTRUE)
void Voxelize(Option_t* option)
protected:
Double_t fUsageCount[2] usage of this volume in tracking !!!
TObjArray* fNodes array of nodes inside this volume
TGeoShape* fShape shape
TGeoMaterial* fMaterial material
TGeoVoxelFinder* fVoxels finder object for bounding boxes
TGeoPatternFinder* fFinder finder object for divisions
TObject* fField !!! just a hook for now
TString fOption option - if any
public:
static const TGeoVolume::EGeoVolumeTypes kVolumeDiv
static const TGeoVolume::EGeoVolumeTypes kVolumeOverlap
static const TGeoVolume::EGeoVolumeTypes kVolumeImportNodes
static const TGeoVolume::EGeoVolumeTypes kVolumeMulti
See also
-
TGeoVolumeMulti
TGeoVolume - class containing the full description of a geometrical object.
A volume is a geometrical container possibly including other objects inside.
The volume does not store any information about his own position/transformation
nor any link to the upper level in the geometry tree. Therefore, the same
volume can be referenced several times in the geometry.
Positioned volumes are called nodes (see class TGeoNode) and can be placed
only inside other volume. In order to define a correct geometry, nodes should
not extend beyond the boundaries of their mother volume and must not overlap
between each other. These conditions can become critical when tracking a
geometry, so the package is provided with a simple but efficient checking
tool (class TGeoChecker). Note that the nodes representing the daughters of
a volume does NOT overlap with their mother - any point belonging to the
daughter will automatically NOT belong to the mother any more. The geometry
tree built in this fashion is a CSG tree with constraints.
/*
*/
A volume is referencing a shape and a material. These have to built BEFORE the
volume itself - see TGeoMaterial::TGeoMaterial() , TGeoShape::TGeoShape() .
Volumes must have unique names and any positioned volume (node) will append a
copy number to the volume's name. For instance if a volume named PAD is
referenced in several nodes, their names will become : PAD_1, PAD_2, ...
A volume can be created with the sequence :
TGeoSphere *sph = new TGeoSphere("sph1", 10.0, 11.0);
TGeoMaterial *mat = gGeoManager->GetMaterial("lead");
TGeoVolume *vol = new TGeoVolume("shield", sph, mat);
The volume is registering itself to the current TGeoManager and can be
retreived at any time with :
TGeoVolume *vol = gGeoManager->GetVolume("shield");
Deletion of volumes is also handled by TGeoManager class.
Positioning of other geometry nodes inside a volume is done by :
TGeoVolume::AddNode() method. The node to be placed does not have to
be created before :
TGeoVolume *vol_in = ...;
TGeoTranslation *tr = new TGeoTranslation(x, y, z);
TGeoNodeMatrix *node = vol->AddNodeMatrix (vol_in, tr, copy_number);
A volume can be divided according a pattern. The most simple division can
be done along an axis, in cartesian, cylindrical or spherical coordinates.
For each division type there are corresponding TGeoVolume::AddNodeOffset() and
TGeoVolume::Divide() methods. The option argument passed tothese methods can
be :
X, Y, Z - for cartesian axis divisions;
CylR, CylPhi - for cylindrical divisions;
SphR, SphPhi, SphTheta - for spherical divisions;
honeycomb - for honeycomb structures
For instance, dividing a volume in N segments along X axis, starting from Xmin
up to Xmax can be done with :
TGeoVolume::Divide(N, Xmin, Xmax, "X");
The GEANT3 option MANY is supported by TGeoVolumeOverlap class. An overlapping
volume is in fact a virtual container that does not represent a physical object.
It contains a list of nodes that are not his daughters but that must be checked
always before the container itself. This list must be defined by users and it
is checked and resolved in a priority order. Note that the feature is non-standard
to geometrical modelers and it was introduced just to support conversions of
GEANT3 geometries, therefore its extensive usage should be avoided.
The following picture represent how a simple geometry tree is built in
memory.
/*
*/
TGeoVolume()
dummy constructor
TGeoVolume(const char *name, TGeoShape *shape, TGeoMaterial *mat)
:TNamed(name, "")
default constructor
~TGeoVolume()
Destructor
void Browse(TBrowser *b)
How to browse a volume
void CleanAll()
void ClearShape()
void CheckShapes()
check for negative parameters in shapes.
printf("Checking %sn", GetName());
Int_t CountNodes(Int_t nlevels) const
count total number of subnodes starting from this volume, nlevels down
Bool_t IsFolder() const
Return TRUE if volume contains nodes
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
void InspectMaterial() const
void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option)
Add a TGeoNodePos to the list of nodes. This is the usual method for adding
daughters inside the container volume.
void AddNodeOffset(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(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option)
TGeoVolume* Divide(const char *divname, Int_t ndiv, Option_t *option)
TGeoVolume* Divide(const char *divname, Int_t ndiv, Double_t start, Double_t step, Option_t *option)
divide this volume in ndiv pieces from start, with given step
TGeoVolume* Divide(const char *divname, Double_t start, Double_t end, Double_t step, Option_t *option)
divide this volume from start to end in pieces of length step
TGeoVolume* Divide(const char *divname, TObject *userdiv, Double_t *params, Option_t *)
divide this volume according to userdiv
TGeoVolume* Divide(const char *divname, Int_t iaxis, Double_t step)
Divide all range of iaxis in range/step cells
TGeoVolume* Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
division a la 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
void Paint(Option_t *option)
paint volume
void PrintVoxels() const
void PrintNodes() const
print nodes
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 RenameCopy(Int_t copy_no)
add a copy number to this volume in order to handle gsposp
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(TGeoNode *node, Int_t *check_list, Int_t ncheck) const
Int_t GetIndex(TGeoNode *node) const
get index number for a given daughter
char* GetObjectInfo(Int_t px, Int_t py) const
void MakeCopyNodes(TGeoVolume *other)
make a new list of nodes and copy all nodes of other volume inside
TGeoVolume* MakeCopyVolume()
make a copy of this volume
void SetAsTopVolume()
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
void SetMaterial(TGeoMaterial *material)
set the material associated with this volume
void SetShape(TGeoShape *shape)
set the shape associated with this volume
void Sizeof3D() const
Compute size of this 3d object.
void SortNodes()
sort nodes by decreasing volume of the bounding box. ONLY nodes comes first,
then overlapping nodes and finally division nodes.
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
Double_t GetUsageCount(Int_t i) const
check usage count
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
void VisibleDaughters(Bool_t vis)
set visibility for daughters
void Voxelize(Option_t *option)
build the voxels for this volume
Inline Functions
void ClearNodes()
Bool_t Contains(Double_t* point) const
Bool_t IsRunTime() const
Bool_t IsValid() const
Bool_t IsVisible() const
TObjArray* GetNodes()
Int_t GetNdaughters() const
TGeoMaterial* GetMaterial() const
Int_t GetMedia() const
TObject* GetField() const
TGeoPatternFinder* GetFinder() const
TGeoVoxelFinder* GetVoxels() const
TGeoNode* GetNode(Int_t i) const
Option_t* GetOption() const
TGeoShape* GetShape() const
void Gsord(Int_t iaxis)
void InspectShape() const
void SetNodes(TObjArray* nodes)
void SetField(TObject* field)
void SetInvisible()
void SetVoxelFinder(TGeoVoxelFinder* finder)
void SetFinder(TGeoPatternFinder* finder)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
TGeoVolume TGeoVolume(const TGeoVolume&)
Author: Andrei Gheata 30/05/02
Last update: root/geom:$Name: $:$Id: TGeoVolume.cxx,v 1.5 2002/07/17 13:27:58 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - 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.