@@ -45,44 +45,112 @@ using ClusterIndex = int;
4545template <class InputType >
4646class 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
0 commit comments