Skip to content

Commit ae049ca

Browse files
mfasDashahor02
authored andcommitted
[EMCAL-623, EMCAL-505] Fix doxygen in clusterizer
- Move existing documentation from cxx to header file, like this it can be also used by modern IDEs - Add documentation of parameters and return values missing so far
1 parent cb98b7e commit ae049ca

2 files changed

Lines changed: 75 additions & 20 deletions

File tree

Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Clusterizer.h

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,112 @@ using ClusterIndex = int;
4545
template <class InputType>
4646
class Clusterizer
4747
{
48+
/// \struct cellWithE
49+
/// \brief Wrapper structure to make cell sortable in energy
4850
struct cellWithE {
51+
52+
/// \brief Constructor
4953
cellWithE() : energy(0.), row(0), column(0) {}
54+
55+
/// \brief Constructor
56+
/// \param e Energy (in GeV)
57+
/// \param r Row number
58+
/// \param c Column number
5059
cellWithE(float e, int r, int c) : energy(e), row(r), column(c) {}
51-
// std::sort will require operator< to compile.
60+
61+
/// \brief Comparison lower operator comparing cells based on energy
62+
///
63+
/// std::sort will require operator< to compile.
64+
///
65+
/// \param rhs Cell to compare to
66+
/// \return True if this cell is has a lower energy, false otherwise
5267
bool operator<(cellWithE const& rhs) const
5368
{
5469
return energy < rhs.energy;
5570
}
56-
float energy;
57-
int row;
58-
int column;
71+
72+
float energy; ///< Energy (in GeV)
73+
int row; ///< Row number
74+
int column; ///< Column number
5975
};
6076

77+
/// \struct InputwithIndex
78+
/// \brief Link of a cell object to a cluster index
6179
struct InputwithIndex {
62-
const InputType* mInput;
63-
ClusterIndex mIndex;
80+
const InputType* mInput; ///< Input cell/digit object
81+
ClusterIndex mIndex; ///< index of the cluster
6482
};
6583

6684
public:
85+
/// \brief Main constructor
86+
/// \param timeCut Max. time difference of cells in cluster in ns
87+
/// \param timeMin Min. accepted cell time in ns
88+
/// \param timeMax Max. accepted cell time in ns
89+
/// \param gradientCut Min. gradient value allowed in cluster splitting
90+
/// \param doEnergyGradientCut Apply gradient cut
91+
/// \param thresholdSeedE Min. energy of seed cells in GeV
92+
/// \param thresholdCellE Min. energy of associated cells in GeV
6793
Clusterizer(double timeCut, double timeMin, double timeMax, double gradientCut, bool doEnergyGradientCut, double thresholdSeedE, double thresholdCellE);
94+
95+
/// \brief Default constructor
6896
Clusterizer();
97+
98+
/// \brief Destructor
6999
~Clusterizer() = default;
70100

101+
/// \brief Clear internal buffers of found clusters and cell indices
71102
void clear()
72103
{
73104
mFoundClusters.clear();
74105
mInputIndices.clear();
75106
}
107+
108+
/// \brief Initialize class member vars if not done in constructor
109+
/// \param timeCut Max. time difference of cells in cluster in ns
110+
/// \param timeMin Min. accepted cell time in ns
111+
/// \param timeMax Max. accepted cell time in ns
112+
/// \param gradientCut Min. gradient value allowed in cluster splitting
113+
/// \param doEnergyGradientCut Apply gradient cut
114+
/// \param thresholdSeedE Min. energy of seed cells in GeV
115+
/// \param thresholdCellE Min. energy of associated cells in GeV
76116
void initialize(double timeCut, double timeMin, double timeMax, double gradientCut, bool doEnergyGradientCut, double thresholdSeedE, double thresholdCellE);
117+
118+
/// \brief Find clusters based on a give input collection.
119+
///
120+
/// Start clustering from highest energy cell.
121+
///
122+
/// \param inputArray Input collection of cells/digits
77123
void findClusters(const gsl::span<InputType const>& inputArray);
124+
125+
/// \brief Get list of found clusters
126+
/// \return List of found clusters
78127
const std::vector<Cluster>* getFoundClusters() const { return &mFoundClusters; }
128+
129+
/// \brief Get list of found cell indices
130+
/// \return List of found cell indices
79131
const std::vector<ClusterIndex>* getFoundClustersInputIndices() const { return &mInputIndices; }
132+
133+
/// \brief Set EMCAL geometry
134+
/// \param geometry Geometry pointer
80135
void setGeometry(Geometry* geometry) { mEMCALGeometry = geometry; }
136+
137+
/// \brief Get pointer to geometry
138+
/// \return EMCAL geometry
81139
Geometry* getGeometry() { return mEMCALGeometry; }
82140

83141
private:
84-
void getClusterFromNeighbours(std::vector<InputwithIndex>& clusterUnputs, int row, int column);
142+
/// \brief Recursively search for neighbours (EMCAL)
143+
/// \param[in,out] clusterInputs Cells/digits of prototype cluster
144+
/// \param row Row number from neighbor search in recursion step
145+
/// \param column Column number for neighbor search in recursion step
146+
void getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column);
147+
148+
/// \brief Get row (phi) and column (eta) of a cell/digit, values corresponding to topology
149+
/// \param input Input object (cell/digit)
150+
/// \param[out] row Topological row
151+
/// \param[out] column Topological column
85152
void getTopologicalRowColumn(const InputType& input, int& row, int& column);
153+
86154
Geometry* mEMCALGeometry = nullptr; //!<! pointer to geometry for utilities
87155
std::array<cellWithE, NROWS * NCOLS> mSeedList; //!<! seed array
88156
std::array<std::array<InputwithIndex, NCOLS>, NROWS> mInputMap; //!<! topology arrays

