Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
gar::rec::CaloHit Class Reference

#include <CaloHit.h>

Public Member Functions

 CaloHit ()
 
unsigned int GetCellLengthScale () const
 
bool operator< (const CaloHit &rhs) const
 
 CaloHit (float energy, float time, float *pos, raw::CellID_t cellID, unsigned int layer)
 
 CaloHit (float energy, std::pair< float, float > time, float *pos, raw::CellID_t cellID, unsigned int layer)
 
 CaloHit (const gar::rec::CaloHit &)=default
 
bool operator== (const CaloHit &rhs) const
 
bool operator!= (const CaloHit &rhs) const
 
gar::rec::IDNumber getIDNumber () const
 
const float * Position () const
 
float Energy () const
 
std::pair< float, float > Time () const
 
raw::CellID_t CellID () const
 
unsigned int Layer () const
 

Private Attributes

gar::rec::IDNumber fIDnumero
 
float fEnergy
 energy of the calo hit in GeV More...
 
float fPosition [3]
 position of the calo hit in cm More...
 
std::pair< float, float > fTime
 time of the calo hit in ns More...
 
raw::CellID_t fCellID
 cellID More...
 
unsigned int fLayer
 Layer. More...
 

Static Private Attributes

static gar::rec::IDNumber const FirstNumber = 100200000
 

Friends

std::ostream & operator<< (std::ostream &o, gar::rec::CaloHit const &h)
 

Detailed Description

Definition at line 21 of file CaloHit.h.

Constructor & Destructor Documentation

gar::rec::CaloHit::CaloHit ( )

Definition at line 15 of file CaloHit.cxx.

16  : fEnergy(0.),
17  fCellID(0.),
18  fLayer(0.)
19  {
22 
23  fPosition[0] = 0.;
24  fPosition[1] = 0.;
25  fPosition[2] = 0.;
26 
27  fTime = std::make_pair(0., 0.);
28 
29  return;
30  }
float fPosition[3]
position of the calo hit in cm
Definition: CaloHit.h:37
unsigned int fLayer
Layer.
Definition: CaloHit.h:40
raw::CellID_t fCellID
cellID
Definition: CaloHit.h:39
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
Definition: IDNumberGen.cxx:18
float fEnergy
energy of the calo hit in GeV
Definition: CaloHit.h:36
std::pair< float, float > fTime
time of the calo hit in ns
Definition: CaloHit.h:38
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
static gar::rec::IDNumber const FirstNumber
Definition: CaloHit.h:32
gar::rec::CaloHit::CaloHit ( float  energy,
float  time,
float *  pos,
raw::CellID_t  cellID,
unsigned int  layer 
)

Definition at line 44 of file CaloHit.cxx.

45  : fEnergy (energy )
46  , fCellID (cellID )
47  , fLayer (layer )
48  {
51 
52  fPosition[0] = pos[0];
53  fPosition[1] = pos[1];
54  fPosition[2] = pos[2];
55 
56  fTime = std::make_pair(time, 0.);
57 
58  return;
59  }
float fPosition[3]
position of the calo hit in cm
Definition: CaloHit.h:37
unsigned int fLayer
Layer.
Definition: CaloHit.h:40
raw::CellID_t fCellID
cellID
Definition: CaloHit.h:39
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
Definition: IDNumberGen.cxx:18
float fEnergy
energy of the calo hit in GeV
Definition: CaloHit.h:36
std::pair< float, float > fTime
time of the calo hit in ns
Definition: CaloHit.h:38
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
static gar::rec::IDNumber const FirstNumber
Definition: CaloHit.h:32
gar::rec::CaloHit::CaloHit ( float  energy,
std::pair< float, float >  time,
float *  pos,
raw::CellID_t  cellID,
unsigned int  layer 
)

Definition at line 62 of file CaloHit.cxx.

63  : fEnergy (energy )
64  , fTime (time )
65  , fCellID (cellID )
66  , fLayer (layer )
67  {
70 
71  fPosition[0] = pos[0];
72  fPosition[1] = pos[1];
73  fPosition[2] = pos[2];
74 
75  return;
76  }
float fPosition[3]
position of the calo hit in cm
Definition: CaloHit.h:37
unsigned int fLayer
Layer.
Definition: CaloHit.h:40
raw::CellID_t fCellID
cellID
Definition: CaloHit.h:39
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
Definition: IDNumberGen.cxx:18
float fEnergy
energy of the calo hit in GeV
Definition: CaloHit.h:36
std::pair< float, float > fTime
time of the calo hit in ns
Definition: CaloHit.h:38
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
static gar::rec::IDNumber const FirstNumber
Definition: CaloHit.h:32
gar::rec::CaloHit::CaloHit ( const gar::rec::CaloHit )
default

Member Function Documentation

raw::CellID_t gar::rec::CaloHit::CellID ( ) const
inline

Definition at line 72 of file CaloHit.h.

72 { return fCellID; }
raw::CellID_t fCellID
cellID
Definition: CaloHit.h:39
float gar::rec::CaloHit::Energy ( ) const
inline

Definition at line 69 of file CaloHit.h.

