TGeoManager


class description - source file - inheritance tree

class TGeoManager : public TNamed

    private:
void BuildCache() TGeoNode* FindInCluster(Int_t* cluster, Int_t nc) Int_t GetTouchedCluster(Int_t start, Double_t* point, Int_t* check_list, Int_t ncheck, Int_t* result) void Init() Bool_t IsLoopingVolumes() const void SetLoopVolumes(Bool_t flag = kTRUE) void Voxelize(Option_t* option = "0") public:
TGeoManager TGeoManager() TGeoManager TGeoManager(const char* name, const char* title) TGeoManager TGeoManager(const TGeoManager&) virtual void ~TGeoManager() void AddCheckedNode(TGeoNode* node, Int_t level) Int_t AddMaterial(TGeoMaterial* material) Int_t AddShape(TGeoShape* shape) Int_t AddTransformation(TGeoMatrix* matrix) Int_t AddVolume(TGeoVolume* volume) void BombTranslation(const Double_t* tr, Double_t* bombtr) virtual void Browse(TBrowser* b) void BuildDefaultMaterials() virtual Bool_t cd(const char* path) void CdDown(Int_t index) void CdTop() void CdUp() void CheckGeometry(Option_t* option) void CheckPoint(Double_t x = 0, Double_t y = 0, Double_t z = 0, Option_t* option) static TClass* Class() void CleanGarbage() void ClearAttributes() void ClearShape(TGeoShape* shape) void CloseGeometry() Int_t CountNodes(TGeoVolume* vol = 0, Int_t nlevels = 1000) void DefaultAngles() void DefaultColors() void DrawCurrentPoint(Int_t color = 2) void DrawPath(const char* path) TGeoNode* FindNextBoundary(const char* path) TGeoNode* FindNode(Bool_t safe_start = kTRUE) UChar_t* GetBits() void GetBombFactors(Double_t& bombx, Double_t& bomby, Double_t& bombz, Double_t& bombr) const Int_t GetBombMode() const virtual Int_t GetByteCount(Option_t* option = "0") TGeoNodeCache* GetCache() const Double_t* GetCldir() const Double_t* GetCldirChecked() const TGeoHMatrix* GetCurrentMatrix() const TGeoNode* GetCurrentNode() const Double_t* GetCurrentPoint() const TGeoVolume* GetCurrentVolume() const TVirtualGeoPainter* GetGeomPainter() TGeoHMatrix* GetHMatrix() Int_t GetLevel() const TList* GetListOfGVolumes() const TList* GetListOfMaterials() const TList* GetListOfMatrices() const TList* GetListOfShapes() const TList* GetListOfVolumes() const TGeoVolume* GetMasterVolume() const TGeoMaterial* GetMaterial(const char* matname) const TGeoMaterial* GetMaterial(Int_t id) const Int_t GetMaterialIndex(const char* matname) const TGeoNode* GetMother(Int_t up = 1) const TGeoNode* GetNextNode() const Int_t GetNNodes() TGeoNode* GetNode(Int_t level) const Double_t* GetNormal() const Double_t* GetNormalChecked() const Int_t GetNsegments() const const char* GetPath() const Double_t GetSafeDistance() const Int_t GetStackLevel() const Double_t GetStep() const TGeoNode* GetTopNode() const TGeoVolume* GetTopVolume() const Int_t GetVirtualLevel() Int_t GetVisLevel() const Int_t GetVisOption() const TGeoVolume* GetVolume(const char* name) const Bool_t GotoSafeLevel() void InitTrack(Double_t* point, Double_t* dir) void InitTrack(Double_t x, Double_t y, Double_t z, Double_t nx, Double_t ny, Double_t nz) virtual TClass* IsA() const Bool_t IsClosed() const Bool_t IsCurrentOverlapping() const Bool_t IsEntering() const Bool_t IsExiting() const virtual Bool_t IsFolder() const Bool_t IsNullStep() const Bool_t IsOnBoundary() const Bool_t IsOutside() const Bool_t IsStartSafe() const Bool_t IsStepEntering() const Bool_t IsStepExiting() const void LocalToMaster(Double_t* local, Double_t* master) const void LocalToMasterBomb(Double_t* local, Double_t* master) const void LocalToMasterVect(Double_t* local, Double_t* master) const TGeoVolume* MakeArb8(const char* name, const char* material, Double_t dz, Double_t* vertices = 0) TGeoVolume* MakeBox(const char* name, const char* material, Double_t dx, Double_t dy, Double_t dz) TGeoVolume* MakeCone(const char* name, const char* material, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2) TGeoVolume* MakeCons(const char* name, const char* material, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2) TGeoVolume* MakeCtub(const char* name, const char* material, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz) TGeoVolume* MakeEltu(const char* name, const char* material, Double_t a, Double_t b, Double_t dz) TGeoVolume* MakeGtra(const char* name, const char* material, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2) TGeoVolume* MakePara(const char* name, const char* material, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi) TGeoVolume* MakePcon(const char* name, const char* material, Double_t phi, Double_t dphi, Int_t nz) TGeoVolume* MakePgon(const char* name, const char* material, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz) TGeoVolume* MakeSphere(const char* name, const char* material, Double_t rmin, Double_t rmax, Double_t themin = 0, Double_t themax = 180, Double_t phimin = 0, Double_t phimax = 360) TGeoVolume* MakeTrap(const char* name, const char* material, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2) TGeoVolume* MakeTrd1(const char* name, const char* material, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz) TGeoVolume* MakeTrd2(const char* name, const char* material, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz) TGeoVolume* MakeTube(const char* name, const char* material, Double_t rmin, Double_t rmax, Double_t dz) TGeoVolume* MakeTubs(const char* name, const char* material, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2) TGeoVolumeMulti* MakeVolumeMulti(const char* name, const char* material) void MasterToLocal(Double_t* master, Double_t* local) const void MasterToLocalBomb(Double_t* master, Double_t* local) const void MasterToLocalVect(Double_t* master, Double_t* local) const void ModifiedPad() const void OptimizeVoxels(const char* filename = "tgeovox.C") static Int_t Parse(const char* expr, TString& expr1, TString& expr2, TString& expr3) void PopDummy(Int_t ipop = 9999) Bool_t PopPath() Bool_t PopPath(Int_t index) Bool_t PopPoint() Bool_t PopPoint(Int_t index) Int_t PushPath() Int_t PushPoint() void RandomPoints(TGeoVolume* vol, Int_t npoints = 10000, Option_t* option) void RandomRays(Int_t nrays = 1000, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0) void RemoveMaterial(Int_t index) void RestoreMasterVolume() TGeoNode* SamplePoints(Int_t npoints, Double_t& dist, Double_t epsil = 1E-5, const char* g3path) void SaveAttributes(const char* filename = "tgeoatt.C") TGeoNode* SearchNode(Bool_t downwards = kFALSE, TGeoNode* skipnode = 0) void SelectTrackingMedia() void SetBombFactors(Double_t bombx = 1.3, Double_t bomby = 1.3, Double_t bombz = 1.3, Double_t bombr = 1.3) void SetCache(TGeoNodeCache* cache) void SetCldirChecked(Double_t* dir) void SetCurrentDirection(Double_t* dir) void SetCurrentDirection(Double_t nx, Double_t ny, Double_t nz) void SetCurrentPoint(Double_t* point) void SetCurrentPoint(Double_t x, Double_t y, Double_t z) void SetExplodedView(UInt_t iopt = 0) void SetNormalChecked(Double_t* norm) void SetNsegments(Int_t nseg) void SetStartSafe(Bool_t flag = kTRUE) void SetStep(Double_t step) void SetTopVolume(TGeoVolume* vol) void SetVisLevel(Int_t level = 3) void SetVisOption(Int_t option = 0) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual ULong_t SizeOf(TGeoNode* node, Option_t* option) TGeoNode* Step(Bool_t is_geom = kTRUE, Bool_t cross = kTRUE) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void Test(Int_t npoints = 1000000, Option_t* option) void TestOverlaps(const char* path) void UnbombTranslation(const Double_t* tr, Double_t* bombtr) void UpdateCurrentPosition(Double_t* nextpoint)

