Project
Loading...
Searching...
No Matches
BuildTopologyDictionary.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
22
23#ifndef ALICEO2_TRKFT3_BUILDTOPOLOGYDICTIONARY_H
24#define ALICEO2_TRKFT3_BUILDTOPOLOGYDICTIONARY_H
25
27#include <cstdint>
28#include <string>
29#include <unordered_map>
30#include <vector>
31
32namespace o2::trkft3
33{
34
35template <int DetID>
37{
38 public:
40 using ClusterType = typename Dictionary::ClusterType;
41
42 struct Settings {
44 float depthStep = 0.5e-4f;
45 int nThreads = 1;
46 };
47
48 BuildTopologyDictionary(int nLayers, const Settings& settings);
49
51 void accountCluster(const ClusterType& cluster, const unsigned char* pattern, const math_utils::Point3D<float>& start, const math_utils::Point3D<float>& end);
52
54 void build();
55
56 void setApplyOffsets(bool apply) noexcept { mDictionary.setApplyOffsets(apply); }
57 [[nodiscard]] const Dictionary& getDictionary() const noexcept { return mDictionary; }
59 void saveDictionaryRoot(const std::string& fileName) const;
60
61 private:
63 struct Crossing {
64 uint32_t pattern = 0;
65 float x0 = 0.f;
66 float y0 = 0.f;
67 float z0 = 0.f;
68 float dx = 0.f;
69 float dy = 0.f;
70 float dz = 0.f;
71 };
72 struct LayerInput {
73 std::unordered_map<std::string, uint32_t> patternIndex;
74 std::vector<std::string> patterns;
75 std::vector<Crossing> crossings;
76 };
77
78 [[nodiscard]] float measureDepth(int layer, const LayerInput& input) const;
79 void makeEntries(int layer, const LayerInput& input, LayerDictionary& data) const;
80
81 Settings mSettings;
82 std::vector<LayerInput> mInput;
83 Dictionary mDictionary;
84};
85
88
89} // namespace o2::trkft3
90
91#endif
Positions and errors of TRK and FT3 clusters per layer and pixel pattern.
configStandalone Reconstruction settings
void build()
Builds every layer; throws std::runtime_error for a layer with too few residuals.
typename Dictionary::ClusterType ClusterType
const Dictionary & getDictionary() const noexcept
void accountCluster(const ClusterType &cluster, const unsigned char *pattern, const math_utils::Point3D< float > &start, const math_utils::Point3D< float > &end)
A cluster and its particle's crossing of the chip, in O2's local frame [cm].
void saveDictionaryRoot(const std::string &fileName) const
Writes the dictionary as "ccdb_object".
GLuint GLuint end
Definition glcorearb.h:469
GLuint GLfloat x0
Definition glcorearb.h:5034
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLuint GLfloat GLfloat y0
Definition glcorearb.h:5034
uint32_t minCount
residuals for an entry of its own: the width to 10 %
std::array< uint16_t, 5 > pattern