All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
voxel.h
Go to the documentation of this file.
1 #ifndef _voxel_included_
2 #define _voxel_included_
3 
4 // A header file which defines a voxel class for the TPC
5 #include <vector>
6 //#include "ThreeVector.h"
7 #include <CLHEP/Vector/ThreeVector.h>
8 
9 using namespace std;
10 
11 /**
12 \addtogroup TrackDigi TrackDigi
13 @{
14 */
15 
16 class Voxel_tpc{
17 
18  public:
19  Voxel_tpc();
20  // the intialation in the constructor here would be preferable though I don't know how to intialise
21  // the array xyz[3] here with pos[3], for the mean time the constructor will be put in the .cc file
22  // Voxel_tpc(int row, int phi, int z, double pos[3]) : row_index(row), phi_index(phi), z_index(z){}
23  Voxel_tpc(int row, int phi, int z, double pos[3], double posRPhi[2], double edep, double rPhiRes, double zRes);
24  Voxel_tpc(int row, int phi, int z, CLHEP::Hep3Vector coord, double edep, double rPhiRes, double zRes);
25  ~Voxel_tpc();
26 
27  void setAdjacent(Voxel_tpc * p_voxel) { _adjacent_voxels.push_back(p_voxel);};
28  void setIsClusterHit() { _isClusterHit = true;};
29  void setIsMerged() { _isMerged = true;};
30  bool IsClusterHit() { return _isClusterHit;};
31  bool IsMerged() { return _isMerged;};
32  int clusterFind(vector <Voxel_tpc*>* hitList);
33 
34 
35  int getRowIndex() {return _row_index;};
36  int getPhiIndex() {return _phi_index;};
37  int getZIndex() {return _z_index;};
38  Voxel_tpc * getFirstAdjacent() {return *(_adjacent_voxels.begin());};
39  Voxel_tpc * getAdjacent(int i) {return _adjacent_voxels[i];};
40  int getNumberOfAdjacent() {return _adjacent_voxels.size();};
41  double getX() {return _coord.x();};
42  double getY() {return _coord.y();};
43  double getZ() {return _coord.z();};
44  double getR() {return _coord.perp();};
45  double getPhi() {return _coord.phi();};
46  double getEDep() {return _edep;};
47  double getRPhiRes() {return _rPhiRes;};
48  double getZRes() {return _zRes;};
49  const CLHEP::Hep3Vector getHep3Vector() {return _coord;};
50  // bool compare_phi( Voxel_tpc * & a, Voxel_tpc * & b);
51 
52 
53 
54  private:
55  int _row_index{};
56  int _phi_index{};
57  int _z_index{};
58  vector <Voxel_tpc *> _adjacent_voxels{};
59  CLHEP::Hep3Vector _coord{};
60  double _edep{};
61  double _rPhiRes{};
62  double _zRes{};
63  bool _isMerged{};
64  bool _isClusterHit{};
65 };
66 /** @} */
67 #endif
int getNumberOfAdjacent()
Definition: voxel.h:40
double getEDep()
Definition: voxel.h:46
double getX()
Definition: voxel.h:41
int getRowIndex()
Definition: voxel.h:35
int getPhiIndex()
Definition: voxel.h:36
double getY()
Definition: voxel.h:42
bool IsClusterHit()
Definition: voxel.h:30
Voxel_tpc * getAdjacent(int i)
Definition: voxel.h:39
void setIsClusterHit()
Definition: voxel.h:28
int getZIndex()
Definition: voxel.h:37
double getZRes()
Definition: voxel.h:48
Voxel_tpc * getFirstAdjacent()
Definition: voxel.h:38
const CLHEP::Hep3Vector getHep3Vector()
Definition: voxel.h:49
void setIsMerged()
Definition: voxel.h:29
double getPhi()
Definition: voxel.h:45
bool IsMerged()
Definition: voxel.h:31
double getZ()
Definition: voxel.h:43
void setAdjacent(Voxel_tpc *p_voxel)
Definition: voxel.h:27
double getR()
Definition: voxel.h:44
double getRPhiRes()
Definition: voxel.h:47