Data Members

    private:
Double_t fStep ! step to be done from current point and direction Double_t fSafety ! safety radius from current point Int_t fLevel ! current geometry level; Int_t fNNodes total number of physical nodes TString fPath ! path to current node Double_t* fNormal ! normal to shape at current intersection point Double_t* fNormalChecked ! normal to current checked shape at intersection Double_t* fCldir ! unit vector to current closest shape Double_t* fCldirChecked ! unit vector to current checked shape Double_t* fPoint ![3] current point Double_t* fDirection ![3] current direction Bool_t fSearchOverlaps ! flag set when an overlapping cluster is searched Bool_t fCurrentOverlapping ! flags the type of the current node Bool_t fLoopVolumes ! flag volume lists loop Bool_t fStartSafe ! flag a safe start for point classification Bool_t fIsEntering ! flag if current step just got into a new node Bool_t fIsExiting ! flag that current track is about to leave current node Bool_t fIsStepEntering ! flag that next geometric step will enter new volume Bool_t fIsStepExiting ! flaag that next geometric step will exit current volume Bool_t fIsOutside ! flag that current point is outside geometry Bool_t fIsOnBoundary ! flag that current point is on some boundary Bool_t fIsNullStep ! flag that last geometric step was null TGeoNodeCache* fCache ! cache for physical nodes TVirtualGeoPainter* fPainter ! current painter TList* fMatrices -> list of local transformations TList* fShapes -> list of shapes TList* fVolumes -> list of volumes TList* fGShapes -> list of runtime shapes TList* fGVolumes -> list of runtime volumes TList* fMaterials -> list of materials TObjArray* fNodes -> current branch of nodes UChar_t* fBits ! bits used for voxelization TGeoVolume* fCurrentVolume current volume TGeoVolume* fTopVolume top level volume in geometry TGeoNode* fCurrentNode current node TGeoNode* fTopNode top physical node TGeoNode* fLastNode ! last searched node TGeoNode* fNextNode ! next node that will be crossed TGeoVolume* fMasterVolume master volume TGeoHMatrix* fCurrentMatrix ! current global matrix

