00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGeoChecker
00013 #define ROOT_TGeoChecker
00014
00015 #ifndef ROOT_TObject
00016 #include "TObject.h"
00017 #endif
00018
00019
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
00033
00034
00035
00036
00037
00038 class TGeoChecker : public TObject
00039 {
00040 private :
00041
00042 TGeoManager *fGeoManager;
00043 TGeoVolume *fVsafe;
00044 TBuffer3D *fBuff1;
00045 TBuffer3D *fBuff2;
00046 Bool_t fFullCheck;
00047 Double_t *fVal1;
00048 Double_t *fVal2;
00049 Bool_t *fFlags;
00050 TStopwatch *fTimer;
00051 TGeoNode *fSelectedNode;
00052 Int_t fNchecks;
00053 Int_t fNmeshPoints;
00054
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
00062 TGeoChecker();
00063 TGeoChecker(TGeoManager *geom);
00064
00065 virtual ~TGeoChecker();
00066
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)
00093 };
00094
00095 #endif
00096