LArSoft  v08_16_00
Liquid Argon Software toolkit - http://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 255 of file Cluster3D.h.

Constructor & Destructor Documentation

reco::Cluster3D::Cluster3D ( )

Definition at line 240 of file Cluster3D.cxx.

240  : m_statusBits(0),
241  m_pcaResults(PrincipalComponents()),
242  m_totalCharge(0.),
243  m_startPosition{0.,0.,0.},
244  m_endPosition{0.,0.,0.},
245  m_clusterIdx(0)
246 {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:264
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:263
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:265
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:267
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:266
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:268
reco::Cluster3D::Cluster3D ( unsigned  statusBits,
const PrincipalComponents pcaResults,
float  totalCharge,
const float *  startPosition,
const float *  endPosition,
int  idx 
)

Definition at line 248 of file Cluster3D.cxx.

References m_clusterIdx, and m_endPosition.

253  :
254  m_statusBits(statusBits),
255  m_pcaResults(pcaResults),
256  m_totalCharge(totalCharge),
257  m_startPosition{startPosition[0],startPosition[1],startPosition[2]},
258  m_endPosition{endPosition[0],endPosition[1],endPosition[2]},
259  m_clusterIdx(idx)
260  {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:264
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:263
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:265
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:267
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:266
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:268

Member Function Documentation

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

Definition at line 286 of file Cluster3D.h.

References operator+(), reco::ClusterHit2D::operator<, and reco::ClusterHit2D::operator<<.

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

Definition at line 283 of file Cluster3D.h.

Referenced by reco::operator<<().

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

Definition at line 282 of file Cluster3D.h.

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

Definition at line 279 of file Cluster3D.h.

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

Definition at line 281 of file Cluster3D.h.

Referenced by reco::operator<().

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

Definition at line 278 of file Cluster3D.h.

References reco::ClusterHit2D::m_statusBits.

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

Definition at line 280 of file Cluster3D.h.

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

Definition at line 265 of file Cluster3D.cxx.

266 {
267 /*
268  // throw exception if the clusters are not from the same plane
269  if( a.View() != this->View() )
270  throw cet::exception("Cluster+operator") << "Attempting to sum clusters from "
271  << "different views is not allowed\n";
272 
273  // check the start and end positions - for now the
274  // smallest wire number means start position, largest means end position
275  std::vector<float> astart(a.StartPos());
276  std::vector<float> aend (a.EndPos() );
277  std::vector<float> start(StartPos());
278  std::vector<float> end (EndPos() );
279  std::vector<float> sigstart(SigmaStartPos());
280  std::vector<float> sigend (SigmaEndPos() );
281 
282  if(astart[0] < fStartPos[0]){
283  start = astart;
284  sigstart = a.SigmaStartPos();
285  }
286 
287  if(aend[0] > fEndPos[0]){
288  end = aend;
289  sigend = a.SigmaEndPos();
290  }
291 
292  //take weighted mean in obtaining average slope and differential charge,
293  //based on total charge each cluster
294  float dtdw = ((this->Charge()*dTdW()) + (a.Charge()*a.dTdW()))/(this->Charge() + a.Charge());
295  float dqdw = ((this->Charge()*dQdW()) + (a.Charge()*a.dQdW()))/(this->Charge() + a.Charge());
296 
297  //hits.sort();//sort the PtrVector to organize Hits of new Cluster
298  float sigdtdw = TMath::Max(SigmadTdW(), a.SigmadTdW());
299  float sigdqdw = TMath::Max(SigmadQdW(), a.SigmadQdW());
300 
301  Cluster sum(//hits,
302  start[0], sigstart[0],
303  start[1], sigstart[1],
304  end[0], sigend[0],
305  end[1], sigend[1],
306  dtdw, sigdtdw,
307  dqdw, sigdqdw,
308  this->Charge() + a.Charge(),
309  this->View(),
310  ID());
311 */
312  //return sum;
313  return a;
314 }
void reco::Cluster3D::setStatusBit ( unsigned  bits) const
inline

Definition at line 285 of file Cluster3D.h.

285 {m_statusBits |= bits;}
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:263

Friends And Related Function Documentation

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

Definition at line 339 of file Cluster3D.cxx.

340 {
341 /*
342  if(a.View() != b.View())
343  return a.View() < b.View();
344  if(a.ID() != b. ID())
345  return a.ID() < b.ID();
346  if(a.StartPos()[0] != b.StartPos()[0])
347  return a.StartPos()[0] < b.StartPos()[0];
348  if(a.EndPos()[0] != b.EndPos()[0])
349  return a.EndPos()[0] < b.EndPos()[0];
350 */
351  if (a.getStartPosition()[2] < b.getStartPosition()[2]) return true;
352 
353  return false; //They are equal
354 }
std::ostream& operator<< ( std::ostream &  o,
const Cluster3D c 
)
friend

Definition at line 319 of file Cluster3D.cxx.

320 {
321  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
322  o << "Cluster ID " << std::setw(5) << std::right << c.getClusterIdx();
323 // << " : View = " << std::setw(3) << std::right << c.View()
324 // << " StartWire = " << std::setw(7) << std::right << c.StartPos()[0]
325 // << " EndWire = " << std::setw(7) << std::right << c.EndPos()[0]
326 // << " StartTime = " << std::setw(9) << std::right << c.StartPos()[1]
327 // << " EndTime = " << std::setw(9) << std::right << c.EndPos()[1]
328 // << " dTdW = " << std::setw(9) << std::right << c.dTdW()
329 // << " dQdW = " << std::setw(9) << std::right << c.dQdW()
330 // << " Charge = " << std::setw(10) << std::right << c.Charge();
331 
332  return o;
333  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104

Member Data Documentation

int reco::Cluster3D::m_clusterIdx
private

ID for this cluster.

Definition at line 268 of file Cluster3D.h.

Referenced by Cluster3D().

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

"end" position for cluster

Definition at line 267 of file Cluster3D.h.

Referenced by Cluster3D().

PrincipalComponents reco::Cluster3D::m_pcaResults
private

Output of the prinicipal componenets analysis.

Definition at line 264 of file Cluster3D.h.

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

"start" position for cluster (world coordinates)

Definition at line 266 of file Cluster3D.h.

unsigned reco::Cluster3D::m_statusBits
mutableprivate

Default constructor.

Status bits for the cluster

Definition at line 263 of file Cluster3D.h.

float reco::Cluster3D::m_totalCharge
private

Total charge in the cluster.

Definition at line 265 of file Cluster3D.h.

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


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