Class Description

 General architecture
 --------------------

   The new ROOT geometry package is a tool designed for building, browsing,
 tracking and visualizing a detector geometry. The code is independent from
 other external MC for simulation, therefore it does not contain any
 constraints related to physics. However, the package defines a number of
 hooks for tracking, such as materials, magnetic field or track state flags,
 in order to allow interfacing to tracking MC's. The final goal is to be
 able to use the same geometry for several purposes, such as tracking,
 reconstruction or visualization, taking advantage of the ROOT features
 related to bookkeeping, I/O, histograming, browsing and GUI's.

   The geometrical modeler is the most important component of the package and
 it provides answers to the basic questions like "Where am I ?" or "How far
 from the next boundary ?", but also to more complex ones like "How far from
 the closest surface ?" or "Which is the next crossing along a helix ?".

   The architecture of the modeler is a combination between a GEANT-like
 containment scheme and a normal CSG binary tree at the level of shapes. An
 important common feature of all detector geometry descriptions is the
 mother-daughter concept. This is the most natural approach when tracking
 is concerned and imposes a set of constraints to the way geometry is defined.
 Constructive solid geometry composition is used only in order to create more
 complex shapes from an existing set of primitives through boolean operations.
 This feature is not implemented yet but in future full definition of boolean
 expressions will be supported.

   Practically every geometry defined in GEANT style can be mapped by the modeler.
 The basic components used for building the logical hierarchy of the geometry
 are called "volumes" and "nodes". Volumes (sometimes called "solids") are fully
 defined geometrical objects having a given shape and material and possibly
 containing a list of nodes. Nodes represent just positioned instances of volumes
 inside a container volume and they are not directly defined by user. They are
 automatically created as a result of adding one volume inside other or dividing
 a volume. The geometrical transformation hold by nodes is always defined with
 respect to their mother (relative positioning). Reflection matrices are allowed.
 All volumes have to be fully aware of their containees when the geometry is
 closed. They will build aditional structures (voxels) in order to fasten-up
 the search algorithms. Finally, nodes can be regarded as bidirectional links
 between containers and containees objects.

   The structure defined in this way is a graph structure since volumes are
 replicable (same volume can become daughter node of several other volumes),
 every volume becoming a branch in this graph. Any volume in the logical graph
 can become the actual top volume at run time (see TGeoManager::SetTopVolume()).
 All functionalities of the modeler will behave in this case as if only the
 corresponding branch starting from this volume is the registered geometry.


/*

*/


   A given volume can be positioned several times in the geometry. A volume
 can be divided according default or user-defined patterns, creating automatically
 the list of division nodes inside. The elementary volumes created during the
 dividing process follow the same scheme as usual volumes, therefore it is possible
 to position further geometrical structures inside or to divide them further more
 (see TGeoVolume::Divide()).

   The primitive shapes supported by the package are basically the GEANT3
 shapes (see class TGeoShape), arbitrary wedges with eight vertices on two parallel
 planes. All basic primitives inherits from class TGeoBBox since the bounding box
 of a solid is essential for the tracking algorithms. They also implement the
 virtual methods defined in the virtual class TGeoShape (point and segment
 classification). User-defined primitives can be direcly plugged into the modeler
 provided that they override these methods. Composite shapes will be soon supported
 by the modeler. In order to build a TGeoCompositeShape, one will have to define
 first the primitive components. The object that handle boolean
 operations among components is called TGeoBoolCombinator and it has to be
 constructed providing a string boolean expression between the components names.


 Example for building a simple geometry :
-----------------------------------------

