LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
reco::Cluster3D Class Reference

#include "Cluster3D.h"

Public Member Functions

 Cluster3D ()
 
 Cluster3D (unsigned statusBits, const PrincipalComponents &pcaResults, float totalCharge, const float *startPosition, const float *endPosition, int idx)
 
unsigned getStatusBits () const
 
const PrincipalComponentsgetPcaResults () const
 
float getTotalCharge () const
 
const float * getStartPosition () const
 
const float * getEndPosition () const
 
int getClusterIdx () const
 
void setStatusBit (unsigned bits) const
 
void clearStatusBits (unsigned bits) const
 
Cluster3D operator+ (Cluster3D)
 

Private Attributes

unsigned m_statusBits
 Default constructor. More...
 
PrincipalComponents m_pcaResults
 Output of the prinicipal componenets analysis. More...
 
float m_totalCharge
 Total charge in the cluster. More...
 
float m_startPosition [3]
 "start" position for cluster (world coordinates) More...
 
float m_endPosition [3]
 "end" position for cluster More...
 
int m_clusterIdx
 ID for this cluster. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const Cluster3D &c)
 
bool operator< (const Cluster3D &a, const Cluster3D &b)
 

Detailed Description

Definition at line 254 of file Cluster3D.h.

Constructor & Destructor Documentation

reco::Cluster3D::Cluster3D ( )

Definition at line 269 of file Cluster3D.cxx.

