PandaRoot
PndFTSCAClusterData Class Reference

#include <PndFTSCAClusterData.h>

Public Member Functions

 PndFTSCAClusterData (const PndFTSCAGBHit *hits, int *offset, int numberOfClusters)
 
 PndFTSCAClusterData ()
 
void readEvent (const PndFTSArray< PndFTSSpacePointData *> &clusters, int numberOfClusters, double ClusterZCut)
 
void readEvent (const PndFTSCAGBHit *hits, int *offset, int numberOfClusters)
 
void Merge (int index1, int index2)
 
int Slice () const
 
int FirstRow () const
 
int LastRow () const
 
int NumberOfClusters () const
 
int NumberOfClusters (unsigned int rowIndex) const
 
int RowOffset (unsigned int rowIndex) const
 
float X (int index) const
 
float Y (int index) const
 
float Z (int index) const
 
int Id (int index) const
 
int RowNumber (int index) const
 

Detailed Description

Cluster data which keeps history about changes

The algorithm doesn't work on this data. Instead the PndFTSCASliceData is created from this.

Definition at line 37 of file PndFTSCAClusterData.h.

Constructor & Destructor Documentation

◆ PndFTSCAClusterData() [1/2]

PndFTSCAClusterData::PndFTSCAClusterData ( const PndFTSCAGBHit hits,
int *  offset,
int  numberOfClusters 
)
inline

Construct PndFTSCAClusterData object from GBHit array.

Definition at line 42 of file PndFTSCAClusterData.h.

References readEvent().

42 { readEvent(hits, offset, numberOfClusters); }
void readEvent(const PndFTSArray< PndFTSSpacePointData *> &clusters, int numberOfClusters, double ClusterZCut)

◆ PndFTSCAClusterData() [2/2]

PndFTSCAClusterData::PndFTSCAClusterData ( )
inline

Definition at line 44 of file PndFTSCAClusterData.h.

References Merge(), and readEvent().

44 {}

Member Function Documentation

◆ FirstRow()

int PndFTSCAClusterData::FirstRow ( ) const
inline

The first row index that contains a cluster.

Definition at line 69 of file PndFTSCAClusterData.h.

69 { return fFirstRow; }

◆ Id()

int PndFTSCAClusterData::Id ( int  index) const
inline

Return the global ID of the given cluster.

Definition at line 131 of file PndFTSCAClusterData.h.

132  {
133  assert(index < static_cast<int>(fData.size()));
134  return fData[index].fId;
135  }

◆ LastRow()

int PndFTSCAClusterData::LastRow ( ) const
inline

The last row index that contains a cluster.

Definition at line 74 of file PndFTSCAClusterData.h.

74 { return fLastRow; }

◆ Merge()

void PndFTSCAClusterData::Merge ( int  index1,
int  index2 
)

"remove" two clusters and "add" a new one, keeping history.

Referenced by PndFTSCAClusterData().

◆ NumberOfClusters() [1/2]

int PndFTSCAClusterData::NumberOfClusters ( ) const
inline

Return the number of clusters in this slice.

Definition at line 79 of file PndFTSCAClusterData.h.

79 { return fData.size(); }

◆ NumberOfClusters() [2/2]

int PndFTSCAClusterData::NumberOfClusters ( unsigned int  rowIndex) const
inline

Return the number of clusters in the given row, for this slice.

Definition at line 84 of file PndFTSCAClusterData.h.

84 { return rowIndex < fNumberOfClusters.size() ? fNumberOfClusters[rowIndex] : 0; }

◆ readEvent() [1/2]

void PndFTSCAClusterData::readEvent ( const PndFTSArray< PndFTSSpacePointData *> &  clusters,
int  numberOfClusters,
double  ClusterZCut 
)

Referenced by PndFTSCAClusterData().

◆ readEvent() [2/2]

void PndFTSCAClusterData::readEvent ( const PndFTSCAGBHit hits,
int *  offset,
int  numberOfClusters 
)

◆ RowNumber()

int PndFTSCAClusterData::RowNumber ( int  index) const
inline

Return the row number/index of the given cluster.

Definition at line 140 of file PndFTSCAClusterData.h.

141  {
142  assert(index < static_cast<int>(fData.size()));
143  return fData[index].fRow;
144  }

◆ RowOffset()

int PndFTSCAClusterData::RowOffset ( unsigned int  rowIndex) const
inline

Return the index of the first cluster in the given row.

Supports calls with rowIndex greater than the available number of rows. In that case it returns NumberOfClusters.

To iterate over the clusters in one row do:

const int lastClusterIndex = cd.RowOffset( rowIndex + 1 );
for ( int hitIndex = cd.RowOffset( rowIndex ); hitIndex < lastClusterIndex; ++hitIndex )

Definition at line 99 of file PndFTSCAClusterData.h.

99 { return rowIndex < fRowOffset.size() ? fRowOffset[rowIndex] : fData.size(); }

◆ Slice()

int PndFTSCAClusterData::Slice ( ) const
inline

"remove" one cluster and "add" two new ones, keeping history. The slice index this data belongs to

Definition at line 64 of file PndFTSCAClusterData.h.

64 { return fSlice; }

◆ X()

float PndFTSCAClusterData::X ( int  index) const
inline

Return the x coordinate of the given cluster.

Definition at line 104 of file PndFTSCAClusterData.h.

105  {
106  assert(index < static_cast<int>(fData.size()));
107  return fData[index].fX;
108  }

◆ Y()

float PndFTSCAClusterData::Y ( int  index) const
inline

Return the y coordinate of the given cluster.

Definition at line 113 of file PndFTSCAClusterData.h.

114  {
115  assert(index < static_cast<int>(fData.size()));
116  return fData[index].fY;
117  }

◆ Z()

float PndFTSCAClusterData::Z ( int  index) const
inline

Return the z coordinate of the given cluster.

Definition at line 122 of file PndFTSCAClusterData.h.

123  {
124  assert(index < static_cast<int>(fData.size()));
125  return fData[index].fZ;
126  }

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