LArSoft  v08_09_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 251 of file Cluster3D.h.

Constructor & Destructor Documentation

reco::Cluster3D::Cluster3D ( )

Definition at line 234 of file Cluster3D.cxx.

234  : m_statusBits(0),
235  m_pcaResults(PrincipalComponents()),
236  m_totalCharge(0.),
237  m_startPosition{0.,0.,0.},
238  m_endPosition{0.,0.,0.},
239  m_clusterIdx(0)
240 {}
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 242 of file Cluster3D.cxx.

References m_clusterIdx, and m_endPosition.

247  :
248  m_statusBits(statusBits),
249  m_pcaResults(pcaResults),
250  m_totalCharge(totalCharge),
251  m_startPosition{startPosition[0],startPosition[1],startPosition[2]},
252  m_endPosition{endPosition[0],endPosition[1],endPosition[2]},
253  m_clusterIdx(idx)
254  {}
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+(), reco::ClusterHit2D::operator<, and reco::ClusterHit2D::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.

References reco::ClusterHit2D::m_statusBits.

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 259 of file Cluster3D.cxx.

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

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

Definition at line 313 of file Cluster3D.cxx.

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

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: