Logo ROOT  
Reference Guide
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 
17 class TGeoVolume;
18 struct TGeoStateInfo;
19 
20 class TGeoVoxelFinder : public TObject
21 {
22 public:
26 };
27 
28 private:
29  TGeoVoxelFinder(const TGeoVoxelFinder&) = delete;
31 
32 protected:
33  TGeoVolume *fVolume; // volume to which applies
34 
35  Int_t fIbx; // number of different boundaries on X axis
36  Int_t fIby; // number of different boundaries on Y axis
37  Int_t fIbz; // number of different boundaries on Z axis
38  Int_t fNboxes; // length of boxes array
39  Int_t fNox; // length of array of X offsets
40  Int_t fNoy; // length of array of Y offsets
41  Int_t fNoz; // length of array of Z offsets
42  Int_t fNex; // length of array of X extra offsets
43  Int_t fNey; // length of array of Y extra offsets
44  Int_t fNez; // length of array of Z extra offsets
45  Int_t fNx; // length of array of X voxels
46  Int_t fNy; // length of array of Y voxels
47  Int_t fNz; // length of array of Z voxels
48  Int_t fPriority[3]; // priority for each axis
49  Double_t *fBoxes; //[fNboxes] list of bounding boxes
50  Double_t *fXb; //[fIbx] ordered array of X box boundaries
51  Double_t *fYb; //[fIby] ordered array of Y box boundaries
52  Double_t *fZb; //[fIbz] ordered array of Z box boundaries
53  Int_t *fOBx; //[fNox] offsets of daughter indices for slices X
54  Int_t *fOBy; //[fNoy] offsets of daughter indices for slices Y
55  Int_t *fOBz; //[fNoz] offsets of daughter indices for slices Z
56  Int_t *fOEx; //[fNox] offsets of extra indices for slices X
57  Int_t *fOEy; //[fNoy] offsets of extra indices for slices Y
58  Int_t *fOEz; //[fNoz] offsets of extra indices for slices Z
59  Int_t *fExtraX; //[fNex] indices of extra daughters in X slices
60  Int_t *fExtraY; //[fNey] indices of extra daughters in Y slices
61  Int_t *fExtraZ; //[fNez] indices of extra daughters in Z slices
62  Int_t *fNsliceX; //[fNox] number of candidates in X slice
63  Int_t *fNsliceY; //[fNoy] number of candidates in Y slice
64  Int_t *fNsliceZ; //[fNoz] number of candidates in Z slice
65  UChar_t *fIndcX; //[fNx] array of slices bits on X
66  UChar_t *fIndcY; //[fNy] array of slices bits on Y
67  UChar_t *fIndcZ; //[fNz] array of slices bits on Z
68 
69  void BuildVoxelLimits();
70  Int_t *GetExtraX(Int_t islice, Bool_t left, Int_t &nextra) const;
71  Int_t *GetExtraY(Int_t islice, Bool_t left, Int_t &nextra) const;
72  Int_t *GetExtraZ(Int_t islice, Bool_t left, Int_t &nextra) const;
73  Bool_t GetIndices(const Double_t *point, TGeoStateInfo &td);
74  Int_t GetPriority(Int_t iaxis) const {return fPriority[iaxis];}
76  Int_t *GetValidExtra(Int_t *list, Int_t &ncheck, TGeoStateInfo &td);
77  Int_t *GetValidExtra(Int_t n1, UChar_t *array1, Int_t *list, Int_t &ncheck, TGeoStateInfo &td);
78  Int_t *GetValidExtra(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, Int_t *list, Int_t &ncheck, TGeoStateInfo &td);
80  Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t &nf, Int_t *result);
81  Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2,
82  Int_t &nf, Int_t *result);
83  Bool_t Intersect(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2,
84  Int_t n3, UChar_t *array3, Int_t &nf, Int_t *result);
86  Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, TGeoStateInfo &td);
87  Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2,
88  Int_t n3, UChar_t *array3, TGeoStateInfo &td);
89  void SortAll(Option_t *option="");
90  Bool_t Union(Int_t n1, UChar_t *array1, TGeoStateInfo &td);
91  Bool_t Union(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2, TGeoStateInfo &td);
92  Bool_t Union(Int_t n1, UChar_t *array1, Int_t n2, UChar_t *array2,
93  Int_t n3, UChar_t *array3, TGeoStateInfo &td);
94 public :
97  virtual ~TGeoVoxelFinder();
98  void DaughterToMother(Int_t id, const Double_t *local, Double_t *master) const;
99  virtual Double_t Efficiency();
100  virtual Int_t *GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td);
101  Int_t *GetCheckList(Int_t &nelem, TGeoStateInfo &td) const;
102  virtual Int_t *GetNextCandidates(const Double_t *point, Int_t &ncheck, TGeoStateInfo &td);
103  virtual void FindOverlaps(Int_t inode) const;
106  Double_t *GetBoxes() const {return fBoxes;}
107  Bool_t IsSafeVoxel(const Double_t *point, Int_t inode, Double_t minsafe) const;
108  virtual void Print(Option_t *option="") const;
109  void PrintVoxelLimits(const Double_t *point) const;
112  virtual Int_t *GetNextVoxel(const Double_t *point, const Double_t *dir, Int_t &ncheck, TGeoStateInfo &td);
113  virtual void SortCrossedVoxels(const Double_t *point, const Double_t *dir, TGeoStateInfo &td);
114  virtual void Voxelize(Option_t *option="");
115 
116  ClassDef(TGeoVoxelFinder, 4) // voxel finder class
117 };
118 
119 #endif
TGeoVoxelFinder::FindOverlaps
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
Definition: TGeoVoxelFinder.cxx:296
TGeoVoxelFinder::PrintVoxelLimits
void PrintVoxelLimits(const Double_t *point) const
print the voxel containing point
Definition: TGeoVoxelFinder.cxx:2184
TGeoVoxelFinder::fNoy
Int_t fNoy
Definition: TGeoVoxelFinder.h:40
TGeoVoxelFinder::fNz
Int_t fNz
Definition: TGeoVoxelFinder.h:47
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGeoVoxelFinder::GetCheckList
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
Definition: TGeoVoxelFinder.cxx:1205
TGeoVoxelFinder::operator=
TGeoVoxelFinder & operator=(const TGeoVoxelFinder &)=delete
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGeoVoxelFinder::fExtraX
Int_t * fExtraX
Definition: TGeoVoxelFinder.h:59
TGeoVoxelFinder::IsSafeVoxel
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.
Definition: TGeoVoxelFinder.cxx:227
TGeoVoxelFinder::fIbz
Int_t fIbz
Definition: TGeoVoxelFinder.h:37
TGeoVoxelFinder::Efficiency
virtual Double_t Efficiency()
Compute voxelization efficiency.
Definition: TGeoVoxelFinder.cxx:249
TGeoVoxelFinder::DaughterToMother
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
Definition: TGeoVoxelFinder.cxx:217
TGeoVoxelFinder::SortAll
void SortAll(Option_t *option="")
order bounding boxes along x, y, z
Definition: TGeoVoxelFinder.cxx:1658
TGeoVoxelFinder::fNboxes
Int_t fNboxes
Definition: TGeoVoxelFinder.h:38
TGeoVoxelFinder::GetNextVoxel
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")...
Definition: TGeoVoxelFinder.cxx:1366
TGeoVoxelFinder::EVoxelsType
EVoxelsType
Definition: TGeoVoxelFinder.h:23
Int_t
int Int_t
Definition: RtypesCore.h:45
TGeoVoxelFinder::GetVoxelCandidates
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
Definition: TGeoVoxelFinder.cxx:1302
TGeoVoxelFinder::GetIndices
Bool_t GetIndices(const Double_t *point, TGeoStateInfo &td)
Get indices for current slices on x, y, z.
Definition: TGeoVoxelFinder.cxx:348
TGeoVoxelFinder::TGeoVoxelFinder
TGeoVoxelFinder()
Default constructor.
Definition: TGeoVoxelFinder.cxx:39
TGeoVoxelFinder::fIby
Int_t fIby
Definition: TGeoVoxelFinder.h:36
TGeoVoxelFinder::BuildVoxelLimits
void BuildVoxelLimits()
build the array of bounding boxes of the nodes inside
Definition: TGeoVoxelFinder.cxx:172
TGeoVoxelFinder::Union
Bool_t Union(Int_t n1, UChar_t *array1, TGeoStateInfo &td)
make union of older bits with new array printf("Union - one slice\n");
Definition: TGeoVoxelFinder.cxx:1460
TGeoVoxelFinder::fOBx
Int_t * fOBx
Definition: TGeoVoxelFinder.h:53
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGeoVoxelFinder::fOEx
Int_t * fOEx
Definition: TGeoVoxelFinder.h:56
bool
TGeoVoxelFinder::fVolume
TGeoVolume * fVolume
Definition: TGeoVoxelFinder.h:33
TGeoVoxelFinder::TGeoVoxelFinder
TGeoVoxelFinder(const TGeoVoxelFinder &)=delete
TGeoVoxelFinder::GetNextCandidates
virtual Int_t * GetNextCandidates(const Double_t *point, Int_t &ncheck, TGeoStateInfo &td)
Returns list of new candidates in next voxel.
Definition: TGeoVoxelFinder.cxx:510
TGeoVoxelFinder::fBoxes
Double_t * fBoxes
Definition: TGeoVoxelFinder.h:49
TGeoVoxelFinder::SetInvalid
void SetInvalid(Bool_t flag=kTRUE)
Definition: TGeoVoxelFinder.h:110
TGeoVoxelFinder::fNex
Int_t fNex
Definition: TGeoVoxelFinder.h:42
TGeoStateInfo
Statefull info for the current geometry level.
Definition: TGeoStateInfo.h:21
TGeoVoxelFinder::fXb
Double_t * fXb
Definition: TGeoVoxelFinder.h:50
TGeoVoxelFinder::fNsliceX
Int_t * fNsliceX
Definition: TGeoVoxelFinder.h:62
TGeoVoxelFinder::fExtraY
Int_t * fExtraY
Definition: TGeoVoxelFinder.h:60
TGeoVoxelFinder::Print
virtual void Print(Option_t *option="") const
Print the voxels.
Definition: TGeoVoxelFinder.cxx:2082
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
TGeoVoxelFinder::SortCrossedVoxels
virtual void SortCrossedVoxels(const Double_t *point, const Double_t *dir, TGeoStateInfo &td)
get the list in the next voxel crossed by a ray
Definition: TGeoVoxelFinder.cxx:1071
TGeoVoxelFinder::fOEz
Int_t * fOEz
Definition: TGeoVoxelFinder.h:58
TGeoVoxelFinder::kGeoInvalidVoxels
@ kGeoInvalidVoxels
Definition: TGeoVoxelFinder.h:24
TGeoVoxelFinder::fOEy
Int_t * fOEy
Definition: TGeoVoxelFinder.h:57
TGeoVoxelFinder::fYb
Double_t * fYb
Definition: TGeoVoxelFinder.h:51
TGeoVoxelFinder::fNx
Int_t fNx
Definition: TGeoVoxelFinder.h:45
TGeoVoxelFinder::GetExtraZ
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)
Definition: TGeoVoxelFinder.cxx:431
BIT
#define BIT(n)
Definition: Rtypes.h:85
TGeoVoxelFinder::fOBz
Int_t * fOBz
Definition: TGeoVoxelFinder.h:55
TGeoVoxelFinder::SetNeedRebuild
void SetNeedRebuild(Bool_t flag=kTRUE)
Definition: TGeoVoxelFinder.h:111
TGeoVoxelFinder::Voxelize
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
Definition: TGeoVoxelFinder.cxx:2221
TGeoVoxelFinder::IsInvalid
Bool_t IsInvalid() const
Definition: TGeoVoxelFinder.h:104
TGeoVoxelFinder::fNsliceY
Int_t * fNsliceY
Definition: TGeoVoxelFinder.h:63
TGeoVoxelFinder::fNoz
Int_t fNoz
Definition: TGeoVoxelFinder.h:41
TGeoVoxelFinder::fIndcX
UChar_t * fIndcX
Definition: TGeoVoxelFinder.h:65
TGeoVoxelFinder::fOBy
Int_t * fOBy
Definition: TGeoVoxelFinder.h:54
TGeoVoxelFinder::GetPriority
Int_t GetPriority(Int_t iaxis) const
Definition: TGeoVoxelFinder.h:74
TGeoVoxelFinder::fIndcZ
UChar_t * fIndcZ
Definition: TGeoVoxelFinder.h:67
TGeoVoxelFinder::fNox
Int_t fNox
Definition: TGeoVoxelFinder.h:39
Double_t
double Double_t
Definition: RtypesCore.h:59
TGeoVoxelFinder::NeedRebuild
Bool_t NeedRebuild() const
Definition: TGeoVoxelFinder.h:105
TObject.h
TGeoVoxelFinder::~TGeoVoxelFinder
virtual ~TGeoVoxelFinder()
Destructor.
Definition: TGeoVoxelFinder.cxx:127
TGeoVoxelFinder::GetValidExtra
Int_t * GetValidExtra(Int_t *list, Int_t &ncheck, TGeoStateInfo &td)
Get extra candidates that are not contained in current check list.
Definition: TGeoVoxelFinder.cxx:449
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
TGeoVoxelFinder::fExtraZ
Int_t * fExtraZ
Definition: TGeoVoxelFinder.h:61
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGeoVoxelFinder::Intersect
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
Definition: TGeoVoxelFinder.cxx:1389
TGeoVoxelFinder::fZb
Double_t * fZb
Definition: TGeoVoxelFinder.h:52
TGeoVoxelFinder::fNey
Int_t fNey
Definition: TGeoVoxelFinder.h:43
TGeoVoxelFinder::fNsliceZ
Int_t * fNsliceZ
Definition: TGeoVoxelFinder.h:64
TGeoVoxelFinder::GetBoxes
Double_t * GetBoxes() const
Definition: TGeoVoxelFinder.h:106
TGeoVoxelFinder::IntersectAndStore
Bool_t IntersectAndStore(Int_t n1, UChar_t *array1, TGeoStateInfo &td)
return the list of nodes corresponding to one array of bits
Definition: TGeoVoxelFinder.cxx:1418
TGeoVoxelFinder::GetExtraY
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)
Definition: TGeoVoxelFinder.cxx:412
TGeoVoxelFinder::fIbx
Int_t fIbx
Definition: TGeoVoxelFinder.h:35
TGeoVoxelFinder::fPriority
Int_t fPriority[3]
Definition: TGeoVoxelFinder.h:48
TGeoVoxelFinder::GetNcandidates
Int_t GetNcandidates(TGeoStateInfo &td) const
Definition: TGeoVoxelFinder.cxx:156
TGeoVoxelFinder
Finder class handling voxels.
Definition: TGeoVoxelFinder.h:21
TGeoVolume
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:49
TGeoVoxelFinder::GetExtraX
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)
Definition: TGeoVoxelFinder.cxx:393
TGeoVoxelFinder::fIndcY
UChar_t * fIndcY
Definition: TGeoVoxelFinder.h:66
TGeoVoxelFinder::kGeoRebuildVoxels
@ kGeoRebuildVoxels
Definition: TGeoVoxelFinder.h:25
TGeoVoxelFinder::fNy
Int_t fNy
Definition: TGeoVoxelFinder.h:46
int
TGeoVoxelFinder::fNez
Int_t fNez
Definition: TGeoVoxelFinder.h:44