TGeoChecker.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoChecker.h 34887 2010-08-20 14:32:38Z agheata $
00002 // Author: Andrei Gheata   01/11/01
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGeoChecker
00013 #define ROOT_TGeoChecker
00014 
00015 #ifndef ROOT_TObject
00016 #include "TObject.h"
00017 #endif
00018 
00019 // forward declarations
00020 class TTree;
00021 class TGeoVolume;
00022 class TGeoVoxelFinder;
00023 class TGeoNode;
00024 class TGeoManager;
00025 class TGeoMatrix;
00026 class TGeoOverlap;
00027 class TBuffer3D;
00028 class TH2F;
00029 class TStopwatch;
00030 
00031 ///////////////////////////////////////////////////////////////////////////
00032 // TGeoChecker - A simple checker generating random points inside a      //
00033 //   geometry. Generates a tree of points on the surfaces coresponding   //
00034 //   to the safety of each generated point                               //
00035 //                                                                       //
00036 ///////////////////////////////////////////////////////////////////////////
00037 
00038 class TGeoChecker : public TObject
00039 {
00040 private :
00041 // data members
00042    TGeoManager     *fGeoManager;      // pointer to geometry manager
00043    TGeoVolume      *fVsafe;           // volume to which a safety sphere node was added
00044    TBuffer3D       *fBuff1;           // Buffer containing mesh vertices for first volume
00045    TBuffer3D       *fBuff2;           // Buffer containing mesh vertices for second volume
00046    Bool_t           fFullCheck;       // Full overlap checking
00047    Double_t        *fVal1;            //! Array of number of crossings per volume.
00048    Double_t        *fVal2;            //! Array of timing per volume.
00049    Bool_t          *fFlags;           //! Array of flags per volume.
00050    TStopwatch      *fTimer;           //! Timer
00051    TGeoNode        *fSelectedNode;    //! Selected node for overlap checking
00052    Int_t            fNchecks;         //! Number of checks for current volume
00053    Int_t            fNmeshPoints;     //! Number of points on mesh to be checked
00054 // methods
00055    void             CleanPoints(Double_t *points, Int_t &numPoints) const;
00056    Int_t            NChecksPerVolume(TGeoVolume *vol);
00057    Int_t            PropagateInGeom(Double_t *, Double_t *);
00058    void             Score(TGeoVolume *, Int_t, Double_t);
00059    Double_t         TimingPerVolume(TGeoVolume *);
00060 public:
00061    // constructors
00062    TGeoChecker();
00063    TGeoChecker(TGeoManager *geom);
00064    // destructor
00065    virtual ~TGeoChecker();
00066    // methods
00067    virtual void     CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.); 
00068    virtual void     CheckBoundaryReference(Int_t icheck=-1);
00069    void             CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=NULL);
00070    void             CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const;
00071    void             CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="");
00072    void             CheckOverlapsBySampling(TGeoVolume *vol, Double_t ovlp=0.1, Int_t npoints=1000000) const;
00073    void             CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="");
00074    Double_t         CheckVoxels(TGeoVolume *vol, TGeoVoxelFinder *voxels, Double_t *xyz, Int_t npoints);
00075    TH2F            *LegoPlot(Int_t ntheta=60, Double_t themin=0., Double_t themax=180.,
00076                             Int_t nphi=90, Double_t phimin=0., Double_t phimax=360.,
00077                             Double_t rmin=0., Double_t rmax=9999999, Option_t *option="");
00078    void             PrintOverlaps() const;
00079    void             RandomPoints(TGeoVolume *vol, Int_t npoints, Option_t *option);
00080    void             RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz);
00081    TGeoOverlap     *MakeCheckOverlap(const char *name, TGeoVolume *vol1, TGeoVolume *vol2, TGeoMatrix *mat1, TGeoMatrix *mat2, Bool_t isovlp, Double_t ovlp);
00082    void             OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=0, Bool_t last=kFALSE, Bool_t refresh=kFALSE);
00083    TGeoNode        *SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char* g3path);
00084    Double_t        *ShootRay(Double_t *start, Double_t dirx, Double_t diry, Double_t dirz, Double_t *array, Int_t &nelem, Int_t &dim, Double_t *enpoint=0) const;
00085    void             SetSelectedNode(TGeoNode *node) {fSelectedNode=node;}
00086    void             SetNmeshPoints(Int_t npoints=1000);
00087    void             Test(Int_t npoints, Option_t *option);
00088    void             TestOverlaps(const char *path);
00089    Bool_t           TestVoxels(TGeoVolume *vol, Int_t npoints=1000000);
00090    Double_t         Weight(Double_t precision=0.01, Option_t *option="v");
00091    
00092    ClassDef(TGeoChecker, 2)               // a simple geometry checker
00093 };
00094 
00095 #endif
00096 

Generated on Tue Jul 5 14:13:19 2011 for ROOT_528-00b_version by  doxygen 1.5.1