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

#include <Cluster.h>

Public Member Functions

 Cluster ()
 
 Cluster (const gar::rec::Cluster &)=default
 
bool operator== (const Cluster &rhs) const
 
bool operator!= (const Cluster &rhs) const
 
gar::rec::IDNumber getIDNumber () const
 
void addHit (gar::rec::CaloHit *hit, float contribution)
 
void addTrack (gar::rec::Track *trk)
 
void setEnergy (float energy)
 
void setEnergyError (float energy_error)
 
void setTime (float time, float time_diff)
 
void setPosition (const float *position)
 
void setITheta (float theta)
 
void setIPhi (float phi)
 
void setEigenVectors (const float *eigenvectors)
 
void setShape (const float *shape)
 
void setParticleID (int pid)
 
float Energy () const
 
float EnergyError () const
 
float Time () const
 
float TimeDiffFirstLast () const
 
const float * Position () const
 
float ITheta () const
 
float IPhi () const
 
const float * EigenVectors () const
 
const float * Shape () const
 
int ParticleID () const
 
const std::vector< gar::rec::Track * > & Tracks () const
 
const std::vector< gar::rec::CaloHit * > & CalorimeterHits () const
 
const std::vector< float > & HitContributions () const
 

Private Attributes

gar::rec::IDNumber fIDnumero
 
float fEnergy {0}
 energy of the ecal cluster in GeV More...
 
float fEnergyError {0}
 energy of the ecal cluster in GeV More...
 
float fTime {0}
 time of the ecal cluster in ns More...
 
float fTimeDiffFirstLast {0}
 time difference between the first and last layer of the cluster in ns More...
 
float fPosition [3] = {0, 0, 0}
 position of the cluster in cm More...
 
float fShape [6] = {0, 0, 0, 0, 0, 0}
 cluster shape parameters (Ellipsoid r1, r2, r3, vol, width) More...
 
float fTheta {0}
 intrasic direction of the cluster theta More...
 
float fPhi {0}
 intrasic direction of the cluster phi More...
 
float fEigenVector [9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}
 EigenVectors of the cluster corresponding to the 3 main axis sorted in ascending order (main principal axis with smallest inertial of mass) normalised to length of 1. More...
 
int fParticleId {0}
 particle id flag More...
 
std::vector< gar::rec::Track * > fTracks {}
 vector of tracks associated to the cluster More...
 
std::vector< gar::rec::CaloHit * > fHits {}
 vector of hit contribution More...
 
std::vector< float > fWeights {}
 vector of energy contribution of the hits More...
 

Static Private Attributes

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

Friends

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

Detailed Description

Definition at line 24 of file Cluster.h.

Constructor & Destructor Documentation

gar::rec::Cluster::Cluster ( )

Definition at line 8 of file Cluster.cxx.

8  {
9  // The default constructor is used e.g. by art::DataViewImpl::getHandle
10  // Make sure all Cluster objects are numbered, lest art deep-copy uninitialized
11  // instances and then operator==() evaluates meaninglessly true.
14  return;
15  }
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
Definition: IDNumberGen.cxx:18
gar::rec::IDNumber fIDnumero
Definition: Cluster.h:33
static gar::rec::IDNumber const FirstNumber
Definition: Cluster.h:32
gar::rec::Cluster::Cluster ( const gar::rec::Cluster )
default

Member Function Documentation

void gar::rec::Cluster::addHit ( gar::rec::CaloHit hit,
float  contribution 
)

Definition at line 64 of file Cluster.cxx.

64  {
65  fHits.push_back( hit ) ;
66  fWeights.push_back( contribution ) ;
67  }
std::vector< gar::rec::CaloHit * > fHits
vector of hit contribution
Definition: Cluster.h:46
std::vector< float > fWeights
vector of energy contribution of the hits
Definition: Cluster.h:47
void gar::rec::Cluster::addTrack ( gar::rec::Track trk)

Definition at line 70 of file Cluster.cxx.

70  {
71  fTracks.push_back( trk ) ;
72  }
std::vector< gar::rec::Track * > fTracks
vector of tracks associated to the cluster
Definition: Cluster.h:45
const std::vector< gar::rec::CaloHit * > & gar::rec::Cluster::CalorimeterHits ( ) const
inline

Definition at line 103 of file Cluster.h.

103 { return fHits; }
std::vector< gar::rec::CaloHit * > fHits
vector of hit contribution
Definition: Cluster.h:46
const float * gar::rec::Cluster::EigenVectors ( ) const
inline

Definition at line 99 of file Cluster.h.

