Project
Loading...
Searching...
No Matches
PreClusterFinder.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef O2_MCH_PRECLUSTERFINDER_H_
17#define O2_MCH_PRECLUSTERFINDER_H_
18
20#include "MCHBase/ErrorMap.h"
21#include "MCHBase/PreCluster.h"
22#include <cassert>
23#include <cstdint>
24#include <gsl/span>
25#include <memory>
26#include <unordered_map>
27#include <utility>
28#include <vector>
29#include <map>
30
31namespace o2
32{
33namespace mch
34{
35
37{
38 public:
41
46
47 void init();
48 void deinit();
49 void reset();
50
51 void loadDigits(gsl::span<const Digit> digits);
52 void loadDigit(const Digit& digit);
53
54 int discardHighOccupancy(bool perDE, bool perEvent);
55
56 int run();
57
58 void getPreClusters(std::vector<o2::mch::PreCluster>& preClusters, std::vector<Digit>& digits);
59
61 ErrorMap& getErrorMap() { return mErrorMap; }
62
63 private:
64 struct DetectionElement;
65
66 struct PreCluster {
67 uint16_t firstPad; // index of first associated pad in the orderedPads array
68 uint16_t lastPad; // index of last associated pad in the orderedPads array
69 float area[2][2]; // 2D area containing the precluster
70 bool useMe; // false if precluster already merged to another one
71 bool storeMe; // true if precluster to be saved (merging result)
72 };
73
74 void reset(int deIndex);
75
76 void preClusterizeRecursive();
77 void addPad(DetectionElement& de, uint16_t iPad, PreCluster& cluster);
78
79 int mergePreClusters();
80 void mergePreClusters(PreCluster& cluster, std::vector<std::unique_ptr<PreCluster>> preClusters[2],
81 int nPreClusters[2], DetectionElement& de, int iPlane, PreCluster*& mergedCluster);
82 PreCluster* usePreClusters(PreCluster* cluster, DetectionElement& de);
83 void mergePreClusters(PreCluster& cluster1, PreCluster& cluster2, DetectionElement& de);
84
85 bool areOverlapping(PreCluster& cluster1, PreCluster& cluster2, DetectionElement& de, float precision);
86
87 void createMapping();
88
89 static constexpr int SNDEs = 156;
90
91 std::vector<std::unique_ptr<DetectionElement>> mDEs;
92 std::unordered_map<int, int> mDEIndices{};
93
94 int mNPreClusters[SNDEs][2]{};
95 std::vector<std::unique_ptr<PreCluster>> mPreClusters[SNDEs][2]{};
96
97 ErrorMap mErrorMap{};
98};
99
100} // namespace mch
101} // namespace o2
102
103#endif // O2_MCH_PRECLUSTERFINDER_H_
Definition of the MCH precluster minimal structure.
MCH digit implementation.
Definition Digit.h:31
A container class to summarize errors encountered during processing.
Definition ErrorMap.h:38
void loadDigits(gsl::span< const Digit > digits)
void loadDigit(const Digit &digit)
int discardHighOccupancy(bool perDE, bool perEvent)
PreClusterFinder(PreClusterFinder &&)=delete
void getPreClusters(std::vector< o2::mch::PreCluster > &preClusters, std::vector< Digit > &digits)
PreClusterFinder & operator=(const PreClusterFinder &)=delete
PreClusterFinder & operator=(PreClusterFinder &&)=delete
ErrorMap & getErrorMap()
return the counting of encountered errors
PreClusterFinder(const PreClusterFinder &)=delete
GLenum GLint GLint * precision
Definition glcorearb.h:1899
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
precluster minimal structure
Definition PreCluster.h:33
uint16_t de
std::vector< Digit > digits