LArSoft  v07_01_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 241 of file Cluster3D.h.

Constructor & Destructor Documentation

reco::Cluster3D::Cluster3D ( )

Definition at line 232 of file Cluster3D.cxx.

232  : m_statusBits(0),
233  m_pcaResults(PrincipalComponents()),
234  m_totalCharge(0.),
235  m_startPosition{0.,0.,0.},
236  m_endPosition{0.,0.,0.},
237  m_clusterIdx(0)
238 {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:250
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:249
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:251
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:253
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:252
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:254
reco::Cluster3D::Cluster3D ( unsigned  statusBits,
const PrincipalComponents pcaResults,
float  totalCharge,
const float *  startPosition,
const float *  endPosition,
int  idx 
)

Definition at line 240 of file Cluster3D.cxx.

References m_clusterIdx, and m_endPosition.

245  :
246  m_statusBits(statusBits),
247  m_pcaResults(pcaResults),
248  m_totalCharge(totalCharge),
249  m_startPosition{startPosition[0],startPosition[1],startPosition[2]},
250  m_endPosition{endPosition[0],endPosition[1],endPosition[2]},
251  m_clusterIdx(idx)
252  {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:250
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:249
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:251
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:253
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:252
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:254

Member Function Documentation

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

Definition at line 272 of file Cluster3D.h.

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

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

Definition at line 269 of file Cluster3D.h.

Referenced by reco::operator<<().

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

Definition at line 268 of file Cluster3D.h.

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

Definition at line 265 of file Cluster3D.h.

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

Definition at line 267 of file Cluster3D.h.

Referenced by reco::operator<().

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

Definition at line 264 of file Cluster3D.h.

References reco::ClusterHit2D::m_statusBits.

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

Definition at line 266 of file Cluster3D.h.

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

Definition at line 257 of file Cluster3D.cxx.

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

Definition at line 271 of file Cluster3D.h.

271 {m_statusBits |= bits;}
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:249

Friends And Related Function Documentation

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

Definition at line 331 of file Cluster3D.cxx.

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

Definition at line 311 of file Cluster3D.cxx.

312 {
313  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
314  o << "Cluster ID " << std::setw(5) << std::right << c.getClusterIdx();
315 // << " : View = " << std::setw(3) << std::right << c.View()
316 // << " StartWire = " << std::setw(7) << std::right << c.StartPos()[0]
317 // << " EndWire = " << std::setw(7) << std::right << c.EndPos()[0]
318 // << " StartTime = " << std::setw(9) << std::right << c.StartPos()[1]
319 // << " EndTime = " << std::setw(9) << std::right << c.EndPos()[1]
320 // << " dTdW = " << std::setw(9) << std::right << c.dTdW()
321 // << " dQdW = " << std::setw(9) << std::right << c.dQdW()
322 // << " Charge = " << std::setw(10) << std::right << c.Charge();
323 
324  return o;
325  }
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 254 of file Cluster3D.h.

Referenced by Cluster3D().

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

"end" position for cluster

Definition at line 253 of file Cluster3D.h.

Referenced by Cluster3D().

PrincipalComponents reco::Cluster3D::m_pcaResults
private

Output of the prinicipal componenets analysis.

Definition at line 250 of file Cluster3D.h.

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

"start" position for cluster (world coordinates)

Definition at line 252 of file Cluster3D.h.

unsigned reco::Cluster3D::m_statusBits
mutableprivate

Default constructor.

Status bits for the cluster

Definition at line 249 of file Cluster3D.h.

float reco::Cluster3D::m_totalCharge
private

Total charge in the cluster.

Definition at line 251 of file Cluster3D.h.

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


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