Public Member Functions | Private Attributes | Friends | List of all members
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 259 of file Cluster3D.h.

Constructor & Destructor Documentation

reco::Cluster3D::Cluster3D ( )

Definition at line 243 of file Cluster3D.cxx.

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

Definition at line 251 of file Cluster3D.cxx.

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

Member Function Documentation

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

Definition at line 290 of file Cluster3D.h.

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

Definition at line 287 of file Cluster3D.h.

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

Definition at line 286 of file Cluster3D.h.

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

Definition at line 283 of file Cluster3D.h.

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

Definition at line 285 of file Cluster3D.h.

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

Definition at line 282 of file Cluster3D.h.

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

Definition at line 284 of file Cluster3D.h.

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

Definition at line 268 of file Cluster3D.cxx.

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

Definition at line 289 of file Cluster3D.h.

289 {m_statusBits |= bits;}
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:267

Friends And Related Function Documentation

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

Definition at line 342 of file Cluster3D.cxx.

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

Definition at line 322 of file Cluster3D.cxx.

323 {
324  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
325  o << "Cluster ID " << std::setw(5) << std::right << c.getClusterIdx();
326 // << " : View = " << std::setw(3) << std::right << c.View()
327 // << " StartWire = " << std::setw(7) << std::right << c.StartPos()[0]
328 // << " EndWire = " << std::setw(7) << std::right << c.EndPos()[0]
329 // << " StartTime = " << std::setw(9) << std::right << c.StartPos()[1]
330 // << " EndTime = " << std::setw(9) << std::right << c.EndPos()[1]
331 // << " dTdW = " << std::setw(9) << std::right << c.dTdW()
332 // << " dQdW = " << std::setw(9) << std::right << c.dQdW()
333 // << " Charge = " << std::setw(10) << std::right << c.Charge();
334 
335  return o;
336  }
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331

Member Data Documentation

int reco::Cluster3D::m_clusterIdx
private

ID for this cluster.

Definition at line 272 of file Cluster3D.h.

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

"end" position for cluster

Definition at line 271 of file Cluster3D.h.

PrincipalComponents reco::Cluster3D::m_pcaResults
private

Output of the prinicipal componenets analysis.

Definition at line 268 of file Cluster3D.h.

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

"start" position for cluster (world coordinates)

Definition at line 270 of file Cluster3D.h.

unsigned reco::Cluster3D::m_statusBits
mutableprivate

Default constructor.

Status bits for the cluster

Definition at line 267 of file Cluster3D.h.

float reco::Cluster3D::m_totalCharge
private

Total charge in the cluster.

Definition at line 269 of file Cluster3D.h.


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