Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoVoxelFinder.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 04/02/02
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGeoVoxelFinder
13#define ROOT_TGeoVoxelFinder
14
15#include "TObject.h"
16
17class TGeoVolume;
18struct TGeoStateInfo;
19
20class TGeoVoxelFinder : public TObject {
21public:
23
24private:
27
28protected:
29 TGeoVolume *fVolume; // volume to which applies
30
31 Int_t fIbx; // number of different boundaries on X axis
32 Int_t fIby; // number of different boundaries on Y axis
33 Int_t fIbz; // number of different boundaries on Z axis
34 Int_t fNboxes; // length of boxes array
35 Int_t fNox; // length of array of X offsets
36 Int_t fNoy; // length of array of Y offsets
37 Int_t fNoz; // length of array of Z offsets
38 Int_t fNex; // length of array of X extra offsets
39 Int_t fNey; // length of array of Y extra offsets
40 Int_t fNez; // length of array of Z extra offsets
41 Int_t fNx; // length of array of X voxels
42 Int_t fNy; // length of array of Y voxels
43 Int_t fNz; // length of array of Z voxels
44 Int_t fPriority[3]; // priority for each axis
45 Double_t *fBoxes; //[fNboxes] list of bounding boxes
46 Double_t *fXb; //[fIbx] ordered array of X box boundaries
47 Double_t *fYb; //[fIby] ordered array of Y box boundaries
48 Double_t *fZb; //[fIbz] ordered array of Z box boundaries
49 Int_t *fOBx; //[fNox] offsets of daughter indices for slices X
50 Int_t *fOBy; //[fNoy] offsets of daughter indices for slices Y
51 Int_t *fOBz; //[fNoz] offsets of daughter indices for slices Z
52 Int_t *fOEx; //[fNox] offsets of extra indices for slices X
53 Int_t *fOEy; //[fNoy] offsets of extra indices for slices Y
54 Int_t *fOEz; //[fNoz] offsets of extra indices for slices Z
55 Int_t *fExtraX; //[fNex] indices of extra daughters in X slices
56 Int_t *fExtraY; //[fNey] indices of extra daughters in Y slices
57 Int_t *fExtraZ; //[fNez] indices of extra daughters in Z slices
58 Int_t *fNsliceX; //[fNox] number of candidates in X slice
59 Int_t *fNsliceY; //[fNoy] number of candidates in Y slice
60 Int_t *fNsliceZ; //[fNoz] number of candidates in Z slice
61 UChar_t *fIndcX; //[fNx] array of slices bits on X
62 UChar_t *fIndcY; //[fNy] array of slices bits on Y
63 UChar_t *fIndcZ; //[fNz] array of slices bits on Z
64
65 void BuildVoxelLimits();
66 Int_t *GetExtraX(Int_t islice, Bool_t left, Int_t &nextra) const;
67 Int_t *GetExtraY(Int_t islice, Bool_t left, Int_t &nextra) const;
68 Int_t *GetExtraZ(Int_t islice, Bool_t left, Int_t &nextra) const;
69 Bool_t GetIndices(const Double_t *point, TGeoStateInfo &td);
70 Int_t GetPriority(Int_t iaxis) const { return fPriority[iaxis]; }
72 Int_t *GetValidExtra(Int_t *list, Int_t &ncheck, TGeoStateInfo &td);
73 Int_t *GetValidExtra(Int_t n1, UChar_t *array1, Int_t *list, Int_t &ncheck, TGeoStateInfo &td);
74 Int_t *
75 GetValidExtra(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, Int_t *list, Int_t &ncheck, TGeoStateInfo &td);
77 Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t &nf, Int_t *result);
78 Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, Int_t &nf, Int_t *result);
79 Bool_t
80 Intersect(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, Int_t n3, UChar_t *array3, Int_t &nf, Int_t *result);
82 Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, TGeoStateInfo &td);
83 Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, Int_t n3, UChar_t *array3,
84 TGeoStateInfo &td);
85 void SortAll(Option_t *option = "");
86 Bool_t Union(Int_t n1, UChar_t *array1, TGeoStateInfo &td);
87 Bool_t Union(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, TGeoStateInfo &td);
88 Bool_t Union(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, Int_t n3, UChar_t *array3, TGeoStateInfo &td);
89
90public:
93 ~TGeoVoxelFinder() override;
94 void DaughterToMother(Int_t id, const Double_t *local, Double_t *master) const;
95 virtual Double_t Efficiency();
96 virtual Int_t *GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td);
97 Int_t *GetCheckList(Int_t &nelem, TGeoStateInfo &td) const;
98 virtual Int_t *GetNextCandidates(const Double_t *point, Int_t &ncheck, TGeoStateInfo &td);
99 virtual void FindOverlaps(Int_t inode) const;
102 Double_t *GetBoxes() const { return fBoxes; }
103 Bool_t IsSafeVoxel(const Double_t *point, Int_t inode, Double_t minsafe) const;
104 void Print(Option_t *option = "") const override;
105 void PrintVoxelLimits(const Double_t *point) const;
108 virtual Int_t *GetNextVoxel(const Double_t *point, const Double_t *dir, Int_t &ncheck, TGeoStateInfo &td);
109 virtual void SortCrossedVoxels(const Double_t *point, const Double_t *dir, TGeoStateInfo &td);
110 virtual void Voxelize(Option_t *option = "");
111
112 ClassDefOverride(TGeoVoxelFinder, 4) // voxel finder class
113};
114
115#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
unsigned char UChar_t
Definition RtypesCore.h:38
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
Finder class handling voxels.
Bool_t IsInvalid() const
void Print(Option_t *option="") const override
Print the voxels.
TGeoVoxelFinder(const TGeoVoxelFinder &)=delete
Bool_t Union(Int_t n1, UChar_t *array1, TGeoStateInfo &td)
make union of older bits with new array printf("Union - one slice\n");
Int_t GetPriority(Int_t iaxis) const
void SetNeedRebuild(Bool_t flag=kTRUE)
Double_t * GetBoxes() const
virtual Int_t * GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td)
get the list of daughter indices for which point is inside their bbox
virtual Int_t * GetNextVoxel(const Double_t *point, const Double_t *dir, Int_t &ncheck, TGeoStateInfo &td)
get the list of new candidates for the next voxel crossed by current ray printf("### GetNextVoxel\n")...
~TGeoVoxelFinder() override
Destructor.
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
void DaughterToMother(Int_t id, const Double_t *local, Double_t *master) const
convert a point from the local reference system of node id to reference system of mother volume
Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t &nf, Int_t *result)
return the list of nodes corresponding to one array of bits
virtual Int_t * GetNextCandidates(const Double_t *point, Int_t &ncheck, TGeoStateInfo &td)
Returns list of new candidates in next voxel.
Bool_t GetIndices(const Double_t *point, TGeoStateInfo &td)
Get indices for current slices on x, y, z.
void SortAll(Option_t *option="")
order bounding boxes along x, y, z
Bool_t IsSafeVoxel(const Double_t *point, Int_t inode, Double_t minsafe) const
Computes squared distance from POINT to the voxel(s) containing node INODE.
TGeoVoxelFinder & operator=(const TGeoVoxelFinder &)=delete
Int_t * GetExtraY(Int_t islice, Bool_t left, Int_t &nextra) const
Return the list of extra candidates in a given Y slice compared to another (left or right)
void BuildVoxelLimits()
build the array of bounding boxes of the nodes inside
Int_t * GetVoxelCandidates(Int_t i, Int_t j, Int_t k, Int_t &ncheck, TGeoStateInfo &td)
get the list of candidates in voxel (i,j,k) - no check
void SetInvalid(Bool_t flag=kTRUE)
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
void PrintVoxelLimits(const Double_t *point) const
print the voxel containing point
Bool_t NeedRebuild() const
Int_t GetNcandidates(TGeoStateInfo &td) const
virtual Double_t Efficiency()
Compute voxelization efficiency.
virtual void SortCrossedVoxels(const Double_t *point, const Double_t *dir, TGeoStateInfo &td)
get the list in the next voxel crossed by a ray
TGeoVolume * fVolume
Int_t * GetExtraZ(Int_t islice, Bool_t left, Int_t &nextra) const
Return the list of extra candidates in a given Z slice compared to another (left or right)
Int_t * GetExtraX(Int_t islice, Bool_t left, Int_t &nextra) const
Return the list of extra candidates in a given X slice compared to another (left or right)
Int_t * GetValidExtra(Int_t *list, Int_t &ncheck, TGeoStateInfo &td)
Get extra candidates that are not contained in current check list.
Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, TGeoStateInfo &td)
return the list of nodes corresponding to one array of bits
TGeoVoxelFinder()
Default constructor.
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:780
Statefull info for the current geometry level.