______________________________________________________________________________
void rootgeom()
{
//--- Definition of a simple geometry
   gSystem->Load("libGeom");
   TGeoManager *geom = new TGeoManager("simple1", "Simple geometry");

   //--- define some materials
   TGeoMaterial *mat;
   mat = new TGeoMaterial("mat1", "Vacuum", 0,0,0);
   mat = new TGeoMaterial("mat2", "Al", 26.98,13,2.7);

   //--- define the transformations
   TGeoTranslation *tr1 = new TGeoTranslation(20., 0, 0.);
   TGeoTranslation *tr2 = new TGeoTranslation(10., 0., 0.);
   TGeoTranslation *tr3 = new TGeoTranslation(10., 20., 0.);
   TGeoTranslation *tr4 = new TGeoTranslation(5., 10., 0.);
   TGeoTranslation *tr5 = new TGeoTranslation(20., 0., 0.);
   TGeoTranslation *tr6 = new TGeoTranslation(-5., 0., 0.);
   TGeoTranslation *tr7 = new TGeoTranslation(7.5, 7.5, 0.);
   TGeoRotation   *rot1 = new TGeoRotation("rot1", 90., 0., 90., 270., 0., 0.);
   TGeoCombiTrans *combi1 = new TGeoCombiTrans(7.5, -7.5, 0., rot1);
   TGeoTranslation *tr8 = new TGeoTranslation(7.5, -5., 0.);
   TGeoTranslation *tr9 = new TGeoTranslation(7.5, 20., 0.);
   TGeoTranslation *tr10 = new TGeoTranslation(85., 0., 0.);
   TGeoTranslation *tr11 = new TGeoTranslation(35., 0., 0.);
   TGeoTranslation *tr12 = new TGeoTranslation(-15., 0., 0.);
   TGeoTranslation *tr13 = new TGeoTranslation(-65., 0., 0.);

   TGeoTranslation  *tr14 = new TGeoTranslation(0,0,-100);
   TGeoCombiTrans *combi2 = new TGeoCombiTrans(0,0,100,
                                   new TGeoRotation("rot2",90,180,90,90,180,0));
   TGeoCombiTrans *combi3 = new TGeoCombiTrans(100,0,0,
                                   new TGeoRotation("rot3",90,270,0,0,90,180));
   TGeoCombiTrans *combi4 = new TGeoCombiTrans(-100,0,0,
                                   new TGeoRotation("rot4",90,90,0,0,90,0));
   TGeoCombiTrans *combi5 = new TGeoCombiTrans(0,100,0,
                                   new TGeoRotation("rot5",0,0,90,180,90,270));
   TGeoCombiTrans *combi6 = new TGeoCombiTrans(0,-100,0,
                                   new TGeoRotation("rot6",180,0,90,180,90,90));

   //--- make the top container volume
   Double_t worldx = 110.;
   Double_t worldy = 50.;
   Double_t worldz = 5.;
   TGeoVolume *top = geom->MakeBox("TOP", "mat1", 270., 270., 120.);
   geom->SetTopVolume(top); // mandatory !
   //--- build other container volumes
   TGeoVolume *replica = geom->MakeBox("REPLICA", "mat1",120,120,120);
   replica->SetVisibility(kFALSE);
   TGeoVolume *rootbox = geom->MakeBox("ROOT", "mat1", 110., 50., 5.);
   rootbox->SetVisibility(kFALSE); // this will hold word 'ROOT'

   //--- make letter 'R'
   TGeoVolume *R = geom->MakeBox("R", "mat1", 25., 25., 5.);
   R->SetVisibility(kFALSE);
   TGeoVolume *bar1 = geom->MakeBox("bar1", "mat2", 5., 25, 5.);
   bar1->SetLineColor(kRed);
   R->AddNode(bar1, 1, tr1);
   TGeoVolume *bar2 = geom->MakeBox("bar2", "mat2", 5., 5., 5.);
   bar2->SetLineColor(kRed);
   R->AddNode(bar2, 1, tr2);
   R->AddNode(bar2, 2, tr3);
   TGeoVolume *tub1 = geom->MakeTubs("tub1", "mat2", 5., 15., 5., 90., 270.);
   tub1->SetLineColor(kRed);
   R->AddNode(tub1, 1, tr4);
   TGeoVolume *bar3 = geom->MakeArb8("bar3", "mat2", 5.);
   bar3->SetLineColor(kRed);
   TGeoArb8 *arb = (TGeoArb8*)bar3->GetShape();
   arb->SetVertex(0, 15., -5.);
   arb->SetVertex(1, 5., -5.);
   arb->SetVertex(2, -10., -25.);
   arb->SetVertex(3, 0., -25.);
   arb->SetVertex(4, 15., -5.);
   arb->SetVertex(5, 5., -5.);
   arb->SetVertex(6, -10., -25.);
   arb->SetVertex(7, 0., -25.);
   R->AddNode(bar3, 1, gGeoIdentity);

   //--- make letter 'O'
   TGeoVolume *O = geom->MakeBox("O", "mat1", 25., 25., 5.);
   O->SetVisibility(kFALSE);
   TGeoVolume *bar4 = geom->MakeBox("bar4", "mat2", 5., 7.5, 5.);
   bar4->SetLineColor(kYellow);
   O->AddNode(bar4, 1, tr5);
   O->AddNode(bar4, 2, tr6);
   TGeoVolume *tub2 = geom->MakeTubs("tub1", "mat2", 7.5, 17.5, 5., 0., 180.);
   tub2->SetLineColor(kYellow);
   O->AddNode(tub2, 1, tr7);
   O->AddNode(tub2, 2, combi1);

   //--- make letter 'T'
   TGeoVolume *T = geom->MakeBox("T", "mat1", 25., 25., 5.);
   T->SetVisibility(kFALSE);
   TGeoVolume *bar5 = geom->MakeBox("bar5", "mat2", 5., 20., 5.);
   bar5->SetLineColor(kBlue);
   T->AddNode(bar5, 1, tr8);
   TGeoVolume *bar6 = geom->MakeBox("bar6", "mat2", 17.5, 5., 5.);
   bar6->SetLineColor(kBlue);
   T->AddNode(bar6, 1, tr9);

   //--- add letters to 'ROOT' container
   rootbox->AddNode(R, 1, tr10);
   rootbox->AddNode(O, 1, tr11);
   rootbox->AddNode(O, 2, tr12);
   rootbox->AddNode(T, 1, tr13);

   //--- add word 'ROOT' on each face of a cube
   replica->AddNode(rootbox, 1, tr14);
   replica->AddNode(rootbox, 2, combi2);
   replica->AddNode(rootbox, 3, combi3);
   replica->AddNode(rootbox, 4, combi4);
   replica->AddNode(rootbox, 5, combi5);
   replica->AddNode(rootbox, 6, combi6);

   //--- add four replicas of this cube to top volume
   top->AddNode(replica, 1, new TGeoTranslation(-150, -150, 0));
   top->AddNode(replica, 2, new TGeoTranslation(150, -150, 0));
   top->AddNode(replica, 3, new TGeoTranslation(150, 150, 0));
   top->AddNode(replica, 4, new TGeoTranslation(-150, 150, 0));

   //--- close the geometry
   geom->CloseGeometry();

   //--- draw the ROOT box
   geom->SetVisLevel(4);
   top->Draw();
   if (gPad) gPad->x3d();
}
______________________________________________________________________________



