CaloHit.h
Go to the documentation of this file.
1 //
2 // CaloHit.h
3 //
4 // Created by Eldwan Brianne on 08/29/18.
5 //
6 
7 #ifndef GAR_RECONSTRUCTIONDATAPRODUCTS_CaloHit_h
8 #define GAR_RECONSTRUCTIONDATAPRODUCTS_CaloHit_h
9 
10 #include <iostream>
11 
12 #include "Geometry/GeometryGAr.h"
13 
14 #include "TVector3.h"
15 
16 #include "IDNumberGen.h"
17 
18 namespace gar {
19  namespace rec {
20 
21  class CaloHit {
22 
23  public:
24  CaloHit();
25 
26  // let the compiler provide the dtor
27  unsigned int GetCellLengthScale() const;
28 
29  bool operator< (const CaloHit &rhs) const;
30 
31  private:
32  static gar::rec::IDNumber const FirstNumber = 100200000;
34 
35 
36  float fEnergy; ///< energy of the calo hit in GeV
37  float fPosition[3]; ///< position of the calo hit in cm
38  std::pair<float, float> fTime; ///< time of the calo hit in ns
39  raw::CellID_t fCellID; ///< cellID
40  unsigned int fLayer; ///< Layer
41 
42  #ifndef __GCCXML__
43 
44  public:
45 
46  CaloHit(float energy, float time, float *pos, raw::CellID_t cellID, unsigned int layer);
47 
48  CaloHit(float energy, std::pair<float, float> time, float *pos, raw::CellID_t cellID, unsigned int layer);
49 
50  //Copy constructor
51  CaloHit(const gar::rec::CaloHit &) = default;
52 
53  bool operator==(const CaloHit& rhs) const;
54  bool operator!=(const CaloHit& rhs) const;
56 
57  const float* Position() const;
58  float Energy() const;
59  std::pair<float, float> Time() const;
60  raw::CellID_t CellID() const;
61  unsigned int Layer() const;
62 
63  friend std::ostream& operator << (std::ostream & o, gar::rec::CaloHit const& h);
64 
65  #endif
66 
67  };
68 
69  inline float gar::rec::CaloHit::Energy() const { return fEnergy; }
70  inline const float* gar::rec::CaloHit::Position() const { return &fPosition[0]; }
71  inline std::pair<float, float> gar::rec::CaloHit::Time() const { return fTime; }
72  inline raw::CellID_t gar::rec::CaloHit::CellID() const { return fCellID; }
73  inline unsigned int gar::rec::CaloHit::Layer() const { return fLayer; }
74 
75  } // rec
76 } // gar
77 
78 
79 #endif /* GAR_RECONSTRUCTIONDATAPRODUCTS_CaloHit_h */
float fPosition[3]
position of the calo hit in cm
Definition: CaloHit.h:37
rec
Definition: tracks.py:88
unsigned int fLayer
Layer.
Definition: CaloHit.h:40
raw::CellID_t CellID() const
Definition: CaloHit.h:72
bool operator<(const CaloHit &rhs) const
Definition: CaloHit.cxx:79
raw::CellID_t fCellID
cellID
Definition: CaloHit.h:39
std::pair< float, float > Time() const
Definition: CaloHit.h:71
bool operator!=(const CaloHit &rhs) const
Definition: CaloHit.cxx:36
unsigned int GetCellLengthScale() const
Definition: CaloHit.cxx:122
unsigned int Layer() const
Definition: CaloHit.h:73
gar::rec::IDNumber getIDNumber() const
Definition: CaloHit.cxx:40
float fEnergy
energy of the calo hit in GeV
Definition: CaloHit.h:36
float Energy() const
Definition: CaloHit.h:69
long long int CellID_t
Definition: CaloRawDigit.h:24
General GArSoft Utilities.
const float * Position() const
Definition: CaloHit.h:70
std::pair< float, float > fTime
time of the calo hit in ns
Definition: CaloHit.h:38
bool operator==(const CaloHit &rhs) const
Definition: CaloHit.cxx:32
art framework interface to geometry description
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
static gar::rec::IDNumber const FirstNumber
Definition: CaloHit.h:32
size_t IDNumber
Definition: IDNumberGen.h:71
friend std::ostream & operator<<(std::ostream &o, gar::rec::CaloHit const &h)
Definition: CaloHit.cxx:98