Detectors/EMCAL/reconstruction/src/Clusterizer.cxx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,18 @@
1818

1919
using namespace o2::emcal;
2020

21-
///
22-
/// Constructor
2321
//____________________________________________________________________________
2422
template <class InputType>
2523
Clusterizer<InputType>::Clusterizer(double timeCut, double timeMin, double timeMax, double gradientCut, bool doEnergyGradientCut, double thresholdSeedE, double thresholdCellE) : mSeedList(), mInputMap(), mCellMask(), mTimeCut(timeCut), mTimeMin(timeMin), mTimeMax(timeMax), mGradientCut(gradientCut), mDoEnergyGradientCut(doEnergyGradientCut), mThresholdSeedEnergy(thresholdSeedE), mThresholdCellEnergy(thresholdCellE)
2624
{
2725
}
2826

29-
///
30-
/// Default constructor
3127
//____________________________________________________________________________
3228
template <class InputType>
3329
Clusterizer<InputType>::Clusterizer() : mSeedList(), mInputMap(), mCellMask(), mTimeCut(0), mTimeMin(0), mTimeMax(0), mGradientCut(0), mDoEnergyGradientCut(false), mThresholdSeedEnergy(0), mThresholdCellEnergy(0)
3430
{
3531
}
3632

37-
///
38-
/// Initialize class member vars if not done in constructor
3933
//____________________________________________________________________________
4034
template <class InputType>
4135
void Clusterizer<InputType>::initialize(double timeCut, double timeMin, double timeMax, double gradientCut, bool doEnergyGradientCut, double thresholdSeedE, double thresholdCellE)
@@ -49,8 +43,6 @@ void Clusterizer<InputType>::initialize(double timeCut, double timeMin, double t
4943
mThresholdCellEnergy = thresholdCellE;
5044
}
5145

52-
///
53-
/// Recursively search for neighbours (EMCAL)
5446
//____________________________________________________________________________
5547
template <class InputType>
5648
void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column)
@@ -88,9 +80,6 @@ void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex
8880
}
8981
}
9082

91-
///
92-
/// Get row (phi) and column (eta) of a cell/digit, values corresponding to topology
93-
///
9483
//____________________________________________________________________________
9584
template <class InputType>
9685
void Clusterizer<InputType>::getTopologicalRowColumn(const InputType& input, int& row, int& column)
@@ -119,8 +108,6 @@ void Clusterizer<InputType>::getTopologicalRowColumn(const InputType& input, int
119108
}
120109
}
121110

122-
///
123-
/// Return number of found clusters. Start clustering from highest energy cell.
124111
//____________________________________________________________________________
125112
template <class InputType>
126113
void Clusterizer<InputType>::findClusters(const gsl::span<InputType const>& inputArray)

0 commit comments

Comments
 (0)