LArSoft  v06_68_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 225 of file Cluster3D.h.

Constructor & Destructor Documentation

reco::Cluster3D::Cluster3D ( )

Definition at line 175 of file Cluster3D.cxx.

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

Definition at line 183 of file Cluster3D.cxx.

References m_clusterIdx, and m_endPosition.

188  :
189  m_statusBits(statusBits),
190  m_pcaResults(pcaResults),
191  m_totalCharge(totalCharge),
192  m_startPosition{startPosition[0],startPosition[1],startPosition[2]},
193  m_endPosition{endPosition[0],endPosition[1],endPosition[2]},
194  m_clusterIdx(idx)
195  {}
PrincipalComponents m_pcaResults
Output of the prinicipal componenets analysis.
Definition: Cluster3D.h:234
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:233
float m_totalCharge
Total charge in the cluster.
Definition: Cluster3D.h:235
float m_endPosition[3]
"end" position for cluster
Definition: Cluster3D.h:237
float m_startPosition[3]
"start" position for cluster (world coordinates)
Definition: Cluster3D.h:236
int m_clusterIdx
ID for this cluster.
Definition: Cluster3D.h:238

Member Function Documentation

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

Definition at line 259 of file Cluster3D.h.

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

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

Definition at line 256 of file Cluster3D.h.

Referenced by reco::operator<<().

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

Definition at line 255 of file Cluster3D.h.

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

Definition at line 252 of file Cluster3D.h.

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

Definition at line 254 of file Cluster3D.h.

Referenced by reco::operator<().

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

Definition at line 251 of file Cluster3D.h.

References reco::ClusterHit2D::m_statusBits.

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

Definition at line 253 of file Cluster3D.h.

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

Definition at line 200 of file Cluster3D.cxx.

201 {
202 /*
203  // throw exception if the clusters are not from the same plane
204  if( a.View() != this->View() )
205  throw cet::exception("Cluster+operator") << "Attempting to sum clusters from "
206  << "different views is not allowed\n";
207 
208  // check the start and end positions - for now the
209  // smallest wire number means start position, largest means end position
210  std::vector<float> astart(a.StartPos());
211  std::vector<float> aend (a.EndPos() );
212  std::vector<float> start(StartPos());
213  std::vector<float> end (EndPos() );
214  std::vector<float> sigstart(SigmaStartPos());
215  std::vector<float> sigend (SigmaEndPos() );
216 
217  if(astart[0] < fStartPos[0]){
218  start = astart;
219  sigstart = a.SigmaStartPos();
220  }
221 
222  if(aend[0] > fEndPos[0]){
223  end = aend;
224  sigend = a.SigmaEndPos();
225  }
226 
227  //take weighted mean in obtaining average slope and differential charge,
228  //based on total charge each cluster
229  float dtdw = ((this->Charge()*dTdW()) + (a.Charge()*a.dTdW()))/(this->Charge() + a.Charge());
230  float dqdw = ((this->Charge()*dQdW()) + (a.Charge()*a.dQdW()))/(this->Charge() + a.Charge());
231 
232  //hits.sort();//sort the PtrVector to organize Hits of new Cluster
233  float sigdtdw = TMath::Max(SigmadTdW(), a.SigmadTdW());
234  float sigdqdw = TMath::Max(SigmadQdW(), a.SigmadQdW());
235 
236  Cluster sum(//hits,
237  start[0], sigstart[0],
238  start[1], sigstart[1],
239  end[0], sigend[0],
240  end[1], sigend[1],
241  dtdw, sigdtdw,
242  dqdw, sigdqdw,
243  this->Charge() + a.Charge(),
244  this->View(),
245  ID());
246 */
247  //return sum;
248  return a;
249 }
void reco::Cluster3D::setStatusBit ( unsigned  bits) const
inline

Definition at line 258 of file Cluster3D.h.

258 {m_statusBits |= bits;}
unsigned m_statusBits
Default constructor.
Definition: Cluster3D.h:233

Friends And Related Function Documentation

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

Definition at line 274 of file Cluster3D.cxx.

275 {
276 /*
277  if(a.View() != b.View())
278  return a.View() < b.View();
279  if(a.ID() != b. ID())
280  return a.ID() < b.ID();
281  if(a.StartPos()[0] != b.StartPos()[0])
282  return a.StartPos()[0] < b.StartPos()[0];
283  if(a.EndPos()[0] != b.EndPos()[0])
284  return a.EndPos()[0] < b.EndPos()[0];
285 */
286  if (a.getStartPosition()[2] < b.getStartPosition()[2]) return true;
287 
288  return false; //They are equal
289 }
std::ostream& operator<< ( std::ostream &  o,
const Cluster3D c 
)
friend

Definition at line 254 of file Cluster3D.cxx.

255 {
256  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
257  o << "Cluster ID " << std::setw(5) << std::right << c.getClusterIdx();
258 // << " : View = " << std::setw(3) << std::right << c.View()
259 // << " StartWire = " << std::setw(7) << std::right << c.StartPos()[0]
260 // << " EndWire = " << std::setw(7) << std::right << c.EndPos()[0]
261 // << " StartTime = " << std::setw(9) << std::right << c.StartPos()[1]
262 // << " EndTime = " << std::setw(9) << std::right << c.EndPos()[1]
263 // << " dTdW = " << std::setw(9) << std::right << c.dTdW()
264 // << " dQdW = " << std::setw(9) << std::right << c.dQdW()
265 // << " Charge = " << std::setw(10) << std::right << c.Charge();
266 
267  return o;
268  }
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 238 of file Cluster3D.h.

Referenced by Cluster3D().

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

"end" position for cluster

Definition at line 237 of file Cluster3D.h.

Referenced by Cluster3D().

PrincipalComponents reco::Cluster3D::m_pcaResults
private

Output of the prinicipal componenets analysis.

Definition at line 234 of file Cluster3D.h.

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

"start" position for cluster (world coordinates)

Definition at line 236 of file Cluster3D.h.

unsigned reco::Cluster3D::m_statusBits
mutableprivate

Default constructor.

Status bits for the cluster

Definition at line 233 of file Cluster3D.h.

float reco::Cluster3D::m_totalCharge
private

Total charge in the cluster.

Definition at line 235 of file Cluster3D.h.

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


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