17#include <fairlogger/Logger.h>
37 mElementList.emplace_back(digitIndex, energy,
x,
z,
label);
55 std::vector<CluElement>::iterator itEl = mElementList.begin();
56 while (itEl != mElementList.end()) {
57 if ((*itEl).energy < threshold) {
58 itEl = mElementList.erase(itEl);
74 auto it = mElementList.begin();
75 while (it != mElementList.end()) {
76 bool hasNeighbours =
false;
77 for (
auto jt = mElementList.begin(); jt != mElementList.end(); ++jt) {
87 it = mElementList.erase(it);
95 mEnergy = mElementList[0].energy;
118 for (
auto it : mElementList) {
139 std::unique_ptr<bool[]> isLocalMax = std::make_unique<bool[]>(
mMulDigit);
143 isLocalMax[
i] =
true;
145 isLocalMax[
i] =
false;
150 for (
int j =
i;
j--;) {
153 if (mElementList[
i].energy > mElementList[
j].energy) {
154 isLocalMax[
j] =
false;
156 if (mElementList[
j].energy > mElementList[
i].energy - locMaxCut) {
157 isLocalMax[
i] =
false;
160 isLocalMax[
i] =
false;
162 if (mElementList[
i].energy > mElementList[
j].energy - locMaxCut) {
163 isLocalMax[
j] =
false;
170 unsigned int iDigitN = 0;
175 if (iDigitN >= maxAt.size()) {
176 static int nAlarms = 0;
178 LOG(warning) <<
"Too many local maxima, cluster multiplicity " <<
mMulDigit;
static const CPVSimParams & Instance()
Contains CPV cluster parameters.
unsigned char mMulDigit
Digit nultiplicity.
float mLocalPosX
Center of gravity position in local module coordunates (phi direction)
char mModule
Module number.
float mEnergy
full energy of a cluster
float mLocalPosZ
Center of gravity position in local module coordunates (z direction)
CPV cluster implementation.
char getNumberOfLocalMax(gsl::span< int > maxAt) const
void addDigit(short digitAbsId, float energy, int label)
Method to add digit to a cluster.
static short absIdToModule(unsigned short absId)
static short areNeighbours(unsigned short absId1, unsigned short absId2)
static void absIdToRelPosInModule(unsigned short absId, float &x, float &z)
GLuint GLsizei const GLchar * label
GLubyte GLubyte GLubyte GLubyte w
GLdouble GLdouble GLdouble z
float mLocalMaximumCut
Threshold to separate local maxima.
float mDigitMinEnergy
Minimal amplitude of a digit to be used in cluster.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"