69 { return fEnergy; }
float fEnergy
energy of the calo hit in GeV
Definition: CaloHit.h:36
unsigned int gar::rec::CaloHit::GetCellLengthScale ( ) const

Definition at line 122 of file CaloHit.cxx.

123  {
124  std::array<double, 3> point = {this->Position()[0], this->Position()[1], this->Position()[2]};
125  if(gar::providerFrom<geo::GeometryGAr>()->isTile(point, this->CellID()))
126  {
127  return std::sqrt( gar::providerFrom<geo::GeometryGAr>()->getTileSize(point) * gar::providerFrom<geo::GeometryGAr>()->getTileSize(point) );
128  }
129  else
130  {
131  return std::sqrt( gar::providerFrom<geo::GeometryGAr>()->getStripWidth(point) * gar::providerFrom<geo::GeometryGAr>()->getStripLength(point, this->CellID()) );
132  }
133  }
raw::CellID_t CellID() const
Definition: CaloHit.h:72
const float * Position() const
Definition: CaloHit.h:70
gar::rec::IDNumber gar::rec::CaloHit::getIDNumber ( ) const

Definition at line 40 of file CaloHit.cxx.

40 {return fIDnumero;}
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
unsigned int gar::rec::CaloHit::Layer ( ) const
inline

Definition at line 73 of file CaloHit.h.

73 { return fLayer; }
unsigned int fLayer
Layer.
Definition: CaloHit.h:40
bool gar::rec::CaloHit::operator!= ( const CaloHit rhs) const

Definition at line 36 of file CaloHit.cxx.

36  {
37  return (this->fIDnumero != rhs.fIDnumero);
38  }
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
bool gar::rec::CaloHit::operator< ( const CaloHit rhs) const

Definition at line 79 of file CaloHit.cxx.

80  {
81  const TVector3 rhsPos(rhs.Position()[0], rhs.Position()[1], rhs.Position()[2]);
82  const TVector3 thisPos(this->Position()[0], this->Position()[1], this->Position()[2]);
83  const TVector3 deltaPosition(rhsPos - thisPos);
84 
85  if (std::fabs(deltaPosition.z()) > std::numeric_limits<float>::epsilon())
86  return (deltaPosition.z() > std::numeric_limits<float>::epsilon());
87 
88  if (std::fabs(deltaPosition.x()) > std::numeric_limits<float>::epsilon())
89  return (deltaPosition.x() > std::numeric_limits<float>::epsilon());
90 
91  if (std::fabs(deltaPosition.y()) > std::numeric_limits<float>::epsilon())
92  return (deltaPosition.y() > std::numeric_limits<float>::epsilon());
93 
94  return (this->Energy() > rhs.Energy());
95  }
float Energy() const
Definition: CaloHit.h:69
const float * Position() const
Definition: CaloHit.h:70
bool gar::rec::CaloHit::operator== ( const CaloHit rhs) const

Definition at line 32 of file CaloHit.cxx.

32  {
33  return (this->fIDnumero == rhs.fIDnumero);
34  }
gar::rec::IDNumber fIDnumero
Definition: CaloHit.h:33
const float * gar::rec::CaloHit::Position ( ) const
inline

Definition at line 70 of file CaloHit.h.

70 { return &fPosition[0]; }
float fPosition[3]
position of the calo hit in cm
Definition: CaloHit.h:37
std::pair< float, float > gar::rec::CaloHit::Time ( ) const
inline

Definition at line 71 of file CaloHit.h.

71 { return fTime; }
std::pair< float, float > fTime
time of the calo hit in ns
Definition: CaloHit.h:38

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
gar::rec::CaloHit const &  h 
)
friend

Definition at line 98 of file CaloHit.cxx.

99  {
100 
101  o << "CaloHit "
102  << "\n\tID number = "
103  << h.getIDNumber()
104  << "\n\tposition = ("
105  << h.Position()[0]
106  << ", "
107  << h.Position()[1]
108  << ", "
109  << h.Position()[2]
110  << ")"
111  << "\n\tenergy = "
112  << h.Energy()
113  << "\n\t time: "
114  << h.Time().first << " " << h.Time().second
115  << " cellID: "
116  << h.CellID();
117 
118  return o;
119  }

Member Data Documentation

raw::CellID_t gar::rec::CaloHit::fCellID
private

cellID

Definition at line 39 of file CaloHit.h.

float gar::rec::CaloHit::fEnergy
private

energy of the calo hit in GeV

Definition at line 36 of file CaloHit.h.

gar::rec::IDNumber gar::rec::CaloHit::fIDnumero
private

Definition at line 33 of file CaloHit.h.

gar::rec::IDNumber const gar::rec::CaloHit::FirstNumber = 100200000
staticprivate

Definition at line 32 of file CaloHit.h.

unsigned int gar::rec::CaloHit::fLayer
private

Layer.

Definition at line 40 of file CaloHit.h.

float gar::rec::CaloHit::fPosition[3]
private

position of the calo hit in cm

Definition at line 37 of file CaloHit.h.

std::pair<float, float> gar::rec::CaloHit::fTime
private

time of the calo hit in ns

Definition at line 38 of file CaloHit.h.


The documentation for this class was generated from the following files: