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

#include <TPCCluster.h>

Public Member Functions

 TPCCluster ()
 
 TPCCluster (const float sig, const float *pos, const float startT, const float endT, const float Time, const float RMS, const float *cov)
 
bool operator== (const TPCCluster &rhs) const
 
bool operator!= (const TPCCluster &rhs) const
 
gar::rec::IDNumber getIDNumber () const
 
const float * Position () const
 
float const & Signal () const
 
float StartTime () const
 
float EndTime () const
 
float Time () const
 
float RMS () const
 
const float * CovMatPacked () const
 
void operator+= (gar::rec::TPCCluster const &h)
 

Private Attributes

gar::rec::IDNumber fIDnumero
 
float fSignal
 size of the signal for this TPCCluster (integral of ADC values) More...
 
float fPosition [3]
 position of the TPCCluster More...
 
float fTime
 time of TPCCluster charge arrival at the readout plane (ticks) More...
 
float fStartTime
 start time of the TPCCluster (ticks) More...
 
float fEndTime
 end time of the TPCCluster (ticks) More...
 
float fRMS
 TPCCluster width calculated with RMS (in ticks) More...
 
float fCovMat [6]
 packed covariance matrix, assuming symmetry. xx, xy, xz, yy, yz, zz More...
 

Static Private Attributes

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

Friends

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

Detailed Description

Definition at line 16 of file TPCCluster.h.

Constructor & Destructor Documentation

gar::rec::TPCCluster::TPCCluster ( )

Definition at line 15 of file TPCCluster.cxx.

16  {
19  return;
20  }
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
Definition: IDNumberGen.cxx:18
gar::rec::IDNumber fIDnumero
Definition: TPCCluster.h:25
static gar::rec::IDNumber const FirstNumber
Definition: TPCCluster.h:24
gar::rec::TPCCluster::TPCCluster ( const float  sig,
const float *  pos,
const float  startT,
const float  endT,
const float  Time,
const float  RMS,
const float *  cov 
)

Definition at line 37 of file TPCCluster.cxx.

44  : fSignal (sig )
45  , fTime (Time )
46  , fStartTime(startT)
47  , fEndTime (endT )
48  , fRMS (RMS )
49  {
52 
53  fPosition[0] = pos[0];
54  fPosition[1] = pos[1];
55  fPosition[2] = pos[2];
56  for (size_t i=0; i<6; ++i)
57  {
58  fCovMat[i] = cov[i];
59  }
60 
61  return;
62  }
float fSignal
size of the signal for this TPCCluster (integral of ADC values)
Definition: TPCCluster.h:27
float fStartTime
start time of the TPCCluster (ticks)
Definition: TPCCluster.h:30
float fRMS
TPCCluster width calculated with RMS (in ticks)
Definition: TPCCluster.h:32
float fCovMat[6]
packed covariance matrix, assuming symmetry. xx, xy, xz, yy, yz, zz
Definition: TPCCluster.h:33
float fEndTime
end time of the TPCCluster (ticks)
Definition: TPCCluster.h:31
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
Definition: IDNumberGen.cxx:18
float fTime
time of TPCCluster charge arrival at the readout plane (ticks)
Definition: TPCCluster.h:29
gar::rec::IDNumber fIDnumero
Definition: TPCCluster.h:25
float fPosition[3]
position of the TPCCluster
Definition: TPCCluster.h:28
static gar::rec::IDNumber const FirstNumber
Definition: TPCCluster.h:24
float RMS() const
Definition: TPCCluster.h:72
float Time() const
Definition: TPCCluster.h:73

Member Function Documentation

const float * gar::rec::TPCCluster::CovMatPacked ( ) const
inline

Definition at line 74 of file TPCCluster.h.

74 { return &fCovMat[0]; }
float fCovMat[6]
packed covariance matrix, assuming symmetry. xx, xy, xz, yy, yz, zz
Definition: TPCCluster.h:33
float gar::rec::TPCCluster::EndTime ( ) const
inline

Definition at line 71 of file TPCCluster.h.

71 { return fEndTime; }
float fEndTime
end time of the TPCCluster (ticks)
Definition: TPCCluster.h:31
gar::rec::IDNumber gar::rec::TPCCluster::getIDNumber ( ) const

Definition at line 32 of file TPCCluster.cxx.

32 {return fIDnumero;}
gar::rec::IDNumber fIDnumero
Definition: TPCCluster.h:25
bool gar::rec::TPCCluster::operator!= ( const TPCCluster rhs) const

Definition at line 28 of file TPCCluster.cxx.

28  {
29  return (this->fIDnumero != rhs.fIDnumero);
30  }
gar::rec::IDNumber fIDnumero
Definition: TPCCluster.h:25
void gar::rec::TPCCluster::operator+= ( gar::rec::TPCCluster const &  h)

Definition at line 68 of file TPCCluster.cxx.

69  {
70 
71  // add h to this TPCCluster. Set the new position, etc to be the weighted
72  // average of the individual TPCClusters
73  float totSig = fSignal + h.Signal();
74 
75  if(totSig == 0.){
76  MF_LOG_WARNING("TPCCluster")
77  << "attempting to add two TPCClusters and neithr has any signal, bail.";
78  return;
79  }
80 
81  for(size_t i = 0; i < 3; ++i)
82  fPosition[i] = (fPosition[i] * fSignal + h.Position()[i] * h.Signal()) / totSig;
83 
84  // don't do a weighted average but just make a wider TPCCluster
85 
86  //fStartTime = (fStartTime * fSignal + h.StartTime() * h.Signal()) / totSig;
87  //fEndTime = (fEndTime * fSignal + h.EndTime() * h.Signal()) / totSig;
88 
89  fStartTime = TMath::Min(fStartTime,h.StartTime());
90  fEndTime = TMath::Max(fEndTime,h.EndTime());
91 
92  float avgtime = (fTime * fSignal + h.Time() * h.Signal()) / totSig;
93 
94  fRMS = TMath::Sqrt( (fSignal*(TMath::Sq(fTime-avgtime)+TMath::Sq(fRMS))
95  + h.Signal()*(TMath::Sq(h.Time()-avgtime)+TMath::Sq(h.RMS())))/totSig );
96 
97  fTime = avgtime;
98 
99  fSignal += h.Signal();
100 
101  return;
102  }
float fSignal
size of the signal for this TPCCluster (integral of ADC values)
Definition: TPCCluster.h:27
float fStartTime
start time of the TPCCluster (ticks)
Definition: TPCCluster.h:30
float fRMS
TPCCluster width calculated with RMS (in ticks)
Definition: TPCCluster.h:32
float fEndTime
end time of the TPCCluster (ticks)
Definition: TPCCluster.h:31
float fTime
time of TPCCluster charge arrival at the readout plane (ticks)
Definition: TPCCluster.h:29
float fPosition[3]
position of the TPCCluster
Definition: TPCCluster.h:28
#define MF_LOG_WARNING(category)
bool gar::rec::TPCCluster::operator== ( const TPCCluster rhs) const

Definition at line 24 of file TPCCluster.cxx.

24  {
25  return (this->fIDnumero == rhs.fIDnumero);
26  }
gar::rec::IDNumber fIDnumero
Definition: TPCCluster.h:25
const float * gar::rec::TPCCluster::Position ( ) const
inline

Definition at line 68 of file TPCCluster.h.

68 { return &fPosition[0]; }
float fPosition[3]
position of the TPCCluster
Definition: TPCCluster.h:28
float gar::rec::TPCCluster::RMS ( ) const
inline

Definition at line 72 of file TPCCluster.h.

72 { return fRMS; }
float fRMS
TPCCluster width calculated with RMS (in ticks)
Definition: TPCCluster.h:32
float const & gar::rec::TPCCluster::Signal ( ) const
inline

Definition at line 69 of file TPCCluster.h.

69 { return fSignal; }
float fSignal
size of the signal for this TPCCluster (integral of ADC values)
Definition: TPCCluster.h:27
float gar::rec::TPCCluster::StartTime ( ) const
inline

Definition at line 70 of file TPCCluster.h.

70 { return fStartTime; }
float fStartTime
start time of the TPCCluster (ticks)
Definition: TPCCluster.h:30
float gar::rec::TPCCluster::Time ( ) const
inline

Definition at line 73 of file TPCCluster.h.

73 { return fTime; }
float fTime
time of TPCCluster charge arrival at the readout plane (ticks)
Definition: TPCCluster.h:29

Friends And Related Function Documentation

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

Definition at line 106 of file TPCCluster.cxx.

107  {
108  const float* cov;
109  cov = h.CovMatPacked();
110  o << "TPCCluster "
111  << "\n\tID number = "
112  << h.getIDNumber()
113  << "\n\tposition = ("
114  << h.Position()[0]
115  << ", "
116  << h.Position()[1]
117  << ", "
118  << h.Position()[2]
119  << ")"
120  << "\n\tcovariance matrix = \n\t"
121  << cov[0] << "\t" << cov[1] << "\t" << cov[2] << "\n"
122  << "\t\t" << cov[3] << "\t" << cov[4] << "\n"
123  << "\t\t\t" << cov[5]
124  << "\n\tsignal = "
125  << h.Signal()
126  << "\n\tdrift direction rms = "
127  << h.RMS()
128  << "\n\tstart time: "
129  << h.StartTime()
130  << "\n\tend time: "
131  << h.EndTime();
132 
133  return o;
134  }

Member Data Documentation

float gar::rec::TPCCluster::fCovMat[6]
private

packed covariance matrix, assuming symmetry. xx, xy, xz, yy, yz, zz

Definition at line 33 of file TPCCluster.h.

float gar::rec::TPCCluster::fEndTime
private

end time of the TPCCluster (ticks)

Definition at line 31 of file TPCCluster.h.

gar::rec::IDNumber gar::rec::TPCCluster::fIDnumero
private

Definition at line 25 of file TPCCluster.h.

gar::rec::IDNumber const gar::rec::TPCCluster::FirstNumber = 100100000
staticprivate

Definition at line 24 of file TPCCluster.h.

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

position of the TPCCluster

Definition at line 28 of file TPCCluster.h.

float gar::rec::TPCCluster::fRMS
private

TPCCluster width calculated with RMS (in ticks)

Definition at line 32 of file TPCCluster.h.

float gar::rec::TPCCluster::fSignal
private

size of the signal for this TPCCluster (integral of ADC values)

Definition at line 27 of file TPCCluster.h.

float gar::rec::TPCCluster::fStartTime
private

start time of the TPCCluster (ticks)

Definition at line 30 of file TPCCluster.h.

float gar::rec::TPCCluster::fTime
private

time of TPCCluster charge arrival at the readout plane (ticks)

Definition at line 29 of file TPCCluster.h.


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