31static int includeSinglePads = 1;
45static int nbrOfHits = 0;
47static struct Results_t {
48 std::vector<DataBlock_t> seedList;
56 for (
int i = 0;
i < clusterResults.seedList.size();
i++) {
57 delete[] clusterResults.seedList[
i].second;
59 clusterResults.seedList.clear();
68 printf(
"collectGroupMapping nPads=%d\n", nPads);
70 o2::mch::vectorCopyShort(clusterResults.padToGroups, nPads, padToMGrp);
78 clusterResults.padToGroups =
new Groups_t[nCath0 + nCath1];
79 if (cath0Grp !=
nullptr) {
80 for (
int p = 0; p < nCath0; p++) {
81 clusterResults.padToGroups[mapCath0PadIdxToPadIdx[p]] = cath0Grp[p];
84 if (cath1Grp !=
nullptr) {
85 for (
int p = 0; p < nCath1; p++) {
88 clusterResults.padToGroups[mapCath1PadIdxToPadIdx[p]] = cath1Grp[p];
98 for (
int h = 0;
h < clusterResults.seedList.size();
h++) {
99 int k = clusterResults.seedList[
h].first;
108 o2::mch::vectorSetShort(&thetaToGroup[sumK],
h + 1, k);
118 printf(
"Bad allocation for collectTheta sumK=%d greater than K=%d\n", sumK,
120 throw std::overflow_error(
"Bad Allocation");
137 const double* xyDxyi;
149 double qCutOff = 0.0;
155 printf(
"WARNING: remove noisy pads nPads=%d, <q>=%8.1f, min/max q=%8.1f, %8.1f\n",
156 nPads, vectorSum(zi_, nPads) / nPads, vectorMin(zi_, nPads),
157 vectorMax(zi_, nPads));
162 double qMax = vectorMax(zi_, nPads);
163 int nPadsTest = nPads;
167 qCutOff = ratio * qMax;
168 vectorBuildMaskGreater(zi_, qCutOff, nPads, noiseMask);
169 nPadsTest = vectorSumShort(noiseMask, nPads);
171 nNewPads = nPadsTest;
173 printf(
"WARNING: remove noisy pads qCutOff=%8.1f, nbr of kept Pads=%d/%d\n",
174 qCutOff, nNewPads, nPads);
176 xyDxyi__ =
new double[nNewPads * 4];
177 zi__ =
new double[nNewPads];
178 saturated__ =
new Mask_t[nNewPads];
179 cathi__ =
new Mask_t[nNewPads];
181 vectorGather(zi_, noiseMask, nPads, zi__);
182 vectorGatherShort(saturated_, noiseMask, nPads, saturated__);
183 vectorGatherShort(cathi_, noiseMask, nPads, cathi__);
188 saturated = saturated__;
194 saturated = saturated_;
199 cathi, saturated, chId, nPads);
204 if (nProjPads == 0) {
205 throw std::range_error(
"No projected pads !!!");
231 int nbrOfProjPadsInTheGroup = 0;
237 double* thetaEMFinal =
nullptr;
243 for (
int g = 1;
g <= nGroups;
g++) {
249 printf(
"----------------\n");
250 printf(
"Group %d/%d \n",
g, nGroups);
251 printf(
"----------------\n");
262 if ((nGroups == 1) && (originalCluster)) {
263 subCluster = &cluster;
272 printf(
"[clusterProcessing] charge= (%7.0f %2.0f) nPads=(%d, %d)\n",
280 double thetaL[nbrOfPadsInTheGroup * 5];
288 double thetaExtra[kEM * 5];
289 copyTheta(thetaL, nbrOfPadsInTheGroup, thetaExtra, kEM, kEM);
292 printTheta(
"Theta findLocalMaxWithBothCathodes", meanCharge, thetaExtra, kEM);
302 double thetaEM[kEM * 5];
303 copyTheta(thetaL, nbrOfPadsInTheGroup, thetaEM, kEM, kEM);
306 printf(
"[clusterProcessing] Find %2d PEM local maxima : \n", kEM);
307 printTheta(
"ThetaEM", meanCharge, thetaEM, kEM);
339 finalK = newSeeds.first;
343 clusterResults.seedList.push_back(newSeeds);
354 DataBlock_t newSeeds = std::make_pair(finalK,
nullptr);
355 clusterResults.seedList.push_back(newSeeds);
358 printTheta(
"ThetaFit:", meanCharge, clusterResults.seedList.back().second, clusterResults.seedList.back().first);
363 if ((nGroups != 1) || (!originalCluster)) {
378 delete[] saturated__;
Clustering and fifting parameters.
void saveThetaEMInGroupList(const double *thetaEM, int K)
void InspectModelChrono(int type, bool end)
void finalizeInspectModel()
void saveThetaExtraInGroupList(const double *thetaExtra, int K)
void savePadToCathGroup(const o2::mch::Groups_t *cath0Grp, const o2::mch::PadIdx_t *mapCath0PadIdxToPadIdx, int nCath0, const o2::mch::Groups_t *cath1Grp, const o2::mch::PadIdx_t *mapCath1PadIdxToPadIdx, int nCath1)
void saveProjectedPads(const o2::mch::Pads *pads, double *qProj)
void saveThetaFitInGroupList(const double *thetaFit, int K)
Class for time synchronization of RawReader instances.
int findLocalMaxWithBothCathodes(double *thetaOut, int kMax)
DataBlock_t fit(double *thetaInit, int K)
const Pads * getProjectedPads()
int buildProjectedGeometry(int includeAlonePads)
double * projectChargeOnProjGeometry(int includeAlonePads)
const PadIdx_t * getMapCathPadToPad(int c)
int getNbrOfPadsInGroup(int g)
const Groups_t * getCathGroup(int c)
int findLocalMaxWithPEM(double *thetaL, int nbrOfPadsInTheGroupCath)
double getTotalCharge(int c)
void storeGroupMapping(const o2::mch::Groups_t *cath0Grp, const o2::mch::PadIdx_t *mapCath0PadIdxToPadIdx, int nCath0, const o2::mch::Groups_t *cath1Grp, const o2::mch::PadIdx_t *mapCath1PadIdxToPadIdx, int nCath1)
int clusterProcess(const double *xyDxyi_, const Mask_t *cathi_, const o2::mch::Mask_t *saturated_, const double *zi_, int chId, int nPads)
std::pair< int, double * > DataBlock_t
void printTheta(const char *str, double meanCharge, const double *theta, int K)
void collectSeeds(double *theta, o2::mch::Groups_t *thetaToGroup, int K)
const double * getConstDX(const double *xyDxy, int N)
void cleanClusterResults()
void maskedCopyXYdXY(const double *xyDxy, int nxyDxy, const Mask_t *mask, int nMask, double *xyDxyMasked, int nxyDxyMasked)
void copyTheta(const double *theta0, int K0, double *theta, int K1, int K)
const double * getConstDY(const double *xyDxy, int N)
const double * getConstY(const double *xyDxy, int N)
const double * getConstX(const double *xyDxy, int N)
void deleteShort(short *ptr)
ClusterConfig clusterConfig
void collectGroupMapping(Mask_t *padToMGrp, int nPads)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
@ active
Describe default activation.
ActivateMode inspectModel
double ratioStepForLargeCluster
@ info
Describes main steps and high level behaviors.
VerboseMode inspectModelLog
VerboseMode processingLog