/*

*/



 TGeoManager - the manager class for the geometry package.
 ---------------------------------------------------------

   TGeoManager class is embedding all the API needed for building and tracking
 a geometry. It defines a global pointer (gGeoManager) in order to be fully
 accessible from external code. The mechanism of handling multiple geometries
 at the same time will be soon implemented.

   TGeoManager is the owner of all geometry objects defined in a session,
 therefore users must not try to control their deletion. It contains lists of
 materials, transformations, shapes and volumes. Logical nodes (positioned
 volumes) are created and destroyed by the TGeoVolume class. Physical
 nodes and their global transformations are subjected to a caching mechanism
 due to the sometimes very large memory requirements of logical graph expansion.
 The caching mechanism is triggered by the total number of physical instances
 of volumes and the cache manager is a client of TGeoManager. The manager class
 also controls the painter client. This is linked with ROOT graphical libraries
 loaded on demand in order to control visualization actions.

 Rules for building a valid geometry
 -----------------------------------

   A given geometry can be built in various ways, but there are mandatory steps
 that have to be followed in order to be validated by the modeler. There are
 general rules : volumes needs materials and shapes in order to be created,
 both container an containee volumes must be created before linking them together,
 and the relative transformation matrix must be provided. All branches must
 have an upper link point otherwise they will not be considered as part of the
 geometry. Visibility or tracking properties of volumes can be provided both
 at build time or after geometry is closed, but global visualization settings
 (see TGeoPainter class) should not be provided at build time, otherwise the
 drawing package will be loaded. There is also a list of specific rules :
 positioned daughters should not extrude their mother or intersect with sisters
 unless this is specified (see TGeoVolume::AddNodeOverlap()), the top volume
 (containing all geometry tree) must be specified before closing the geometry
 and must not be positioned - it represents the global reference frame. After
 building the full geometry tree, the geometry must be closed
 (see TGeoManager::CloseGeometry()). Voxelization can be redone per volume after
 this process.


   Below is the general scheme of the manager class.


/*

*/


  An interactive session
 ------------------------

   Provided that a geometry was successfully built and closed (for instance the
 previous example $ROOTSYS/tutorials/rootgeom.C ), the manager class will register
 itself to ROOT and the logical/physical structures will become immediately browsable.
 The ROOT browser will display starting from the geometry folder : the list of
 transformations and materials, the top volume and the top logical node. These last
 two can be fully expanded, any intermediate volume/node in the browser being subject
 of direct access context menu operations (right mouse button click). All user
 utilities of classes TGeoManager, TGeoVolume and TGeoNode can be called via the
 context menu.


/*

*/


  --- Drawing the geometry

   Any logical volume can be drawn via TGeoVolume::Draw() member function.
 This can be direcly accessed from the context menu of the volume object
 directly from the browser.
   There are several drawing options that can be set with
 TGeoManager::SetVisOption(Int_t opt) method :
 opt=0 - only the content of the volume is drawn, N levels down (default N=3).
    This is the default behavior. The number of levels to be drawn can be changed
    via TGeoManager::SetVisLevel(Int_t level) method.


/*

*/


 opt=1 - the final leaves (e.g. daughters with no containment) of the branch
    starting from volume are drawn down to the current number of levels.
                                     WARNING : This mode is memory consuming
    depending of the size of geometry, so drawing from top level within this mode
    should be handled with care for expensive geometries. In future there will be
    a limitation on the maximum number of nodes to be visualized.


/*

*/


 opt=2 - only the clicked volume is visualized. This is automatically set by
    TGeoVolume::DrawOnly() method
 opt=3 - only a given path is visualized. This is automatically set by
    TGeoVolume::DrawPath(const char *path) method

    The current view can be exploded in cartesian, cylindrical or spherical
 coordinates :
   TGeoManager::SetExplodedView(Int_t opt). Options may be :
 - 0  - default (no bombing)
 - 1  - cartesian coordinates. The bomb factor on each axis can be set with
        TGeoManager::SetBombX(Double_t bomb) and corresponding Y and Z.
 - 2  - bomb in cylindrical coordinates. Only the bomb factors on Z and R
        are considered


