Project
Loading...
Searching...
No Matches
Clusterer.h
Go to the documentation of this file.
1// Copyright 2019-2026 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
14
15#ifndef ALICEO2_IOTOF_CLUSTERER_H
16#define ALICEO2_IOTOF_CLUSTERER_H
17
24#include <gsl/span>
25#include <vector>
26#include <array>
27#include <memory>
28#include <cstring>
29#include <utility>
30
31namespace o2::iotof
32{
33
34class GeometryTGeo;
35
37{
38 public:
39 static constexpr int MaxLabels = 10;
40
47
48 //----------------------------------------------
50 Clusterer* parent = nullptr;
51 // Column buffers data members in TRK, for now not needed in TF3
52
53 // Further struct members in TRK, for now not needed in TF3
54
55 std::array<Label, MaxLabels> labelsBuff;
56
57 // per-thread output (accumulated, then merged back by caller)
58 std::vector<Cluster> clusters;
59 std::vector<unsigned char> patterns;
61
62 // Further reset column buffer in TRK, not included for now in TF3
63
64 void fetchMCLabels(uint32_t digID, const ConstDigitTruth* labelsDig, int& nfilled);
65 void finishChipSingleHitFast(gsl::span<const Digit> digits, uint32_t digitIdx,
66 const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr);
67 void processChip(gsl::span<const Digit> digits, int chipFirst, int chipN,
68 std::vector<Cluster>* clustersOut, std::vector<unsigned char>* patternsOut,
69 const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr);
70
71 explicit ClustererThread(Clusterer* par = nullptr) : parent(par) {}
74 };
75 //----------------------------------------------
76
77 virtual void process(gsl::span<const Digit> digits,
78 gsl::span<const DigROFRecord> digitROFs,
79 std::vector<o2::iotof::Cluster>& clusters,
80 std::vector<unsigned char>& patterns,
81 std::vector<o2::itsmft::ROFRecord>& clusterROFs,
82 const ConstDigitTruth* digitLabels = nullptr,
83 ClusterTruth* clusterLabels = nullptr,
84 gsl::span<const DigMC2ROFRecord> digMC2ROFs = {},
85 std::vector<o2::itsmft::MC2ROFRecord>* clusterMC2ROFs = nullptr);
86
87 protected:
88 std::unique_ptr<ClustererThread> mThread;
89 std::vector<int> mSortIdx;
90};
91
92} // namespace o2::iotof
93
94#endif
A const (ready only) version of MCTruthContainer.
Definition of IOTOF digit class.
Definition of the ITSMFT ROFrame (trigger) record.
Definition of a container to keep Monte Carlo truth external to simulation objects.
virtual void process(gsl::span< const Digit > digits, gsl::span< const DigROFRecord > digitROFs, std::vector< o2::iotof::Cluster > &clusters, std::vector< unsigned char > &patterns, std::vector< o2::itsmft::ROFRecord > &clusterROFs, const ConstDigitTruth *digitLabels=nullptr, ClusterTruth *clusterLabels=nullptr, gsl::span< const DigMC2ROFRecord > digMC2ROFs={}, std::vector< o2::itsmft::MC2ROFRecord > *clusterMC2ROFs=nullptr)
Definition Clusterer.cxx:26
static constexpr int MaxLabels
Definition Clusterer.h:39
std::vector< int > mSortIdx
reusable per-ROF sort buffer
Definition Clusterer.h:89
std::unique_ptr< ClustererThread > mThread
Definition Clusterer.h:88
ClustererThread & operator=(const ClustererThread &)=delete
std::vector< unsigned char > patterns
Definition Clusterer.h:59
void processChip(gsl::span< const Digit > digits, int chipFirst, int chipN, std::vector< Cluster > *clustersOut, std::vector< unsigned char > *patternsOut, const ConstDigitTruth *labelsDigPtr, ClusterTruth *labelsClusPtr)
void fetchMCLabels(uint32_t digID, const ConstDigitTruth *labelsDig, int &nfilled)
std::vector< Cluster > clusters
Definition Clusterer.h:58
void finishChipSingleHitFast(gsl::span< const Digit > digits, uint32_t digitIdx, const ConstDigitTruth *labelsDigPtr, ClusterTruth *labelsClusPtr)
ClustererThread(Clusterer *par=nullptr)
Definition Clusterer.h:71
ClustererThread(const ClustererThread &)=delete
std::array< Label, MaxLabels > labelsBuff
MC label buffer for one cluster.
Definition Clusterer.h:55
std::vector< Cluster > clusters
std::vector< Digit > digits