LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
PhotonVoxels.h
Go to the documentation of this file.
1 #ifndef PhotonVoxels_h
2 #define PhotonVoxels_h 1
3 
4 #include "TVector3.h"
5 
6 namespace sim {
7 
8 
9  class PhotonVoxel{
10  public:
11  PhotonVoxel(double xMin,
12  double xMax,
13  double yMin,
14  double yMax,
15  double zMin,
16  double zMax,
17  int N = 0) ;
18  PhotonVoxel();
19 
20  private:
21  double xVoxelMin;
22  double xVoxelMax;
23  double yVoxelMin;
24  double yVoxelMax;
25  double zVoxelMin;
26  double zVoxelMax;
27 
28  int NPhotons;
29 
30 #ifndef __GCCXML__
31  public:
32 
33  TVector3 GetLowerCorner() const;
34  TVector3 GetUpperCorner() const;
35  TVector3 GetCenter() const;
36 
37 #endif
38 
39  };
40 
41 
43  {
44  public:
45  PhotonVoxelDef(double xMin,
46  double xMax,
47  int xN,
48  double yMin,
49  double yMax,
50  int yN,
51  double zMin,
52  double zMax,
53  int z);
55 
56  private:
57  TVector3 fLowerCorner;
58  TVector3 fUpperCorner;
59  int fxSteps;
60  int fySteps;
61  int fzSteps;
62 
63 #ifndef __GCCXML__
64  public:
65 
66  TVector3 GetRegionUpperCorner() const;
67  TVector3 GetRegionLowerCorner() const;
68  TVector3 GetSteps() const;
69 
70 
71  TVector3 GetVoxelSize()const;
72 
73  int GetNVoxels() const;
74 
75  int GetVoxelID(const TVector3&) const;
76  int GetVoxelID(double const*) const;
77  bool IsLegalVoxelID(int) const;
78 
79  struct NeiInfo
80  {
81  NeiInfo(int i, double w) : id(i), weight(w) {}
82  int id;
83  double weight;
84  };
85 
86  // Out-param allows less allocation if caller re-uses a buffer
87  void GetNeighboringVoxelIDs(const TVector3& v,
88  std::vector<NeiInfo>& ret) const;
89 
90  PhotonVoxel GetPhotonVoxel(int ID) const;
91  std::vector<int> GetVoxelCoords(int ID) const;
92  PhotonVoxel GetContainingVoxel(TVector3) const;
93 
94  bool operator==(const PhotonVoxelDef &rhs) const;
95  bool operator!=(const PhotonVoxelDef &rhs) const
96  { return ! ((*this)==rhs); }
97 
98 #endif
99 
100  };
101 }
102 
103 #endif
NeiInfo(int i, double w)
Definition: PhotonVoxels.h:81
Double_t z
Definition: plot.C:279
TVector3 GetCenter() const
TVector3 GetUpperCorner() const
TVector3 GetLowerCorner() const
Monte Carlo Simulation.
bool operator!=(const PhotonVoxelDef &rhs) const
Definition: PhotonVoxels.h:95
double weight
Definition: plottest35.C:25
Float_t w
Definition: plot.C:23
bool operator==(geometry_element_iterator< GEOIDITER > const &iter, GEOIDITER const &id_iter)
Comparison operator: geometry ID and element point to the same ID.