#ifndef ROOT_TGeoNavigator
#define ROOT_TGeoNavigator
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TGeoNodeCache
#include "TGeoCache.h"
#endif
class TGeoManager;
class TGeoNode;
class TGeoVolume;
class TGeoMatrix;
class TGeoHMatrix;
class TGeoNavigator : public TObject
{
protected:
   TGeoNavigator(const TGeoNavigator&); 
   TGeoNavigator& operator=(const TGeoNavigator&); 
   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                  SafetyOverlaps();
private :
   Double_t              fStep;             
   Double_t              fSafety;           
   Double_t              fLastSafety;       
   Double_t              fNormal[3];        
   Double_t              fCldir[3];         
   Double_t              fCldirChecked[3];  
   Double_t              fPoint[3];         
   Double_t              fDirection[3];     
   Double_t              fLastPoint[3];     
   Int_t                 fLevel;            
   Int_t                 fNmany;            
   Int_t                 fNextDaughterIndex; 
   Int_t                 fOverlapSize;      
   Int_t                 fOverlapMark;      
   Int_t                *fOverlapClusters;  
   Bool_t                fSearchOverlaps;   
   Bool_t                fCurrentOverlapping; 
   Bool_t                fStartSafe;        
   Bool_t                fIsEntering;       
   Bool_t                fIsExiting;        
   Bool_t                fIsStepEntering;   
   Bool_t                fIsStepExiting;    
   Bool_t                fIsOutside;        
   Bool_t                fIsOnBoundary;     
   Bool_t                fIsSameLocation;   
   Bool_t                fIsNullStep;       
   TGeoManager          *fGeometry;         
   TGeoNodeCache        *fCache;            
   TGeoVolume           *fCurrentVolume;    
   TGeoNode             *fCurrentNode;      
   TGeoNode             *fTopNode;          
   TGeoNode             *fLastNode;         
   TGeoNode             *fNextNode;         
   TGeoCacheState       *fBackupState;      
   TGeoHMatrix          *fCurrentMatrix;    
   TGeoHMatrix          *fGlobalMatrix;     
   TString               fPath;             
    
public :
   TGeoNavigator();
   TGeoNavigator(TGeoManager* geom);
   virtual ~TGeoNavigator();
   void                   BuildCache(Bool_t dummy=kFALSE, Bool_t nodeid=kFALSE);
   Bool_t                 cd(const char *path="");
   Bool_t                 CheckPath(const char *path) const;
   void                   CdNode(Int_t nodeid);
   void                   CdDown(Int_t index);
   void                   CdUp();
   void                   CdTop();
   void                   CdNext();
   void                   GetBranchNames(Int_t *names) const;
   void                   GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const;
   void                   GetBranchOnlys(Int_t *isonly) const;
   Int_t                  GetNmany() const {return fNmany;}
   
   TGeoNode              *CrossBoundaryAndLocate(Bool_t downwards, TGeoNode *skipnode);
   TGeoNode              *FindNextBoundary(Double_t stepmax=TGeoShape::Big(),const char *path="", Bool_t frombdr=kFALSE);
   TGeoNode              *FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE);
   TGeoNode              *FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE);
   TGeoNode              *FindNode(Bool_t safe_start=kTRUE);
   TGeoNode              *FindNode(Double_t x, Double_t y, Double_t z);
   Double_t              *FindNormal(Bool_t forward=kTRUE);
   Double_t              *FindNormalFast();
   TGeoNode              *InitTrack(Double_t *point, Double_t *dir);
   TGeoNode              *InitTrack(Double_t x, Double_t y, Double_t z, Double_t nx, Double_t ny, Double_t nz);
   void                   ResetState();
   void                   ResetAll();
   Double_t               Safety(Bool_t inside=kFALSE);
   TGeoNode              *SearchNode(Bool_t downwards=kFALSE, const TGeoNode *skipnode=0);
   TGeoNode              *Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE);
   const Double_t        *GetLastPoint() const {return fLastPoint;}
   Int_t                  GetVirtualLevel();
   Bool_t                 GotoSafeLevel();
   Int_t                  GetSafeLevel() const;
   Double_t               GetSafeDistance() const      {return fSafety;}
   Double_t               GetLastSafety() const        {return fLastSafety;}
   Double_t               GetStep() const              {return fStep;}
   void                   InspectState() const;
   Bool_t                 IsSameLocation(Double_t x, Double_t y, Double_t z, Bool_t change=kFALSE);
   Bool_t                 IsSameLocation() const {return fIsSameLocation;}
   Bool_t                 IsSamePoint(Double_t x, Double_t y, Double_t z) const;
   Bool_t                 IsStartSafe() const {return fStartSafe;}
   void                   SetStartSafe(Bool_t flag=kTRUE)   {fStartSafe=flag;}
   void                   SetStep(Double_t step) {fStep=step;}
   Bool_t                 IsCheckingOverlaps() const   {return fSearchOverlaps;}
   Bool_t                 IsCurrentOverlapping() const {return fCurrentOverlapping;}
   Bool_t                 IsEntering() const           {return fIsEntering;}
   Bool_t                 IsExiting() const            {return fIsExiting;}
   Bool_t                 IsStepEntering() const       {return fIsStepEntering;}
   Bool_t                 IsStepExiting() const        {return fIsStepExiting;}
   Bool_t                 IsOutside() const            {return fIsOutside;}
   Bool_t                 IsOnBoundary() const         {return fIsOnBoundary;}
   Bool_t                 IsNullStep() const           {return fIsNullStep;}
   void                   SetCheckingOverlaps(Bool_t flag=kTRUE) {fSearchOverlaps = flag;}
   void                   SetOutside(Bool_t flag=kTRUE) {fIsOutside = flag;}
   
   void                   DoBackupState();
   void                   DoRestoreState();
   Int_t                  GetNodeId() const           {return fCache->GetNodeId();}
   TGeoNode              *GetNextNode() const         {return fNextNode;}
   TGeoNode              *GetMother(Int_t up=1) const {return fCache->GetMother(up);}
   TGeoHMatrix           *GetMotherMatrix(Int_t up=1) const {return fCache->GetMotherMatrix(up);}
   TGeoHMatrix           *GetHMatrix();
   TGeoHMatrix           *GetCurrentMatrix() const    {return fCache->GetCurrentMatrix();}
   TGeoNode              *GetCurrentNode() const      {return fCurrentNode;}
   Int_t                  GetCurrentNodeId() const    {return fCache->GetCurrentNodeId();}
   const Double_t        *GetCurrentPoint() const     {return fPoint;}
   const Double_t        *GetCurrentDirection() const {return fDirection;}
   TGeoVolume            *GetCurrentVolume() const {return fCurrentNode->GetVolume();}
   const Double_t        *GetCldirChecked() const  {return fCldirChecked;}
   const Double_t        *GetCldir() const         {return fCldir;}
   const Double_t        *GetNormal() const        {return fNormal;}
   Int_t                  GetLevel() const         {return fLevel;}
   const char            *GetPath() const;
   Int_t                  GetStackLevel() const    {return fCache->GetStackLevel();}
   void                   SetCurrentPoint(Double_t *point) {memcpy(fPoint,point,3*sizeof(Double_t));}
   void                   SetCurrentPoint(Double_t x, Double_t y, Double_t z) {
                                    fPoint[0]=x; fPoint[1]=y; fPoint[2]=z;}
   void                   SetLastPoint(Double_t x, Double_t y, Double_t z) {
                                    fLastPoint[0]=x; fLastPoint[1]=y; fLastPoint[2]=z;}
   void                   SetCurrentDirection(Double_t *dir) {memcpy(fDirection,dir,3*sizeof(Double_t));}
   void                   SetCurrentDirection(Double_t nx, Double_t ny, Double_t nz) {
                                    fDirection[0]=nx; fDirection[1]=ny; fDirection[2]=nz;}
   void                   SetCldirChecked(Double_t *dir) {memcpy(fCldirChecked, dir, 3*sizeof(Double_t));}
   
   void                   LocalToMaster(const Double_t *local, Double_t *master) const {fCache->LocalToMaster(local, master);}
   void                   LocalToMasterVect(const Double_t *local, Double_t *master) const {fCache->LocalToMasterVect(local, master);}
   void                   LocalToMasterBomb(const Double_t *local, Double_t *master) const {fCache->LocalToMasterBomb(local, master);}
   void                   MasterToLocal(const Double_t *master, Double_t *local) const {fCache->MasterToLocal(master, local);}
   void                   MasterToLocalVect(const Double_t *master, Double_t *local) const {fCache->MasterToLocalVect(master, local);}
   void                   MasterToLocalBomb(const Double_t *master, Double_t *local) const {fCache->MasterToLocalBomb(master, local);}
   void                   MasterToTop(const Double_t *master, Double_t *top) const;
   void                   TopToMaster(const Double_t *top, Double_t *master) const;
   TGeoNodeCache         *GetCache() const         {return fCache;}
   
   Int_t                  PushPath(Int_t startlevel=0) {return fCache->PushState(fCurrentOverlapping, startlevel, fNmany);}
   Bool_t                 PopPath() {fCurrentOverlapping=fCache->PopState(fNmany); fCurrentNode=fCache->GetNode(); fLevel=fCache->GetLevel();fGlobalMatrix=fCache->GetCurrentMatrix();return fCurrentOverlapping;}
   Bool_t                 PopPath(Int_t index) {fCurrentOverlapping=fCache->PopState(fNmany,index); fCurrentNode=fCache->GetNode(); fLevel=fCache->GetLevel();fGlobalMatrix=fCache->GetCurrentMatrix();return fCurrentOverlapping;}
   Int_t                  PushPoint(Int_t startlevel=0) {return fCache->PushState(fCurrentOverlapping, startlevel,fNmany,fPoint);}
   Bool_t                 PopPoint() {fCurrentOverlapping=fCache->PopState(fNmany,fPoint); fCurrentNode=fCache->GetNode(); fLevel=fCache->GetLevel(); fGlobalMatrix=fCache->GetCurrentMatrix();return fCurrentOverlapping;}
   Bool_t                 PopPoint(Int_t index) {fCurrentOverlapping=fCache->PopState(fNmany,index, fPoint); fCurrentNode=fCache->GetNode(); fLevel=fCache->GetLevel(); fGlobalMatrix=fCache->GetCurrentMatrix();return fCurrentOverlapping;}
   void                   PopDummy(Int_t ipop=9999) {fCache->PopDummy(ipop);}
   
   ClassDef(TGeoNavigator, 0)          
};
#endif
   
Last change: Tue May 13 17:16:48 2008
Last generated: 2008-05-13 17:16
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.