270  : m_statusBits(0)
271  , m_pcaResults(PrincipalComponents())
272  , m_totalCharge(0.)
273  , m_startPosition{0., 0., 0.}
274  , m_endPosition{0., 0., 0.}
275  , m_clusterIdx(0)
276  {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:260
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:259
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:261
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:263
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:262
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:264
reco::Cluster3D::Cluster3D ( unsigned  statusBits,
const PrincipalComponents pcaResults,
float  totalCharge,
const float *  startPosition,
const float *  endPosition,
int  idx 
)

Definition at line 278 of file Cluster3D.cxx.

References m_clusterIdx, and m_endPosition.

284  : m_statusBits(statusBits)
285  , m_pcaResults(pcaResults)
286  , m_totalCharge(totalCharge)
287  , m_startPosition{startPosition[0], startPosition[1], startPosition[2]}
288  , m_endPosition{endPosition[0], endPosition[1], endPosition[2]}
289  , m_clusterIdx(idx)
290  {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:260
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:259
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:261
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:263
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:262
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:264

Member Function Documentation

void reco::Cluster3D::clearStatusBits ( unsigned  bits) const
inline

Definition at line 282 of file Cluster3D.h.

References operator+(), recob::operator<(), and recob::operator<<().

282 { m_statusBits &= ~bits; }
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:259
int reco::Cluster3D::getClusterIdx ( ) const
inline

Definition at line 279 of file Cluster3D.h.

Referenced by reco::operator<<().

279 { return m_clusterIdx; }
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:264
const float* reco::Cluster3D::getEndPosition ( ) const
inline

Definition at line 278 of file Cluster3D.h.

278 { return m_endPosition; }
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:263
const PrincipalComponents& reco::Cluster3D::getPcaResults ( ) const
inline

Definition at line 275 of file Cluster3D.h.

275 { return m_pcaResults; }
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:260
const float* reco::Cluster3D::getStartPosition ( ) const
inline

Definition at line 277 of file Cluster3D.h.

Referenced by reco::operator<().

277 { return m_startPosition; }
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:262
unsigned reco::Cluster3D::getStatusBits ( ) const
inline

Definition at line 274 of file Cluster3D.h.

274 { return m_statusBits; }
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:259
float reco::Cluster3D::getTotalCharge ( ) const
inline

Definition at line 276 of file Cluster3D.h.

276 { return m_totalCharge; }
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:261
Cluster3D reco::Cluster3D::operator+ ( Cluster3D  a)

Definition at line 295 of file Cluster3D.cxx.

296  {
297  /*
298  // throw exception if the clusters are not from the same plane
299  if( a.View() != this->View() )
300  throw cet::exception("Cluster+operator") << "Attempting to sum clusters from "
301  << "different views is not allowed\n";
302 
303  // check the start and end positions - for now the
304  // smallest wire number means start position, largest means end position
305  std::vector<float> astart(a.StartPos());
306  std::vector<float> aend (a.EndPos() );
307  std::vector<float> start(StartPos());
308  std::vector<float> end (EndPos() );
309  std::vector<float> sigstart(SigmaStartPos());
310  std::vector<float> sigend (SigmaEndPos() );
311 
312  if(astart[0] < fStartPos[0]){
313  start = astart;
314  sigstart = a.SigmaStartPos();
315  }
316 
317  if(aend[0] > fEndPos[0]){
318  end = aend;
319  sigend = a.SigmaEndPos();
320  }
321 
322  //take weighted mean in obtaining average slope and differential charge,
323  //based on total charge each cluster
324  float dtdw = ((this->Charge()*dTdW()) + (a.Charge()*a.dTdW()))/(this->Charge() + a.Charge());
325  float dqdw = ((this->Charge()*dQdW()) + (a.Charge()*a.dQdW()))/(this->Charge() + a.Charge());
326 
327  //hits.sort();//sort the PtrVector to organize Hits of new Cluster
328  float sigdtdw = TMath::Max(SigmadTdW(), a.SigmadTdW());
329  float sigdqdw = TMath::Max(SigmadQdW(), a.SigmadQdW());
330 
331  Cluster sum(//hits,
332  start[0], sigstart[0],
333  start[1], sigstart[1],
334  end[0], sigend[0],
335  end[1], sigend[1],
336  dtdw, sigdtdw,
337  dqdw, sigdqdw,
338  this->Charge() + a.Charge(),
339  this->View(),
340  ID());
341 */
342  //return sum;
343  return a;
344  }
void reco::Cluster3D::setStatusBit ( unsigned  bits) const
inline

Definition at line 281 of file Cluster3D.h.

281 { m_statusBits |= bits; }
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:259

Friends And Related Function Documentation

bool operator< ( const Cluster3D a,
const Cluster3D b 
)
friend

Definition at line 368 of file Cluster3D.cxx.

369  {
370  /*
371  if(a.View() != b.View())
372  return a.View() < b.View();
373  if(a.ID() != b. ID())
374  return a.ID() < b.ID();
375  if(a.StartPos()[0] != b.StartPos()[0])
376  return a.StartPos()[0] < b.StartPos()[0];
377  if(a.EndPos()[0] != b.EndPos()[0])
378  return a.EndPos()[0] < b.EndPos()[0];
379 */
380  if (a.getStartPosition()[2] < b.getStartPosition()[2]) return true;
381 
382  return false; //They are equal
383  }
std::ostream& operator<< ( std::ostream &  o,
const Cluster3D c 
)
friend

Definition at line 349 of file Cluster3D.cxx.

350  {
351  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
352  o << "Cluster ID " << std::setw(5) << std::right << c.getClusterIdx();
353  // << " : View = " << std::setw(3) << std::right << c.View()
354  // << " StartWire = " << std::setw(7) << std::right << c.StartPos()[0]
355  // << " EndWire = " << std::setw(7) << std::right << c.EndPos()[0]
356  // << " StartTime = " << std::setw(9) << std::right << c.StartPos()[1]
357  // << " EndTime = " << std::setw(9) << std::right << c.EndPos()[1]
358  // << " dTdW = " << std::setw(9) << std::right << c.dTdW()
359  // << " dQdW = " << std::setw(9) << std::right << c.dQdW()
360  // << " Charge = " << std::setw(10) << std::right << c.Charge();
361 
362  return o;
363  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102

Member Data Documentation

int reco::Cluster3D::m_clusterIdx
private

ID for this cluster.

Definition at line 264 of file Cluster3D.h.

Referenced by Cluster3D().

float reco::Cluster3D::m_endPosition[3]
private

"end" position for cluster

Definition at line 263 of file Cluster3D.h.

Referenced by Cluster3D().

PrincipalComponents reco::Cluster3D::m_pcaResults
private

Output of the prinicipal componenets analysis.

Definition at line 260 of file Cluster3D.h.

float reco::Cluster3D::m_startPosition[3]
private

"start" position for cluster (world coordinates)

Definition at line 262 of file Cluster3D.h.

unsigned reco::Cluster3D::m_statusBits
mutableprivate

Default constructor.

Status bits for the cluster

Definition at line 259 of file Cluster3D.h.

float reco::Cluster3D::m_totalCharge
private

Total charge in the cluster.

Definition at line 261 of file Cluster3D.h.

Referenced by reco::RecobClusterParameters::UpdateParameters().


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