/*

*/


 - 3  - bomb in radial spherical coordinate : TGeoManager::SetBombR()

 Volumes themselves support different visualization settings :
    - TGeoVolume::SetVisibility() : set volume visibility.
    - TGeoVolume::VisibleDaughters() : set daughters visibility.
 All these actions automatically updates the current view if any.

  --- Checking the geometry

  Several checking methods are accessible from the volume context menu. They
 generally apply only to the visible parts of the drawn geometry in order to
 ease geometry checking, and their implementation is in the TGeoChecker class
 from the painting package.

 1. Checking a given point.
   Can be called from TGeoManager::CheckPoint(Double_t x, Double_t y, Double_t z).
 This method is drawing the daughters of the volume containing the point one
 level down, printing the path to the deepest physical node holding this point.
 It also computes the closest distance to any boundary. The point will be drawn
 in red.


/*

*/


  2. Shooting random points.
   Can be called from TGeoVolume::RandomPoints() (context menu function) and
 it will draw this volume with current visualization settings. Random points
 are generated in the bounding box of the top drawn volume. The points are
 classified and drawn with the color of their deepest container. Only points
 in visible nodes will be drawn.


/*

*/



  3. Raytracing.
   Can be called from TGeoVolume::RandomRays() (context menu of volumes) and
 will shoot rays from a given point in the local reference frame with random
 directions. The intersections with displayed nodes will appear as segments
 having the color of the touched node. Drawn geometry will be then made invisible
 in order to enhance rays.


/*

*/


TGeoManager()
 Default constructor.

TGeoManager(const char *name, const char *title) :TNamed(name, title)
 Constructor.

void Init()
 Initialize manager class.

~TGeoManager()
 Destructor

Int_t AddMaterial(TGeoMaterial *material)
 Add a material to the list. Returns index of the material in list.

Int_t AddTransformation(TGeoMatrix *matrix)
 Add a matrix to the list. Returns index of the matrix in list.

Int_t AddShape(TGeoShape *shape)
 Add a shape to the list. Returns index of the shape in list.

Int_t AddVolume(TGeoVolume *volume)
 Add a volume to the list. Returns index of the volume in list.

void Browse(TBrowser *b)
 Describe how to browse this object.

void BombTranslation(const Double_t *tr, Double_t *bombtr)
 Get the new 'bombed' translation vector according current exploded view mode.

void UnbombTranslation(const Double_t *tr, Double_t *bombtr)
 Get the new 'unbombed' translation vector according current exploded view mode.

void BuildCache()
 Builds the cache for physical nodes and global matrices.

void ClearAttributes()
 Reset all attributes to default ones. Default attributes for visualization
 are those defined before closing the geometry.

void CloseGeometry()
 Closing geometry implies checking the geometry validity, fixing shapes
 with negative parameters (run-time shapes)building the cache manager,
 voxelizing all volumes, counting the total number of physical nodes and
 registring the manager class to the browser.

void ClearShape(TGeoShape *shape)
 Remove a shape from the list of shapes.

void CleanGarbage()
 Clean temporary volumes and shapes from garbage collection.

void CdTop()
 Make top level node the current node. Updates the cache accordingly.
 Determine the overlapping state of current node.

void CdUp()
 Go one level up in geometry. Updates cache accordingly.
 Determine the overlapping state of current node.

void CdDown(Int_t index)
 Make a daughter of current node current. Can be called only with a valid
 daughter index (no check). Updates cache accordingly.

Bool_t cd(const char *path)
 Browse the tree of nodes starting from fTopNode according to pathname.
 Changes the path accordingly.

Int_t CountNodes(TGeoVolume *vol, Int_t nlevels)
 Count the total number of nodes starting from a volume, nlevels down.

void DefaultAngles()
 Set default angles for a given view.

void DrawCurrentPoint(Int_t color)
 Draw current point in the same view.

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

void Test(Int_t npoints, Option_t *option)
 Check time of finding "Where am I" for n points.

void TestOverlaps(const char* path)
 Geometry overlap checker based on sampling.

void GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const
 Retreive cartesian and radial bomb factors.

TGeoHMatrix* GetHMatrix()

Int_t GetVisLevel() const
 Returns current depth to which geometry is drawn.

Int_t GetVisOption() const
 Returns current depth to which geometry is drawn.