99 { return fEigenVector; }
float fEigenVector[9]
EigenVectors of the cluster corresponding to the 3 main axis sorted in ascending order (main principa...
Definition: Cluster.h:43
float gar::rec::Cluster::Energy ( ) const
inline

Definition at line 92 of file Cluster.h.

92 { return fEnergy; }
float fEnergy
energy of the ecal cluster in GeV
Definition: Cluster.h:35
float gar::rec::Cluster::EnergyError ( ) const
inline

Definition at line 93 of file Cluster.h.

93 { return fEnergyError; }
float fEnergyError
energy of the ecal cluster in GeV
Definition: Cluster.h:36
gar::rec::IDNumber gar::rec::Cluster::getIDNumber ( ) const

Definition at line 106 of file Cluster.cxx.

106 {return fIDnumero;}
gar::rec::IDNumber fIDnumero
Definition: Cluster.h:33
const std::vector< float > & gar::rec::Cluster::HitContributions ( ) const
inline

Definition at line 104 of file Cluster.h.

104 { return fWeights; }
std::vector< float > fWeights
vector of energy contribution of the hits
Definition: Cluster.h:47
float gar::rec::Cluster::IPhi ( ) const
inline

Definition at line 98 of file Cluster.h.

98 { return fPhi; }
float fPhi
intrasic direction of the cluster phi
Definition: Cluster.h:42
float gar::rec::Cluster::ITheta ( ) const
inline

Definition at line 97 of file Cluster.h.

97 { return fTheta; }
float fTheta
intrasic direction of the cluster theta
Definition: Cluster.h:41
bool gar::rec::Cluster::operator!= ( const Cluster rhs) const

Definition at line 102 of file Cluster.cxx.

102  {
103  return (this->fIDnumero != rhs.fIDnumero);
104  }
gar::rec::IDNumber fIDnumero
Definition: Cluster.h:33
bool gar::rec::Cluster::operator== ( const Cluster rhs) const

Definition at line 98 of file Cluster.cxx.

98  {
99  return (this->fIDnumero == rhs.fIDnumero);
100  }
gar::rec::IDNumber fIDnumero
Definition: Cluster.h:33
int gar::rec::Cluster::ParticleID ( ) const
inline

Definition at line 101 of file Cluster.h.

101 { return fParticleId; }
int fParticleId
particle id flag
Definition: Cluster.h:44
const float * gar::rec::Cluster::Position ( ) const
inline

Definition at line 96 of file Cluster.h.

96 { return fPosition; }
float fPosition[3]
position of the cluster in cm
Definition: Cluster.h:39
void gar::rec::Cluster::setEigenVectors ( const float *  eigenvectors)

Definition at line 49 of file Cluster.cxx.

49  {
50  for(int i=0;i<9;i++) { fEigenVector[i] = eigenvectors[i]; }
51  }
float fEigenVector[9]
EigenVectors of the cluster corresponding to the 3 main axis sorted in ascending order (main principa...
Definition: Cluster.h:43
void gar::rec::Cluster::setEnergy ( float  energy)

Definition at line 18 of file Cluster.cxx.

18  {
19  fEnergy = energy ;
20  }
float fEnergy
energy of the ecal cluster in GeV
Definition: Cluster.h:35
void gar::rec::Cluster::setEnergyError ( float  energy_error)

Definition at line 23 of file Cluster.cxx.

23  {
24  fEnergyError = energy_error ;
25  }
float fEnergyError
energy of the ecal cluster in GeV
Definition: Cluster.h:36
void gar::rec::Cluster::setIPhi ( float  phi)

Definition at line 44 of file Cluster.cxx.

44  {
45  fPhi = phi;
46  }
float fPhi
intrasic direction of the cluster phi
Definition: Cluster.h:42
void gar::rec::Cluster::setITheta ( float  theta)

Definition at line 39 of file Cluster.cxx.

39  {
40  fTheta = theta;
41  }
float fTheta
intrasic direction of the cluster theta
Definition: Cluster.h:41
void gar::rec::Cluster::setParticleID ( int  pid)

Definition at line 59 of file Cluster.cxx.

59  {
60  fParticleId = pid;
61  }
int fParticleId
particle id flag
Definition: Cluster.h:44
void gar::rec::Cluster::setPosition ( const float *  position)

Definition at line 34 of file Cluster.cxx.

34  {
35  for(int i=0;i<3;i++) { fPosition[i] = position[i]; }
36  }
float fPosition[3]
position of the cluster in cm
Definition: Cluster.h:39
void gar::rec::Cluster::setShape ( const float *  shape)

Definition at line 54 of file Cluster.cxx.

54  {
55  for(int i=0;i<6;i++) { fShape[i] = shape[i]; }
56  }
float fShape[6]
cluster shape parameters (Ellipsoid r1, r2, r3, vol, width)
Definition: Cluster.h:40
void gar::rec::Cluster::setTime ( float  time,
float  time_diff 
)

Definition at line 28 of file Cluster.cxx.

28  {
29  fTime = time ;
31  }
float fTimeDiffFirstLast
time difference between the first and last layer of the cluster in ns
Definition: Cluster.h:38
double time_diff(rusage const &a, rusage const &b)
float fTime
time of the ecal cluster in ns
Definition: Cluster.h:37
const float * gar::rec::Cluster::Shape ( ) const
inline

Definition at line 100 of file Cluster.h.

100 { return fShape; }
float fShape[6]
cluster shape parameters (Ellipsoid r1, r2, r3, vol, width)
Definition: Cluster.h:40
float gar::rec::Cluster::Time ( ) const
inline

Definition at line 94 of file Cluster.h.

94 { return fTime; }
float fTime
time of the ecal cluster in ns
Definition: Cluster.h:37
float gar::rec::Cluster::TimeDiffFirstLast ( ) const
inline

Definition at line 95 of file Cluster.h.

95 { return fTimeDiffFirstLast; }
float fTimeDiffFirstLast
time difference between the first and last layer of the cluster in ns
Definition: Cluster.h:38
const std::vector< gar::rec::Track * > & gar::rec::Cluster::Tracks ( ) const
inline

Definition at line 102 of file Cluster.h.

102 { return fTracks; }
std::vector< gar::rec::Track * > fTracks
vector of tracks associated to the cluster
Definition: Cluster.h:45

Friends And Related Function Documentation

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

Definition at line 75 of file Cluster.cxx.

76  {
77  o << "Cluster "
78  << "\n\tEnergy = "
79  << h.Energy()
80  << "\n\tTime = "
81  << h.Time()
82  << "\n\tPID = "
83  << h.ParticleID()
84  << "\n\tID number = "
85  << h.getIDNumber()
86  << "\n\tMain EigenVector = ("
87  << h.EigenVectors()[0] << ", " << h.EigenVectors()[1] << ", " << h.EigenVectors()[2] << ")"
88  << "\n\tPosition = "
89  << h.Position()[0] << ", " << h.Position()[1] << ", " << h.Position()[2] << ")";
90 
91  return o;
92  }

Member Data Documentation

float gar::rec::Cluster::fEigenVector[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}
private

EigenVectors of the cluster corresponding to the 3 main axis sorted in ascending order (main principal axis with smallest inertial of mass) normalised to length of 1.

Definition at line 43 of file Cluster.h.

float gar::rec::Cluster::fEnergy {0}
private

energy of the ecal cluster in GeV

Definition at line 35 of file Cluster.h.

float gar::rec::Cluster::fEnergyError {0}
private

energy of the ecal cluster in GeV

Definition at line 36 of file Cluster.h.

std::vector<gar::rec::CaloHit*> gar::rec::Cluster::fHits {}
private

vector of hit contribution

Definition at line 46 of file Cluster.h.

gar::rec::IDNumber gar::rec::Cluster::fIDnumero
private

Definition at line 33 of file Cluster.h.

gar::rec::IDNumber const gar::rec::Cluster::FirstNumber = 300000
staticprivate

Definition at line 32 of file Cluster.h.

int gar::rec::Cluster::fParticleId {0}
private

particle id flag

Definition at line 44 of file Cluster.h.

float gar::rec::Cluster::fPhi {0}
private

intrasic direction of the cluster phi

Definition at line 42 of file Cluster.h.

float gar::rec::Cluster::fPosition[3] = {0, 0, 0}
private

position of the cluster in cm

Definition at line 39 of file Cluster.h.

float gar::rec::Cluster::fShape[6] = {0, 0, 0, 0, 0, 0}
private

cluster shape parameters (Ellipsoid r1, r2, r3, vol, width)

Definition at line 40 of file Cluster.h.

float gar::rec::Cluster::fTheta {0}
private

intrasic direction of the cluster theta

Definition at line 41 of file Cluster.h.

float gar::rec::Cluster::fTime {0}
private

time of the ecal cluster in ns

Definition at line 37 of file Cluster.h.

float gar::rec::Cluster::fTimeDiffFirstLast {0}
private

time difference between the first and last layer of the cluster in ns

Definition at line 38 of file Cluster.h.

std::vector<gar::rec::Track*> gar::rec::Cluster::fTracks {}
private

vector of tracks associated to the cluster

Definition at line 45 of file Cluster.h.

std::vector<float> gar::rec::Cluster::fWeights {}
private

vector of energy contribution of the hits

Definition at line 47 of file Cluster.h.


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