Project
Loading...
Searching...
No Matches
TopologyDictionary.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
14
15#ifndef ALICEO2_ITS3_TOPOLOGYDICTIONARY_H
16#define ALICEO2_ITS3_TOPOLOGYDICTIONARY_H
17
20
21namespace o2::its3
22{
23
24class BuildTopologyDictionary;
25class LookUp;
26
28 static constexpr int STopoSize{(8 * 255) + 1};
29 std::array<int, STopoSize> mSmallTopologiesLUT{};
30 std::vector<itsmft::GroupStruct> mVectorOfIDs;
31 std::unordered_map<unsigned long, int> mCommonMap;
32 std::unordered_map<int, int> mGroupMap;
33
34 void print() const noexcept;
35
37};
38
40{
41 public:
43 TopologyDictionary(const std::string& fileName);
44
47 static constexpr int RowClassSpan = 4;
48 static constexpr int ColClassSpan = 4;
49 static constexpr int MaxNumberOfRowClasses = 1 + ((itsmft::ClusterPattern::MaxRowSpan - 1) / RowClassSpan);
50 static constexpr int MaxNumberOfColClasses = 1 + ((itsmft::ClusterPattern::MaxColSpan - 1) / ColClassSpan);
51 static constexpr int NumberOfRareGroups = MaxNumberOfRowClasses * MaxNumberOfColClasses;
53 void reset() noexcept;
54 void resetMaps(bool IB = true) noexcept;
56 friend std::ostream& operator<<(std::ostream& os, const its3::TopologyDictionary& dictionary);
58 void writeBinaryFile(const std::string& outputFile);
60 void readBinaryFile(const std::string& fileName);
61 void readFromFile(const std::string& fileName);
62 void print() const noexcept;
63
65 [[nodiscard]] float getXCOG(int n, bool IB = true) const
66 {
67 const auto& data = (IB) ? mDataIB : mDataOB;
68 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
69 return data.mVectorOfIDs[n].mXCOG;
70 }
72 [[nodiscard]] float getErrX(int n, bool IB = true) const
73 {
74 const auto& data = (IB) ? mDataIB : mDataOB;
75 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
76 return data.mVectorOfIDs[n].mErrX;
77 }
79 [[nodiscard]] float getZCOG(int n, bool IB = true) const
80 {
81 const auto& data = (IB) ? mDataIB : mDataOB;
82 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
83 return data.mVectorOfIDs[n].mZCOG;
84 }
86 [[nodiscard]] float getErrZ(int n, bool IB = true) const
87 {
88 const auto& data = (IB) ? mDataIB : mDataOB;
89 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
90 return data.mVectorOfIDs[n].mErrZ;
91 }
93 [[nodiscard]] float getErr2X(int n, bool IB = true) const
94 {
95 const auto& data = (IB) ? mDataIB : mDataOB;
96 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
97 return data.mVectorOfIDs[n].mErr2X;
98 }
100 [[nodiscard]] float getErr2Z(int n, bool IB = true) const
101 {
102 const auto& data = (IB) ? mDataIB : mDataOB;
103 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
104 return data.mVectorOfIDs[n].mErr2Z;
105 }
107 [[nodiscard]] unsigned long getHash(int n, bool IB = true) const
108 {
109 const auto& data = (IB) ? mDataIB : mDataOB;
110 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
111 return data.mVectorOfIDs[n].mHash;
112 }
114 [[nodiscard]] int getNpixels(int n, bool IB = true) const
115 {
116 const auto& data = (IB) ? mDataIB : mDataOB;
117 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
118 return data.mVectorOfIDs[n].mNpixels;
119 }
121 [[nodiscard]] double getFrequency(int n, bool IB = true) const
122 {
123 const auto& data = (IB) ? mDataIB : mDataOB;
124 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
125 return data.mVectorOfIDs[n].mFrequency;
126 }
128 [[nodiscard]] bool isGroup(int n, bool IB = true) const
129 {
130 const auto& data = (IB) ? mDataIB : mDataOB;
131 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
132 return data.mVectorOfIDs[n].mIsGroup;
133 }
135 [[nodiscard]] const itsmft::ClusterPattern& getPattern(int n, bool IB = true) const
136 {
137 const auto& data = (IB) ? mDataIB : mDataOB;
138 assert(n >= 0 && n < (int)data.mVectorOfIDs.size());
139 return data.mVectorOfIDs[n].mPattern;
140 }
141
143 [[nodiscard]] TH1F* getTopologyDistribution(const std::string_view hname, bool IB = true) const;
145 [[nodiscard]] int getSize(bool IB) const
146 {
147 return static_cast<int>((IB) ? mDataIB.mVectorOfIDs.size() : mDataOB.mVectorOfIDs.size());
148 }
150
152 template <typename T = float>
153 math_utils::Point3D<T> getClusterCoordinates(const itsmft::CompClusterExt& cl) const;
154
156 template <typename T = float>
157 static math_utils::Point3D<T> getClusterCoordinates(const itsmft::CompClusterExt& cl, const itsmft::ClusterPattern& patt, bool isGroup = true);
158
159 static TopologyDictionary* loadFrom(const std::string& fileName = "", const std::string& objName = "ccdb_object");
160
162 friend its3::LookUp;
163
164 private:
167
169};
170} // namespace o2::its3
171
172#endif
Definition of the ClusterTopology class.
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc true
const itsmft::ClusterPattern & getPattern(int n, bool IB=true) const
Returns the pattern of the topology.
float getErr2Z(int n, bool IB=true) const
Returns the error^2 on the z position of the COG for the n_th element.
float getErrZ(int n, bool IB=true) const
Returns the error on the z position of the COG for the n_th element.
unsigned long getHash(int n, bool IB=true) const
Returns the hash of the n_th element.
int getNpixels(int n, bool IB=true) const
Returns the number of fired pixels of the n_th element.
double getFrequency(int n, bool IB=true) const
Returns the frequency of the n_th element;.
float getErrX(int n, bool IB=true) const
Returns the error on the x position of the COG for the n_th element.
float getZCOG(int n, bool IB=true) const
Returns the z position of the COG for the n_th element.
int getSize(bool IB) const
Returns the number of elements in the dicionary;.
bool isGroup(int n, bool IB=true) const
Returns true if the element corresponds to a group of rare topologies.
float getErr2X(int n, bool IB=true) const
Returns the error^2 on the x position of the COG for the n_th element.
static constexpr uint8_t MaxRowSpan
static constexpr uint8_t MaxColSpan
TGeoManager * readFromFile(std::string filename)
GLdouble n
Definition glcorearb.h:1982
std::unordered_map< unsigned long, int > mCommonMap
Map of pair <hash, position in mVectorOfIDs>
std::vector< itsmft::GroupStruct > mVectorOfIDs
Vector of topologies and groups.
ClassDefNV(TopologyDictionaryData, 1)
std::unordered_map< int, int > mGroupMap
Map of pair <groudID, position in mVectorOfIDs>
std::array< int, STopoSize > mSmallTopologiesLUT
Look-Up Table for the topologies with 1-byte linearised matrix.