Int_t GetVirtualLevel()
 Find level of virtuality of current overlapping node (number of levels
 up having the same tracking media.

Bool_t GotoSafeLevel()
 Go upwards the tree until a non-overlaping node

TGeoNode* FindInCluster(Int_t *cluster, Int_t nc)
 Find a node inside a cluster of overlapping nodes. Current node must
 be on top of all the nodes in cluster. Always nc>1.

Int_t GetTouchedCluster(Int_t start, Double_t *point, Int_t *check_list, Int_t ncheck, Int_t *result)
 Make the cluster of overlapping nodes in a voxel, containing point in reference
 of the mother. Returns number of nodes containing the point. Nodes should not be
 offsets.

void DefaultColors()
 Set default volume colors according to tracking media.

void SetBombFactors(Double_t bombx, Double_t bomby, Double_t bombz, Double_t bombr)
 Set factors that will "bomb" all translations in cartesian and cylindrical coordinates.

void SetVisOption(Int_t option)
 set drawing mode :
 option=0 (default) all nodes drawn down to vislevel
 option=1           leaves and nodes at vislevel drawn
 option=2           path is drawn

void SetVisLevel(Int_t level)
 set default level down to which visualization is performed

void OptimizeVoxels(const char *filename)
 Optimize voxelization type for all volumes. Save best choice in a macro.

Int_t Parse(const char *expr, TString &expr1, TString &expr2, TString &expr3)
 Parse a string boolean expression and do a syntax check. Find top
 level boolean operator and returns its type. Fill the two
 substrings to which this operator applies. The returned integer is :
 -1 : parse error
  0 : no boolean operator
  1 : union - represented as '+' in expression
  2 : difference (subtraction) - represented as '-' in expression
  3 : intersection - represented as '*' in expression.
 Paranthesys should be used to avoid ambiguites. For instance :
    A+B-C will be interpreted as (A+B)-C which is not the same as A+(B-C)
 eliminate not needed paranthesys

void SaveAttributes(const char *filename)
 Save current attributes in a macro

TGeoNode* SearchNode(Bool_t downwards, TGeoNode *skipnode)
 Returns the deepest node containing fPoint, which must be set a priori.

TGeoNode* FindNextBoundary(const char *path)
 Find distance to target node given by path boundary on current direction. If no target
 is specified, find distance to next boundary from current point to current direction
 and store this in fStep. Returns node having this boundary. Find also
 distance to closest boundary and store it in fSafety. Set flags
 fIsStepEntering/fIsStepExiting according to the fact that current ray will enter
 or exit next node.

void InitTrack(Double_t *point, Double_t *dir)
 Initialize current point and current direction vector (normalized)
 in MARS.

void InitTrack(Double_t x, Double_t y, Double_t z, Double_t nx, Double_t ny, Double_t nz)
 Initialize current point and current direction vector (normalized)
 in MARS.

const char* GetPath() const
 Get path to the current node in the form /node0/node1/...

Int_t GetByteCount(Option_t *option)
 Get total size of geometry in bytes.

TVirtualGeoPainter* GetGeomPainter()
 Make a default painter if none present. Returns pointer to it.

TGeoMaterial* GetMaterial(const char *matname) const
 Search for a named material.

TGeoMaterial* GetMaterial(Int_t id) const
 Return material at position id.

Int_t GetMaterialIndex(const char *matname) const
 Return index of named material.

void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz)
 Randomly shoot nrays and plot intersections with surfaces for current
 top node.

void RemoveMaterial(Int_t index)
 Remove material at given index.

void RestoreMasterVolume()
 Restore the master volume of the geometry.

TGeoVolume* GetVolume(const char *name) const
 Retrieves a named volume.

void Voxelize(Option_t *option)
 Voxelize all non-divided volumes.

void ModifiedPad() const
 Send "Modified" signal to painter.

TGeoVolume* MakeArb8(const char *name, const char *material, Double_t dz, Double_t *vertices)
 Make an TGeoArb8 volume.

TGeoVolume* MakeBox(const char *name, const char *material, Double_t dx, Double_t dy, Double_t dz)
 Make in one step a volume pointing to a box shape with given material.

TGeoVolume* MakePara(const char *name, const char *material, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
 Make in one step a volume pointing to a paralelipiped shape with given material.

TGeoVolume* MakeSphere(const char *name, const char *material, Double_t rmin, Double_t rmax, Double_t themin, Double_t themax, Double_t phimin, Double_t phimax)
 Make in one step a volume pointing to a sphere shape with given material

TGeoVolume* MakeTube(const char *name, const char *material, Double_t rmin, Double_t rmax, Double_t dz)
 Make in one step a volume pointing to a tube shape with given material.

TGeoVolume* MakeTubs(const char *name, const char *material, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
 Make in one step a volume pointing to a tube segment shape with given material.

TGeoVolume* MakeEltu(const char *name, const char *material, Double_t a, Double_t b, Double_t dz)
 Make in one step a volume pointing to a tube shape with given material

TGeoVolume* MakeCtub(const char *name, const char *material, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
 Make in one step a volume pointing to a tube segment shape with given material

TGeoVolume* MakeCone(const char *name, const char *material, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
 Make in one step a volume pointing to a cone shape with given material.

TGeoVolume* MakeCons(const char *name, const char *material, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
 Make in one step a volume pointing to a cone segment shape with given material

TGeoVolume* MakePcon(const char *name, const char *material, Double_t phi, Double_t dphi, Int_t nz)
 Make in one step a volume pointing to a polycone shape with given material.

TGeoVolume* MakePgon(const char *name, const char *material, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
 Make in one step a volume pointing to a polygone shape with given material.

TGeoVolume* MakeTrd1(const char *name, const char *material, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
 Make in one step a volume pointing to a TGeoTrd1 shape with given material.

TGeoVolume* MakeTrd2(const char *name, const char *material, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
 Make in one step a volume pointing to a TGeoTrd2 shape with given material.

TGeoVolume* MakeTrap(const char *name, const char *material, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
 Make in one step a volume pointing to a trapezoid shape with given material.

TGeoVolume* MakeGtra(const char *name, const char *material, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
 Make in one step a volume pointing to a twisted trapezoid shape with given material.

TGeoVolumeMulti* MakeVolumeMulti(const char *name, const char *material)
 Make a TGeoVolumeMulti handling a list of volumes.

void SetExplodedView(UInt_t ibomb)
 Set type of exploding view (see TGeoPainter::SetExplodedView())

void SetNsegments(Int_t nseg)
 Set number of segments for approximating circles in drawing.

Int_t GetNsegments() const
 Get number of segments approximating circles

void BuildDefaultMaterials()
 Build the default materials. A list of those can be found in ...

TGeoNode* Step(Bool_t is_geom, Bool_t cross)
 Make a rectiliniar step of length fStep from current point (fPoint) on current
 direction (fDirection). If the step is imposed by geometry, is_geom flag
 must be true (default). The cross flag specifies if the boundary should be
 crossed in case of a geometry step (default true). Returns new node after step.
 Set also on boundary condition.

TGeoNode* SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char* g3path)
 shoot npoints randomly in a box of 1E-5 arround current point.
 return minimum distance to points outside

void SetTopVolume(TGeoVolume *vol)
 Set the top volume and corresponding node as starting point of the geometry.

void SelectTrackingMedia()
 Define different tracking media.

void CheckPoint(Double_t x, Double_t y, Double_t z, Option_t *option)
 Classify a given point. See TGeoChecker::CheckPoint().

void CheckGeometry(Option_t *option)
 Instanciate a TGeoChecker object and investigates the geometry according to
 option. Not implemented yet.
 check shapes first

void UpdateCurrentPosition(Double_t *nextpoint)
 Computes and changes the current node according to the new position.
 Not implemented.

ULong_t SizeOf(TGeoNode *node, Option_t *option)
 computes the total size in bytes of the branch starting with node.
 The option can specify if all the branch has to be parsed or only the node

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



Inline Functions


                Bool_t IsLoopingVolumes() const
                  void SetLoopVolumes(Bool_t flag = kTRUE)
                Bool_t IsFolder() const
                 Int_t GetBombMode() const
                  void DrawPath(const char* path)
                Bool_t IsClosed() const
                  void AddCheckedNode(TGeoNode* node, Int_t level)
             TGeoNode* FindNode(Bool_t safe_start = kTRUE)
              Double_t GetSafeDistance() const
              Double_t GetStep() const
                Bool_t IsStartSafe() const
                  void SetStartSafe(Bool_t flag = kTRUE)
                  void SetStep(Double_t step)
                Bool_t IsCurrentOverlapping() const
                Bool_t IsEntering() const
                Bool_t IsExiting() const
                Bool_t IsStepEntering() const
                Bool_t IsStepExiting() const
                Bool_t IsOutside() const
                Bool_t IsOnBoundary() const
                Bool_t IsNullStep() const
              UChar_t* GetBits()
                TList* GetListOfMatrices() const
                TList* GetListOfMaterials() const
                TList* GetListOfVolumes() const
                TList* GetListOfGVolumes() const
                TList* GetListOfShapes() const
             TGeoNode* GetNode(Int_t level) const
             TGeoNode* GetNextNode() const
             TGeoNode* GetMother(Int_t up = 1) const
          TGeoHMatrix* GetCurrentMatrix() const
             TGeoNode* GetCurrentNode() const
             Double_t* GetCurrentPoint() const
           TGeoVolume* GetCurrentVolume() const
             Double_t* GetCldirChecked() const
             Double_t* GetCldir() const
             Double_t* GetNormalChecked() const
             Double_t* GetNormal() const
                 Int_t GetLevel() const
                 Int_t GetStackLevel() const
           TGeoVolume* GetMasterVolume() const
           TGeoVolume* GetTopVolume() const
             TGeoNode* GetTopNode() const
                  void SetCurrentPoint(Double_t* point)
                  void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
                  void SetCurrentDirection(Double_t* dir)
                  void SetCurrentDirection(Double_t nx, Double_t ny, Double_t nz)
                  void SetNormalChecked(Double_t* norm)
                  void SetCldirChecked(Double_t* dir)
                  void LocalToMaster(Double_t* local, Double_t* master) const
                  void LocalToMasterVect(Double_t* local, Double_t* master) const
                  void LocalToMasterBomb(Double_t* local, Double_t* master) const
                  void MasterToLocal(Double_t* master, Double_t* local) const
                  void MasterToLocalVect(Double_t* master, Double_t* local) const
                  void MasterToLocalBomb(Double_t* master, Double_t* local) const
                 Int_t GetNNodes()
        TGeoNodeCache* GetCache() const
                  void SetCache(TGeoNodeCache* cache)
                 Int_t PushPath()
                Bool_t PopPath()
                Bool_t PopPath(Int_t index)
                 Int_t PushPoint()
                Bool_t PopPoint()
                Bool_t PopPoint(Int_t index)
                  void PopDummy(Int_t ipop = 9999)
               TClass* Class()
               TClass* IsA() const
                  void ShowMembers(TMemberInspector& insp, char* parent)
                  void StreamerNVirtual(TBuffer& b)
           TGeoManager TGeoManager(const TGeoManager&)


Author: Andrei Gheata 25/10/01
Last update: root/geom:$Name: $:$Id: TGeoManager.cxx,v 1.13 2002/09/28 07: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.